diff --git a/README.md b/README.md index f569bdb..199b0d7 100644 --- a/README.md +++ b/README.md @@ -158,7 +158,7 @@ We have evaluated SentencePiece segmentation with the following configurations. * Segmentation algorithms: * **BPE** (Byte Pair - Encoding) [[Sennrich et al.](http://www.aclweb.org/anthology/P16-1162)]] (`--model_type=bpe`) + Encoding) [[Sennrich et al.](http://www.aclweb.org/anthology/P16-1162)] (`--model_type=bpe`) * **Unigram**. Language-model based segmentation. (`--model_type=unigram`) * Pre-tokenization methods: diff --git a/src/unigram_model.cc b/src/unigram_model.cc index 22b1114..406bb3d 100644 --- a/src/unigram_model.cc +++ b/src/unigram_model.cc @@ -68,8 +68,8 @@ void Lattice::Clear() { end_nodes_.clear(); sentence_.clear(); surface_.clear(); - all_nodes_.clear(); port::STLDeleteElements(&all_nodes_); + all_nodes_.clear(); } void Lattice::SetSentence(StringPiece sentence) { @@ -392,9 +392,8 @@ void ModelBase::BuildTrie(std::vector> *pieces) { } trie_ = port::MakeUnique(); - CHECK_EQ(0, - trie_->build(key.size(), const_cast(&key[0]), nullptr, - &value[0])) + CHECK_EQ(0, trie_->build(key.size(), const_cast(&key[0]), nullptr, + &value[0])) << "cannot build double-array"; // Computes the maximum number of shared prefixes in the trie.