Skip to content

Conversation

@ShawnN003
Copy link

No description provided.

Copy link

@auberonedu auberonedu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job!

Comment on lines +17 to +19
The wipers on the bus go “Swish, swish, swish,
Swish, swish, swish, swish, swish, swish”
The wipers on the bus go “Swish, swish, swish”

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definitely good music. Looks like you might be missing the rambleOutput.txt though asked for in Wave 6?




if(arr[i] == " " || arr[i] == " " || arr[i] == "") //filtering out the extra spaces inside the arrayList

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works! scanner also has the functionality built in to skip whitespace with scanner.next

Comment on lines +62 to +67
else if(arr[i].endsWith("."))
{
arr[i] = arr[i].replace('.', ' ');
textList.add(arr[i].trim().toLowerCase());
textList.add(".");
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice logic

Comment on lines +20 to +28
@Test
void testTokenizeWithMultipleSpaces()
{
LowercaseSentenceTokenizer tokenizer = new LowercaseSentenceTokenizer();
Scanner scanner = new Scanner("hello hi hi hi hello hello");
List<String> tokens = tokenizer.tokenize(scanner);

assertEquals(List.of("hello","hi", "hi","hi", "hello","hello"), tokens);
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice test!

Comment on lines +70 to +81
for(int i = 0; i < trainingWords.size(); i++)
{
keyText = trainingWords.get(i);
for(int j= 0; j < trainingWords.size()-1; j++)
{
if(keyText.equals(trainingWords.get(j)))
{
valueWords.add(trainingWords.get(j+1));
}
}
neighborMap.put(trainingWords.get(i), valueWords);
valueWords = new ArrayList<String>();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice logic! As an alternative, can you think of how this could be done without a nested loop?

Comment on lines +178 to +181
for (int i = 0; i < probaleList.size(); i++) //having the returned probable word return the most likely word from the random number
{
probableWord = probaleList.get(wordProb.nextInt(max - 0 + 1));
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need the for loop here - getting a random word once is enough

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants