Skip to content

Rambo bot working#30

Open
NurMohamed-system wants to merge 5 commits intogrc-cohort-21:mainfrom
NurMohamed-system:main
Open

Rambo bot working#30
NurMohamed-system wants to merge 5 commits intogrc-cohort-21:mainfrom
NurMohamed-system:main

Conversation

@NurMohamed-system
Copy link

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 on the initial tokenization! However, it looks like the later waves aren't quite finished.

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;
ArrayList<String> tokenizedList = new ArrayList<>();

Choose a reason for hiding this comment

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

Remember to use interface types where appropriate (List)

Comment on lines +37 to +40
while (scanner.hasNext()) {
String item = scanner.next();
tokenizedList.add(item);
}

Choose a reason for hiding this comment

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

This works well for spaces, but doesn't quite handle the periods

Comment on lines +22 to +29
@Test
void testNoSpaceToken() {
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 +52 to +62
public List<String> train(Scanner scanner) {
List<String> trainingWords = tokenizer.tokenize(scanner);


// TODO: Convert the trainingWords into neighborMap here
while (scanner.hasNext()) {
String train = scanner.next();
trainingWords.add(train);
}

return trainingWords;

Choose a reason for hiding this comment

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

This doesn't quite implement the logic we're hoping for - we were looking to fill the neighborMap here.

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