Skip to content

Completed ramblebot#8

Open
Jake-G123 wants to merge 8 commits intogrc-cohort-22:mainfrom
Jake-G123:main
Open

Completed ramblebot#8
Jake-G123 wants to merge 8 commits intogrc-cohort-22:mainfrom
Jake-G123:main

Conversation

@Jake-G123
Copy link
Copy Markdown

The output puts a space before each period which doesn't seem right. It passes all of the tests, so I hope that's how its supposed to be.

@auberonedu
Copy link
Copy Markdown

Don't worry about the failing test, it's because GitHub is using an old version of Java.

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> tokenList = new ArrayList<>();
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 use of interface types

Comment on lines +68 to +69
if (!neighborMap.containsKey(trainingWords.get(i))) {
neighborMap.put(trainingWords.get(i),new ArrayList<String>()); // had issues with all values pointing to same list. Found this: https://stackoverflow.com/questions/7969286/java-how-to-add-values-to-array-list-used-as-value-in-hashmap
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Thanks for citing your source!

Comment on lines +129 to +137
List<String> potentialTokens = new ArrayList<>(neighborMap.get(context.getLast()));
Random random = new Random();
int tokenID = random.nextInt(potentialTokens.size());
if (potentialTokens.get(tokenID)!=null) {
return potentialTokens.get(tokenID);
}
else {
return null;
}
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!

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