Closed cqx931 closed 7 years ago
That warning is fine, but we can't have the error...
In the PR above, I have modified the example code for both 'Analysis' and 'RandomRhymes' (p5 and dom), so that no error message is showing when rita.js is used.
Warning message:
When lex size is 0, what need a warning message are functions that have a for loop iterating through the whole lexicon data set to return something back.(randomWord()
, rhymes()
, _getRawPhones()
...etc.) So I changed all this.data.length
in those for loops to this.size()
and add a warning message in lex.size(), if the lexicon size is zero.
Please let me know if there is any concern about this method.
sounds right
No warning message about lexicon
Analysis
RandomRhymes The page just doesn't load and there is no error message, no response. (it get stuck in the while loop)
Also, currently we don't have a unique warning message for no lexicon. The warning message I got with rita.js when I test in RiLexicon-tests.html is "A minimal Lexicon is currently in use. For word features outside the lexicon, use a larger version of RiTa."