Add tokenizer
This commit is contained in:
parent
e910d9c5f4
commit
331e264399
7 changed files with 119 additions and 33 deletions
7
backend/reconcile/src/tokenizer/word_tokenizer.rs
Normal file
7
backend/reconcile/src/tokenizer/word_tokenizer.rs
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
use super::token::Token;
|
||||
|
||||
pub fn word_tokenizer(text: &str) -> Vec<Token<String>> {
|
||||
text.split_inclusive(char::is_whitespace)
|
||||
.map(|s| Token::new(s.to_string(), s.to_string()))
|
||||
.collect()
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue