Conversation
auberonedu
reviewed
Feb 18, 2025
| @@ -0,0 +1 @@ | |||
| i will pull us through you pokémon (gotta catch 'em all) gotta catch 'em all) gotta catch 'em all), it's you pokémon (gotta catch 'em all gotta catch 'em all), it's my best friend in a world we must defend pokémon (gotta catch 'em all), it's you teach me i know it's always been our courage will pull us through you and i'll teach you and me i will pull us through you pokémon (gotta catch 'em all, yeah pokémon (gotta catch 'em all), a world we must defend pokémon (gotta catch 'em all), it's you teach pokémon (gotta catch No newline at end of file | |||
| String word = scanner.next().toLowerCase(); //looks at the beginning of the word to see if it exists then adds with .add. | ||
| //.toLowerCase sets the string to all lower case letters | ||
|
|
||
| if (word.endsWith(".")) //we want to check the period. at the end of the sentence |
Comment on lines
+20
to
+29
| @Test | ||
| void testTokenizeWithSpaces() | ||
| { | ||
| 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); | ||
|
|
||
| } |
Comment on lines
+70
to
+78
| for(int j = 0; j < trainingWords.size(); j++) | ||
| { | ||
|
|
||
| // TODO: Convert the trainingWords into neighborMap here | ||
|
|
||
| if(keyWord.equals(trainingWords.get(j)) && j + 1 < trainingWords.size()) //checks the values that are in keyWord and trainingWords and see if the values in index j matches. | ||
| { | ||
| int k = j + 1; //storing index j + 1 to a variable | ||
| keyValue.add(trainingWords.get(k)); //actually doing something after the iterating. with .add by adding the string in the position of keyWordNext. | ||
| } |
Comment on lines
+140
to
+144
| String lastWord = context.get(context.size() -1); //size will start with 1. index is 0. Get will want to get a number. | ||
|
|
||
| List<String> chosenList = neighborMap.get(lastWord); //getting last | ||
| int randomly = (int)(Math.random() * chosenList.size()); //using math.random to autogenerate | ||
| return chosenList.get(randomly); |
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.