예제 #1
0
 /// no benefit to using string_span to query; will create string anyway
 Sym addSymbolMustBeNew(std::string const& word) {
   SymInt const oldsz = size();
   SymInt const i = symbols_.index(word);
   if (size() == oldsz || i >= maxLstSize_)
     throw std::out_of_range("BasicVocab::addSymbolMustBeNew-string was not new");
   return symForIndex(i);
 }
예제 #2
0
 SymInt indexAdding(cstring_span<> word) {
   SymInt i = symbols_.index(word);
   assert(i < maxLstSize_);
   return i;
 }
예제 #3
0
 Sym add(std::string const& word) {
   SymInt i = symbols_.index(word);
   assert(i < maxLstSize_);
   return symForIndex(i);
 }
예제 #4
0
 SymInt indexAdding(std::string const& word) {
   SymInt i = symbols_.index(word);
   assert(i < maxLstSize_);
   return i;
 }
예제 #5
0
 Sym add(cstring_span<> word) {
   SymInt i = symbols_.index(word);
   assert(i < maxLstSize_);
   return symForIndex(i);
 }