Skip to content

rambleBot Assignment#23

Open
JSaiyan wants to merge 13 commits intogrc-cohort-21:mainfrom
JSaiyan:main
Open

rambleBot Assignment#23
JSaiyan wants to merge 13 commits intogrc-cohort-21:mainfrom
JSaiyan:main

Conversation

@JSaiyan
Copy link

@JSaiyan JSaiyan commented Jan 30, 2025

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!

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

Choose a reason for hiding this comment

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

gotta catch 'em all

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

Choose a reason for hiding this comment

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

Nice!

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);

}

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 +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.
}

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 +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);

Choose a reason for hiding this comment

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

great logic!

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