Tabnine Logo
Word.getString
Code IndexAdd Tabnine 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)

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 requests using okhttp
  • getResourceAsStream (ClassLoader)
  • setContentView (Activity)
  • setRequestProperty (URLConnection)
  • TimeZone (java.util)
    TimeZone represents a time zone offset, and also figures out daylight savings. Typically, you get a
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • LogFactory (org.apache.commons.logging)
    Factory for creating Log instances, with discovery and configuration features similar to that employ
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now