Skip to content

Commit

Permalink
alt impl as comment
Browse files Browse the repository at this point in the history
  • Loading branch information
drahnr committed Apr 7, 2021
1 parent 1f85952 commit 03be1c5
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion nlprule/src/tokenizer/tag.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,22 @@ impl From<TaggerFields> for Tagger {
Default::default(),
Default::default(),
);

let mut stream = word_store_fst.into_stream();
while let Some((key, value)) = stream.next() {
if let Some(key) = std::str::from_utf8(key).ok() {
word_store.insert(key.to_owned(), WordIdInt(value as u32));
}
};
// let word_store_fst = Map::new(data.word_store_fst).unwrap();
// let word_store: FastBiMap<String, WordIdInt> = word_store_fst
// .into_stream()
// .into_str_vec()
// .unwrap()
// .into_iter()
// .map(|(key, value)| (key, WordIdInt(value as u32)))
// .collect();



let mut tags = FastHashMap::new();
let mut groups = FastHashMap::new();
Expand Down

0 comments on commit 03be1c5

Please sign in to comment.