Skip to content

Commit

Permalink
fixed to pass tests #409
Browse files Browse the repository at this point in the history
  • Loading branch information
dhowe committed Apr 18, 2017
1 parent 2afed3a commit a0c39c9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
18 changes: 12 additions & 6 deletions java/rita/RiLexicon.java
Original file line number Diff line number Diff line change
Expand Up @@ -188,13 +188,19 @@ public String randomWord(int syllableCount) {
*/
public String randomWord(String pos, int syllableCount) {

boolean pluralize = pos.equals("nns");
boolean pluralize = false;

if (pos.equals("v")) pos = "vb";
if (pos.equals("r")) pos = "rb";
if (pos.equals("a")) pos = "jj";
if (pos.equals("n") || pos.equals("nns"))
pos = "nn";
if (pos != null) {
pluralize = pos.equals("nns");
if (pos.equals("v"))
pos = "vb";
if (pos.equals("r"))
pos = "rb";
if (pos.equals("a"))
pos = "jj";
if (pos.equals("n") || pos.equals("nns"))
pos = "nn";
}

Iterator<String> it = getIterator(pos);

Expand Down
1 change: 0 additions & 1 deletion java/rita/test/RiLexiconTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,6 @@ public void testLexicalData() {
@Test
public void testRandomWord() {


RiLexicon lex = new RiLexicon();

String result = lex.randomWord();
Expand Down

0 comments on commit a0c39c9

Please sign in to comment.