Codota Logo
Word.getString
Code IndexAdd Codota to your IDE (free)

How to use
getString
method
in
com.chenlb.mmseg4j.Word

Best Java code snippets using com.chenlb.mmseg4j.Word.getString (Showing top 15 results out of 315)

  • Common ways to obtain Word
private void myMethod () {
Word w =
  • Codota IconMMSeg mMSeg;mMSeg.next()
  • Smart code suggestions by Codota
}
origin: looly/hutool

@Override
public String getText() {
  return word.getString();
}
 
origin: looly/hutool

@Override
public String getText() {
  return word.getString();
}
 
origin: hugegraph/hugegraph

  @Override
  public Set<String> segment(String text) {
    Set<String> result = InsertionOrderUtil.newSet();
    MMSeg mmSeg = new MMSeg(new StringReader(text), this.seg);
    try {
      Word word = null;
      while ((word = mmSeg.next()) != null) {
        result.add(word.getString());
      }
    } catch (Exception e) {
      throw new HugeException("MMSeg4j segment text '%s' failed",
                  e, text);
    }
    return result;
  }
}
origin: cn.hutool/hutool-all

@Override
public String getText() {
  return word.getString();
}
 
origin: medcl/elasticsearch-analysis-mmseg

public String toString() {
  return getString();
}
/**
origin: com.chenlb.mmseg4j/mmseg4j-core

public String toString() {
  return getString();
}
/**
origin: chenlb/mmseg4j-core

public String toString() {
  return getString();
}
/**
origin: chenlb/mmseg4j-core

@Override
public String toString() {
  StringBuilder sb = new StringBuilder();
  for(Word word : words) {
    if(word != null) {
      sb.append(word.getString()).append('_');
    }
  }
  return sb.toString();
}
 
origin: medcl/elasticsearch-analysis-mmseg

@Override
public String toString() {
  StringBuilder sb = new StringBuilder();
  for(Word word : words) {
    if(word != null) {
      sb.append(word.getString()).append('_');
    }
  }
  return sb.toString();
}
 
origin: com.chenlb.mmseg4j/mmseg4j-core

@Override
public String toString() {
  StringBuilder sb = new StringBuilder();
  for(Word word : words) {
    if(word != null) {
      sb.append(word.getString()).append('_');
    }
  }
  return sb.toString();
}
 
origin: chenlb/mmseg4j-core

public String segWords(Reader input, String wordSpilt) throws IOException {
  StringBuilder sb = new StringBuilder();
  Seg seg = getSeg();    //取得不同的分词具体算法
  MMSeg mmSeg = new MMSeg(input, seg);
  Word word = null;
  boolean first = true;
  while((word=mmSeg.next())!=null) {
    if(!first) {
      sb.append(wordSpilt);
    }
    String w = word.getString();
    sb.append(w);
    first = false;
    
  }
  return sb.toString();
}
 
origin: com.chenlb.mmseg4j/mmseg4j-core

public String segWords(Reader input, String wordSpilt) throws IOException {
  StringBuilder sb = new StringBuilder();
  Seg seg = getSeg();    //取得不同的分词具体算法
  MMSeg mmSeg = new MMSeg(input, seg);
  Word word = null;
  boolean first = true;
  while((word=mmSeg.next())!=null) {
    if(!first) {
      sb.append(wordSpilt);
    }
    String w = word.getString();
    sb.append(w);
    first = false;
    
  }
  return sb.toString();
}
 
origin: net.sf.jabb/jabb-core

public List<String> getWords(String document){
  List<String> words = new FastList<String>();
  
  Reader sr = new StringReader(document.toString());
  this.reset(sr);
  
  Word word = null;
  List<String> identifiedWords = chineseWordIdentifier.getIdentifiedWords();
  try {
    while(true) {
      word = this.next();
      if (word != null){	// MMSeg分出来的非中文词条
        words.add(word.getString());
      } else if (identifiedWords.size() > 0){	//自己分出来的中文词条
        words.addAll(identifiedWords);
        identifiedWords.clear();
      } else {	//没词了
        break;
      }
      
    }
  } catch (IOException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
  }
  
  return words;
}
origin: com.baidu.hugegraph/hugegraph-core

  @Override
  public Set<String> segment(String text) {
    Set<String> result = InsertionOrderUtil.newSet();
    MMSeg mmSeg = new MMSeg(new StringReader(text), this.seg);
    try {
      Word word = null;
      while ((word = mmSeg.next()) != null) {
        result.add(word.getString());
      }
    } catch (Exception e) {
      throw new HugeException("MMSeg4j segment text '%s' failed",
                  e, text);
    }
    return result;
  }
}
origin: net.sf.jabb/jabb-core

@Override
void analyzeWords(AnalyzedText aText) {
  FastList<String> list = new FastList<String>();
  FastSet<String> set = new FastSet<String>();
  com.chenlb.mmseg4j.Word word = null;
  Reader sr = new StringReader(aText.getText());
  synchronized(mmSeg){
    mmSeg.reset(sr);
    try{
      while((word=mmSeg.next())!=null) {
        String w = word.getString();
        list.add(w);
        set.add(w);
      }
    }catch(IOException e){
      throw new RuntimeException("IOException occurred", e);
    }
  }
  aText.setWords(list);
  aText.setUniqueWords(set);
}
com.chenlb.mmseg4jWordgetString

Popular methods of Word

  • getStartOffset
    此 word 在整个文本中的偏移位置
  • getEndOffset
  • getLength
  • getSen
  • getWordOffset
    词在 char[] sen 的偏移位置
  • getType
  • <init>
  • getDegree
  • setDegree

Popular in Java

  • Making http post requests using okhttp
  • notifyDataSetChanged (ArrayAdapter)
  • onRequestPermissionsResult (Fragment)
  • setScale (BigDecimal)
    Returns a BigDecimal whose scale is the specified value, and whose value is numerically equal to thi
  • FileOutputStream (java.io)
    A file output stream is an output stream for writing data to aFile or to a FileDescriptor. Whether
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • HashSet (java.util)
    This class implements the Set interface, backed by a hash table (actually a HashMap instance). It m
  • Set (java.util)
    A collection that contains no duplicate elements. More formally, sets contain no pair of elements e1
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now