@@ -34,7 +34,7 @@ class RhymeHelperBG {
34
34
for ( let withVowel of withWordVowels ) {
35
35
if ( vowel . letter === withVowel . letter ) {
36
36
if ( vowel . position === withVowel . position ) {
37
- rhymeRate = rhymeRate + 0.5 ;
37
+ rhymeRate = rhymeRate + 0.5 ;
38
38
} else {
39
39
rhymeRate = rhymeRate + 0.05 ;
40
40
}
@@ -44,14 +44,12 @@ class RhymeHelperBG {
44
44
}
45
45
46
46
if ( wordLastFourLetters === withWordLastFourLetters ) {
47
- rhymeRate = rhymeRate + 1 ;
48
- }
49
- if ( wordLastThreeLetters === withWordLastThreeLetters ) {
47
+ rhymeRate = rhymeRate + 1 ;
48
+ } else if ( wordLastThreeLetters === withWordLastThreeLetters ) {
50
49
rhymeRate = rhymeRate + 0.5 ;
50
+ } else if ( wordLastTwoLetters === withWordLastTwoLetters ) {
51
+ rhymeRate = rhymeRate + 0.05 ;
51
52
}
52
- // if (wordLastTwoLetters === withWordLastTwoLetters) {
53
- // rhymeRate = rhymeRate + 0.05;
54
- // }
55
53
56
54
if ( wordSimilar . length > 0 ) {
57
55
for ( let similar of wordSimilar ) {
@@ -60,14 +58,12 @@ class RhymeHelperBG {
60
58
let wordSimilarThreeLetters = similar . substring ( similar . length - 3 ) ;
61
59
let wordSimilarFourLetters = similar . substring ( similar . length - 4 ) ;
62
60
63
- // if (wordSimilarTwoLetters === withWordLastTwoLetters) {
64
- // rhymeRate = rhymeRate + 0.05;
65
- // }
66
- if ( wordSimilarThreeLetters === withWordLastThreeLetters ) {
67
- rhymeRate = rhymeRate + 0.5 ;
68
- }
69
61
if ( wordSimilarFourLetters === withWordLastFourLetters ) {
70
62
rhymeRate = rhymeRate + 1 ;
63
+ } else if ( wordSimilarThreeLetters === withWordLastThreeLetters ) {
64
+ rhymeRate = rhymeRate + 0.5 ;
65
+ } else if ( wordSimilarTwoLetters === withWordLastTwoLetters ) {
66
+ rhymeRate = rhymeRate + 0.05 ;
71
67
}
72
68
73
69
}
0 commit comments