Skip to content

ramblebot PR#25

Open
abdirashidexe wants to merge 18 commits intogrc-cohort-21:mainfrom
abdirashidexe:main
Open

ramblebot PR#25
abdirashidexe wants to merge 18 commits intogrc-cohort-21:mainfrom
abdirashidexe:main

Conversation

@abdirashidexe
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.

Nice job! It looks like some of the final waves aren't quite working, but what you do have looks great!

Comment on lines +42 to +50
/*if (scanner.next().endsWith("."))
{
String[] wordArray = scanner.next().split("");
if (wordArray[wordArray.length-1] == ".")
{
tokensList.add(scanner.next().toLowerCase());
}
}
*/

Choose a reason for hiding this comment

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

Remember to delete unneeded comments once you're done with them

Comment on lines +53 to +57
if (word.endsWith("."))
{
String wordWithoutPeriod = word.replace(".", "");
tokensList.add(wordWithoutPeriod);
tokensList.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 +22 to +32
@Test
void testCodeHandlesInputWithManyCase()
{
// Arrange
LowercaseSentenceTokenizer tokenizer = new LowercaseSentenceTokenizer();
Scanner scanner = new Scanner("hi hi hi");
List<String> tokens = tokenizer.tokenize(scanner);

// Act & Assert
assertEquals(List.of("hi", "hi", "hi"), tokens);
}

Choose a reason for hiding this comment

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

This doesn't quite test what we were looking for. We wanted to see whether your code could handle multiple spaces in a row, e.g. hi hi hello

Comment on lines +63 to +73
if (!neighborMap.containsKey(trainingWords.get(i)))
{
wordFollowUpList.add(trainingWords.get(i+1));
neighborMap.put(trainingWords.get(i), wordFollowUpList);
}
else
{
List<String> currentWordsList = neighborMap.get(trainingWords.get(i));
currentWordsList.add(trainingWords.get(i+1));
neighborMap.put(trainingWords.get(i), currentWordsList);
}

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 +127 to +132
String startingWord = "";
List<String> temp = new ArrayList<String>();
temp.addAll(getNeighborMap().keySet());
startingWord = temp.get(0);
System.out.println("TEMP: " + temp);
System.out.println("STARTING WORD: " + startingWord);

Choose a reason for hiding this comment

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

I like where you're headed with this, but I think there might be some misunderstanding about what context represents. Always feel free to come by tutoring or office hours if you're unsure!

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