Question
***Reduction and transformation The syllable reduction is meant to reduce the number of the different syllables in a text. The user inputs a value that
***Reduction and transformation
The syllable reduction is meant to reduce the number of the different syllables in a text. The user inputs a value that indicates the number of syllables (k) that he should have in the final text. We reduce the syllables, one at a time until were left with k. If there is less than k at the beginning, then there is no reduction. To remove a syllable, you can find the syllable to remove and then replace it by the syllable that should replace it.
To do these operations, you must find the distance between each pair of possible different syllables in the text. For example, the following text has 4 different syllables:
fu.ta.fu.ma.fu.ta.fu.na.fu.ta.fu.ma.fu.ta.fu
So, we have 6 pairs of different syllables. We now must calculate the distances between them
Once we have the distances between each pair, were only left with choosing the pair that has the smallest distance. In the example, its the pair ma & na. Then, we must choose the syllable that will be replaced by another. For that, well use the occurrences of the syllables. The syllable of the pair that has the highest occurrence will replace the syllable with the lowest occurrence. In our example, the syllable ma has an occurrence of 2 and the syllable na has an occurrence of 1. So, were going to replace the syllables na by the syllables ma in the text. After this replacement, we must readjust the number of occurrences of the syllables ma in the text. Since there was 1 occurrence of the syllable na, this adds 1 occurrence of syllable ma who has now an occurrence of 3.
I want it in java
You need more info like what?
Syllabe 2 ta ma Syllabe 1 fu fu fu ta ta na Distance 10 11 12 3 2 1 ma na ma na Syllabe 2 ta ma Syllabe 1 fu fu fu ta ta na Distance 10 11 12 3 2 1 ma na ma na
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started