Examples of Word


Examples of com.chenlb.mmseg4j.Word

  //lucene 2.9/3.0
  @Override
  public boolean incrementToken() throws IOException {
    clearAttributes();
    Word word = mmSeg.next();
    if(word != null) {
      //lucene 3.0
      //termAtt.setTermBuffer(word.getSen(), word.getWordOffset(), word.getLength());
      //lucene 3.1
      termAtt.copyBuffer(word.getSen(), word.getWordOffset(), word.getLength());
      offsetAtt.setOffset(word.getStartOffset(), word.getEndOffset());
      typeAtt.setType(word.getType());
      return true;
    } else {
      end();
      return false;
    }
View Full Code Here

Examples of com.chenlb.mmseg4j.Word

     
    });
    long time = 0;
    for(File txt : txts) {
      MMSeg mmSeg = new MMSeg(new InputStreamReader(new FileInputStream(txt)), seg);
      Word word = null;
      OutputStreamWriter osw = new OutputStreamWriter(new FileOutputStream(new File(txt.getAbsoluteFile()+"."+mode+".word")));
      BufferedWriter bw = new BufferedWriter(osw);
      long start = System.currentTimeMillis();
      while((word=mmSeg.next())!=null) {

        bw.append(new String(word.getString())).append("\r\n");
      }
      time += System.currentTimeMillis() - start;
      bw.close();
    }
    System.out.println("use "+time+"ms");
View Full Code Here

Examples of com.chenlb.mmseg4j.Word

 
  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();
View Full Code Here

Examples of com.chenlb.mmseg4j.Word

  //lucene 2.9/3.0
  @Override
  public final boolean incrementToken() throws IOException {
    clearAttributes();
    Word word = mmSeg.next();
    if(word != null) {
      //lucene 3.0
      //termAtt.setTermBuffer(word.getSen(), word.getWordOffset(), word.getLength());
      //lucene 3.1
      termAtt.copyBuffer(word.getSen(), word.getWordOffset(), word.getLength());
      offsetAtt.setOffset(word.getStartOffset(), word.getEndOffset());
      typeAtt.setType(word.getType());
      return true;
    } else {
      end();
      return false;
    }
View Full Code Here

Examples of com.dotcms.repackage.com.swabunga.spell.engine.Word

    List suggestions = new ArrayList();

    Iterator itr = event.getSuggestions().iterator();

    while (itr.hasNext()) {
      Word word = (Word)itr.next();

      suggestions.add(word.getWord());
    }

    int pos = event.getWordContextPosition();

    if (pos >= 0) {
View Full Code Here

Examples of com.nanolaba.surtur.core.Word

                    for (String word : line.split(" ")) {
                        if (isUserCancelled()) {
                            throw new IllegalStateException("Loading cancelled");
                        }
                        if (word != null) {
                            Word translate = getTranslator().translate(lang1, lang2, word);
                            paragraph.getWords().add(translate);
                            paragraph.getWords().add(Word.SPACE);
                        }
                    }
                    fireChangeCurrent(file, currentSymbol = currentSymbol + line.length() + 1, size, "");
View Full Code Here

Examples of com.sun.jna.platform.win32.WinDef.WORD

        typeAttr.memidConstructor = new MEMBERID(2);
        typeAttr.memidDestructor = new MEMBERID(3);
        typeAttr.lpstrSchema = new LPOLESTR("Hello World");
        typeAttr.cbSizeInstance = new ULONG(4);
        typeAttr.typekind = new TYPEKIND(5);
        typeAttr.cFuncs = new WORD(6);
        typeAttr.cVars = new WORD(7);
        typeAttr.cImplTypes = new WORD(8);
        typeAttr.cbSizeVft = new WORD(9);
        typeAttr.cbAlignment = new WORD(10);
        typeAttr.wMajorVerNum = new WORD(11);
        typeAttr.wMinorVerNum = new WORD(12);
        typeAttr.tdescAlias = new TYPEDESC();
        typeAttr.idldescType = new IDLDESC();

        typeAttr.write();
        typeAttr.read();
View Full Code Here

Examples of com.swabunga.spell.engine.Word

        if (isSupposedToBeCapitalized(word, tokenizer)) {
          errors++;
          StringBuffer buf = new StringBuffer(word);
          buf.setCharAt(0, Character.toUpperCase(word.charAt(0)));
          Vector suggestion = new Vector();
          suggestion.addElement(new Word(buf.toString(), 0));
          SpellCheckEvent event = new BasicSpellCheckEvent(word, suggestion, tokenizer);
          terminated = fireAndHandleEvent(tokenizer, event);
        }
      }
    }
View Full Code Here

Examples of eas.math.fundamentalAlgorithms.graphBased.algorithms.type0grammars.Word

                new Vector2D(0, 0),
                180,
                new Vector2D(1.2, 1.2));
       
        ArrayList<Word> start = new ArrayList<Word>(50);
        start.add(new Word(new Symbol[] {this.grammar.getStartSymbol()}));
        addWords.add(start);
       
        frame = new GrammarFrame("Non-final words in temp. storage", this);
        frame.setSize(600, 600);
        frame.setVisible(true);
View Full Code Here

Examples of edu.cmu.sphinx.linguist.dictionary.Word

     * @param beginTime
     * @param endTime
     * @return the new Node
     */
    public Node addNode(String id, String word, int beginTime, int endTime) {
        Word w = new Word(word, new Pronunciation[0], false);
        return addNode(id, w, beginTime, endTime);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.