Skip to content

done with Wave 6#11

Open
Dani-DEV28 wants to merge 12 commits intogrc-cohort-21:mainfrom
Dani-DEV28:main
Open

done with Wave 6#11
Dani-DEV28 wants to merge 12 commits intogrc-cohort-21:mainfrom
Dani-DEV28:main

Conversation

@Dani-DEV28
Copy link
Copy Markdown

No description provided.

Copy link
Copy Markdown

@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 thread ramblebotOutput.txt
@@ -0,0 +1 @@
the raven, "nevermore." "be that is there--_is_ there stepped a sainted maiden whom the raven, "nevermore." much i cried, "thy god hath sent thee respite--respite and take thy soul into the beating of evil!--prophet still, if bird or lady, perched upon the countenance it is, and store, caught from out that is some visiter entreating entrance at my chamber door." "here i had sought to borrow from my soul with fantastic terrors never flitting, still a flirt and sat, and so gently you came tapping, tapping at my hopes have flown before-- on the angels name lenore." "sorrow for we No newline at end of file
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Spooky!

}

public boolean seperatePeriods(String wordsLastCheck){
char checkLastChara = wordsLastCheck.charAt(wordsLastCheck.length()-1);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Nice! You can also do this with endsWith

Comment on lines 33 to +39
public List<String> tokenize(Scanner scanner) {
// TODO: Implement this function to convert the scanner's input to a list of words and periods
return null;
List<String> intialStep = breakLineDetect(scanner);
// System.out.println(intialStep.size());
// System.out.println(intialStep);

return intialStep;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cool doing this decomposed across helper methods

Comment on lines +19 to +26
@Test
void testTokenizeWithNoSpace() {
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);
}
Copy link
Copy Markdown

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 +69 to 74
for (int i = 0; i < trainingWords.size()-1; i++){
if(neighborMap.containsKey(trainingWords.get(i))){
neighborMap.get(trainingWords.get(i)).add(trainingWords.get(i+1));
}
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Great!

Comment on lines +123 to +132
Random random = new Random();
String lastWord = context.get(context.size() - 1);
List<String> neighbors = neighborMap.get(lastWord);

int lowerLimit = 0;
int upperLimit = neighbors.size() - 1;

int randomNumber = random.nextInt(upperLimit - lowerLimit + 1) + lowerLimit;

return neighbors.get(randomNumber);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Nice variable names

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