research/seq_flow_lite/tf_ops/projection_normalizer_util.cc
// Counts how many times |pattern| appeared from |start| position.
Counts how many times |pattern| appeared from |start| position.
Counts how many times |pattern| appeared from |start| position .
int GetNumPattern(const std::vector<std::string>& char_tokens, size_t start,
                  size_t num_chars, const std::string& pattern) {
  int count = 0;
  for (size_t i = start; i < char_tokens.size(); i += num_chars) {
    std::string cur_pattern = GetCharToken(char_tokens, i, num_chars);
    if (pattern == cur_pattern) {
      ++count;
    } else {
      break;
    }
  }
  return count;
}
int GetNumPattern ( const std :: vector < std :: string > & char_tokens , size_t start , size_t num_chars , const std :: string & pattern ) { int count = 0 ; for ( size_t i = start ; i < char_tokens . size ( ) ; i += num_chars ) { std :: string cur_pattern = GetCharToken ( char_tokens , i , num_chars ) ; if ( pattern == cur_pattern ) { ++ count ; } else { break ; } } return count ; }
Counts how many times |pattern| appeared from |start| position.
Counts how many times |pattern| appeared from |start| position .