@@ -34,7 +34,7 @@ class RhymeHelperBG {
3434 for ( let withVowel of withWordVowels ) {
3535 if ( vowel . letter === withVowel . letter ) {
3636 if ( vowel . position === withVowel . position ) {
37- rhymeRate = rhymeRate + 0.5 ;
37+ rhymeRate = rhymeRate + 0.5 ;
3838 } else {
3939 rhymeRate = rhymeRate + 0.05 ;
4040 }
@@ -44,14 +44,12 @@ class RhymeHelperBG {
4444 }
4545
4646 if ( wordLastFourLetters === withWordLastFourLetters ) {
47- rhymeRate = rhymeRate + 1 ;
48- }
49- if ( wordLastThreeLetters === withWordLastThreeLetters ) {
47+ rhymeRate = rhymeRate + 1 ;
48+ } else if ( wordLastThreeLetters === withWordLastThreeLetters ) {
5049 rhymeRate = rhymeRate + 0.5 ;
50+ } else if ( wordLastTwoLetters === withWordLastTwoLetters ) {
51+ rhymeRate = rhymeRate + 0.05 ;
5152 }
52- // if (wordLastTwoLetters === withWordLastTwoLetters) {
53- // rhymeRate = rhymeRate + 0.05;
54- // }
5553
5654 if ( wordSimilar . length > 0 ) {
5755 for ( let similar of wordSimilar ) {
@@ -60,14 +58,12 @@ class RhymeHelperBG {
6058 let wordSimilarThreeLetters = similar . substring ( similar . length - 3 ) ;
6159 let wordSimilarFourLetters = similar . substring ( similar . length - 4 ) ;
6260
63- // if (wordSimilarTwoLetters === withWordLastTwoLetters) {
64- // rhymeRate = rhymeRate + 0.05;
65- // }
66- if ( wordSimilarThreeLetters === withWordLastThreeLetters ) {
67- rhymeRate = rhymeRate + 0.5 ;
68- }
6961 if ( wordSimilarFourLetters === withWordLastFourLetters ) {
7062 rhymeRate = rhymeRate + 1 ;
63+ } else if ( wordSimilarThreeLetters === withWordLastThreeLetters ) {
64+ rhymeRate = rhymeRate + 0.5 ;
65+ } else if ( wordSimilarTwoLetters === withWordLastTwoLetters ) {
66+ rhymeRate = rhymeRate + 0.05 ;
7167 }
7268
7369 }
0 commit comments