示例#1
0
文件: stemming.cpp 项目: Accio/snap
TStr TPorterStemmer::StemX(const TStr& s){
  TChA buf = s; buf.ToUc();
  int len = buf.Len(); char *p = buf.CStr();
  if (len > 1 && p[len - 1] == 'S' && p[len - 2] == '\'')
    p[len - 2] = '\0';
  else if (len > 0 && p[len - 1] == '\'')
    p[len - 1] = '\0';
  return StemInPlace(p);
}
示例#2
0
文件: stemming.cpp 项目: Zala/qminer
TStr TPorterStemmer::Stem(const TStr& s) {
    TChA buf = s;
    buf.ToUc();
    return StemInPlace(buf.CStr());
}