Open
Conversation
auberonedu
reviewed
Feb 18, 2025
auberonedu
left a comment
There was a problem hiding this comment.
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()); | ||
| } | ||
| } | ||
| */ |
There was a problem hiding this comment.
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("."); |
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); | ||
| } |
There was a problem hiding this comment.
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); | ||
| } |
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); |
There was a problem hiding this comment.
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!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.