Exemplo n.º 1
0
inline SymsIndex countRuleSrcSymbols(Syms const& ngram) {
  SymsIndex r = 0;
  for (Syms::const_iterator i = ngram.begin(), e = ngram.end(); i != e; ++i)
    r += Vocabulary::isRuleSrcSymbol(*i);
  return r;
}
Exemplo n.º 2
0
 /**
    convenience. doesn't call finishPhrase.
 */
 void phrase(Syms const& syms, IVocabulary& voc) const {
   for (Syms::const_iterator i = syms.begin(), e = syms.end(); i != e; ++i) operator()(voc.str(*i));
 }
Exemplo n.º 3
0
Arquivo: Syms.hpp Projeto: graehl/hyp
inline bool isLexical(Syms const& syms) {
  for (Syms::const_iterator i = syms.begin(), e = syms.end(); i != e; ++i)
    if (!i->isLexical())
      return false;
  return true;
}
Exemplo n.º 4
0
Arquivo: Syms.hpp Projeto: graehl/hyp
inline unsigned nLexical(Syms const& syms) {
  unsigned count = 0;
  for (Syms::const_iterator i = syms.begin(), e = syms.end(); i != e; ++i)
    count += i->isLexical();
  return count;
}
Exemplo n.º 5
0
Arquivo: Syms.hpp Projeto: graehl/hyp
 std::size_t operator()( Syms const& sig ) const
 {
   return RangeHash(sig.begin(), sig.end());
 }