Examples of Word


Examples of net.yacy.kelondro.data.word.Word

        }
        */

        // check if the token appears in the text
        if (words.containsKey(token)) {
          final Word word = words.get(token);
          // token appears in text and matches an existing bookmark tag
          if (tags.containsKey(token)) {
            count = word.occurrences() * tags.get(token).size() * 100;
          }
          // token appears in text and has more than 3 characters
          if (token.length()>3) {
            count = word.occurrences() * 100;
          }
          topwords.add(new YMarkTag(token, count));
        }
      }
      count = 0;
View Full Code Here

Examples of net.yacy.kelondro.data.word.Word

  public YMarkWordCountComparator(final Map<String,Word> words) {
    this.words = words;
  }
 
  public int compare(final String k1, final String k2) {
    final Word w1 = this.words.get(k1);
    final Word w2 = this.words.get(k2);
   
        if(w1.occurrences() > w2.occurrences())
            return 1;
        else if(w1.occurrences() < w2.occurrences())
            return -1;
        else
            return 0;
  }
View Full Code Here

Examples of net.yacy.kelondro.data.word.Word

                insertTextToWords(ientry.alt(), 99, flag_cat_hasimage, RESULT_FLAGS, true, meaningLib);
            }
       
            // finally check all words for missing flag entry
            final Iterator<Map.Entry<String, Word>> k = words.entrySet().iterator();
            Word wprop;
            Map.Entry<String, Word> we;
            while (k.hasNext()) {
                we = k.next();
                wprop = we.getValue();
                if (wprop.flags == null) {
View Full Code Here

Examples of net.yacy.kelondro.data.word.Word

            final Bitfield flagstemplate,
            final boolean useForLanguageIdentification,
            final WordCache meaningLib) {
        if (text == null) return;
        String word;
        Word wprop;
        WordTokenizer wordenum;
        wordenum = new WordTokenizer(new ByteArrayInputStream(UTF8.getBytes(text)), meaningLib);
        int pip = 0;
        while (wordenum.hasMoreElements()) {
            word = (wordenum.nextElement().toString()).toLowerCase(Locale.ENGLISH);
            if (useForLanguageIdentification) languageIdentificator.add(word);
            if (word.length() < 2) continue;
            wprop = words.get(word);
            if (wprop == null) wprop = new Word(0, pip, phrase);
            if (wprop.flags == null) wprop.flags = flagstemplate.clone();
            wprop.flags.set(flagpos, true);
            words.put(word, wprop);
            pip++;
            this.RESULT_NUMB_WORDS++;
View Full Code Here

Examples of net.yacy.kelondro.data.word.Word

        assert is != null;
        final Set<String> currsentwords = new HashSet<String>();
        String word = "";
        String k;
        int wordlen;
        Word wsp, wsp1;
        int wordHandle;
        int wordHandleCount = 0;
        int sentenceHandleCount = 0;
        int allwordcounter = 0;
        int allsentencecounter = 0;
        int wordInSentenceCounter = 1;
        boolean comb_indexof = false, last_last = false, last_index = false;
        final Map<StringBuilder, Phrase> sentences = new HashMap<StringBuilder, Phrase>(100);
       
        // read source
        final WordTokenizer wordenum = new WordTokenizer(is, meaningLib);
        while (wordenum.hasMoreElements()) {
            word = wordenum.nextElement().toLowerCase(Locale.ENGLISH);
            if (languageIdentificator != null) languageIdentificator.add(word);
            if (word.length() < wordminsize) continue;
           
            // distinguish punctuation and words
            wordlen = word.length();
            if (wordlen == 1 && SentenceReader.punctuation(word.charAt(0))) {
                // store sentence
                currsentwords.clear();
                wordInSentenceCounter = 1;
            } else {
                // check index.of detection
                if (last_last && comb_indexof && word.equals("modified")) {
                    this.RESULT_FLAGS.set(flag_cat_indexof, true);
                    wordenum.pre(true); // parse lines as they come with CRLF
                }
                if (last_index && (wordminsize > 2 || word.equals("of"))) comb_indexof = true;
                last_last = word.equals("last");
                last_index = word.equals("index");
               
                // store word
                allwordcounter++;
                currsentwords.add(word);
                wsp = words.get(word);
                if (wsp != null) {
                    // word already exists
                    wordHandle = wsp.posInText;
                    wsp.inc();
                } else {
                    // word does not yet exist, create new word entry
                    wordHandle = wordHandleCount++;
                    wsp = new Word(wordHandle, wordInSentenceCounter, sentences.size() + 100);
                    wsp.flags = RESULT_FLAGS.clone();
                    words.put(word, wsp);
                }
                // we now have the unique handle of the word, put it into the sentence:
                wordInSentenceCounter++;
View Full Code Here

Examples of nu.fw.jeti.plugins.Word

        List wordList = ChatSplitPane.createWordList(message);
              links.translate(wordList);
              // Insert words from wordlist
              Document doc = jTextArea1.getDocument();
        for(Iterator i = wordList.iterator();i.hasNext();) {
          Word w = (Word) i.next();
          doc.insertString(doc.getLength(),w.toString(),
                                   w.getAttributes());
        }
      }
      else jTextArea1.setText(message);
      jTextArea1.setEditable(false);
      txtSubject.setText(subject);
View Full Code Here

Examples of opennlp.ccg.lexicon.Word

        //Extract unbalanced punctuation feature for unbalanced sentence medial punctuation
        if (inputs.length == 2) {
          //Left child has unbalanced punct feature
          SignProps lchildProps=(SignProps)inputs[0].getData(SignProps.class);
          if(lchildProps!=null && lchildProps.getUnbalancedPunct()!=null){
            Word nextWord = inputs[1].getWords().get(0);
            //Check whether right child begins with a punctuation mark; else fire feature
            if (!isPunct(nextWord)){
              inc(punctExtractor);
            }
          }
View Full Code Here

Examples of org.apache.imperius.spl.parser.expressions.impl.Word

    try {
      Vector v = new Vector();
      v.add(new StringConstant(s1));
      v.add(new StringConstant(s2));
      v.add(new IntegerConstant(n));
      Expression e1 = new Word(v,true);

      v.clear();
      v.add(propertySensor1);
      v.add(propertySensor2);
      v.add(propertySensor3);
      Expression eps1 = new Word(v,true);

      assertTrue(
          (e1.evaluate()).equals(
          "ThisIsADogThisIsAPenThisIsATelevisionSet"));
      assertTrue((eps1.evaluate()).equals("ThisIsADog"));
    } catch (SPLException e) {
      fail("Received evaluation exception " + e.getMessage());
    } catch (Exception e) {
      fail("Received expression exception " + e.getMessage());
    }
View Full Code Here

Examples of org.jab.docsearch.converters.Word

                        curSummary = getTextSummary(currentFi);
                        is = new FileInputStream(currentFi);
                        break;
                    }
                    case MS_WORD: {
                        Word word = new Word(currentFi);
                        word.parse();

                        author = word.getAuthor();
                        keyWords = word.getKeywords();
                        curTitle = word.getTitle();
                        curSummary = word.getSummary();
                        documentText = word.getText();
                        break;
                    }
                    case MS_EXCEL: {
                        Excel excel = new Excel(currentFi);
                        excel.parse();
View Full Code Here

Examples of org.vmmagic.unboxed.Word

                break;
            default:
                return false;
        }

        final Word alignedStart = pageAlign(region, start.toWord(), false);
        if (!alignedStart.EQ(start.toWord())) {
            // Make adjustments on size & physAddr
            final Word diff = start.sub(alignedStart).toWord();
            start = alignedStart.toAddress();
            size = size.add(diff);
            if (!physAddr.isMax()) {
                physAddr = physAddr.sub(diff);
            }
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.