Created
September 25, 2019 02:26
-
-
Save IntegerMan/e7905575f8bf52b536074bc9cb8c2565 to your computer and use it in GitHub Desktop.
This file contains 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
private extractTokensFromInput(sentence: string): CommandToken[] { | |
const lexer = LexiconService.instance; | |
sentence = lexer.replaceWords(sentence); | |
// Break down the input into command tokens | |
const tokens: CommandToken[] = this.nlp.getTokensForSentence(sentence); | |
// Some tokens are shortcuts for common actions. These should be replaced as if the user had spoken the full word. | |
lexer.replaceTokens(tokens, this.nlp); | |
return tokens; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment