/// 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); }
SymInt indexAdding(cstring_span<> word) { SymInt i = symbols_.index(word); assert(i < maxLstSize_); return i; }
Sym add(std::string const& word) { SymInt i = symbols_.index(word); assert(i < maxLstSize_); return symForIndex(i); }
SymInt indexAdding(std::string const& word) { SymInt i = symbols_.index(word); assert(i < maxLstSize_); return i; }
Sym add(cstring_span<> word) { SymInt i = symbols_.index(word); assert(i < maxLstSize_); return symForIndex(i); }