Exemplo n.º 1
0
void PartialSegmentationUtils::trim_partial_tag(const std::string& input, std::string& output) {
  if (startswith(input, __word_start__)) {
    output = input.substr(__word_start__.length(),
        input.length() - __word_start__.length() - __word_end__.length());
  } else if (startswith(input, __partial_start__)) {
    output = input.substr(__partial_start__.length(),
        input.length() - __partial_start__.length() - __partial_end__.length());
  } else {
    output = input;
  }
}
Exemplo n.º 2
0
bool PartialSegmentationUtils::is_partial_tagged_word(const std::string& word) {
  return startswith(word, __word_start__);
}