Package net.paoding.analysis.dictionary

Examples of net.paoding.analysis.dictionary.Dictionary


  public synchronized Dictionary getVocabularyDictionary() {
    if (vocabularyDictionary == null) {
      // 大概有5639个字有词语,故取0x2fff=x^13>8000>8000*0.75=6000>5639
      vocabularyDictionary = new HashBinaryDictionary(
          getVocabularyWords(), 0x2fff, 0.75f);
      Dictionary noiseWordsDic = getNoiseWordsDictionary();
      for (int i = 0; i < noiseWordsDic.size(); i++) {
        Hit hit = vocabularyDictionary.search(noiseWordsDic.get(i), 0, noiseWordsDic.get(i).length());
        if (hit.isHit()) {
          hit.getWord().setNoiseWord();
        }
      }
      Dictionary noiseCharactorsDic = getNoiseCharactorsDictionary();
      for (int i = 0; i < noiseCharactorsDic.size(); i++) {
        Hit hit = vocabularyDictionary.search(noiseCharactorsDic.get(i), 0, noiseCharactorsDic.get(i).length());
        if (hit.isHit()) {
          hit.getWord().setNoiseCharactor();
        }
      }
     
View Full Code Here


   
    File dicHomeFile = new File(dicHome);
    File compiledDicHomeFile = new File(dicHomeFile, ".compiled/most-words-mode");
    compiledDicHomeFile.mkdirs();
    //
    Dictionary vocabularyDictionary = dictionaries.getVocabularyDictionary();
    File vocabularyFile = new File(compiledDicHomeFile, "vocabulary.dic.compiled");
    compileVocabulary(vocabularyDictionary, knife, vocabularyFile, charsetName);

    //
    Dictionary noiseCharactorsDictionary = dictionaries.getNoiseCharactorsDictionary();
    File noiseCharactorsDictionaryFile = new File(compiledDicHomeFile, noiseCharactor + ".dic.compiled");
    sortCompile(noiseCharactorsDictionary, noiseCharactorsDictionaryFile, charsetName);
    //
    Dictionary noiseWordsDictionary = dictionaries.getNoiseWordsDictionary();
    File noiseWordsDictionaryFile = new File(compiledDicHomeFile, noiseWord + ".dic.compiled");
    sortCompile(noiseWordsDictionary, noiseWordsDictionaryFile, charsetName);
    //
    Dictionary unitsDictionary = dictionaries.getUnitsDictionary();
    File unitsDictionaryFile = new File(compiledDicHomeFile, unit + ".dic.compiled");
    sortCompile(unitsDictionary, unitsDictionaryFile, charsetName);
    //
    Dictionary confucianFamilyDictionary = dictionaries.getConfucianFamilyNamesDictionary();
    File confucianFamilyDictionaryFile = new File(compiledDicHomeFile, confucianFamilyName + ".dic.compiled");
    sortCompile(confucianFamilyDictionary, confucianFamilyDictionaryFile, charsetName);
    //
    Dictionary combinatoricsDictionary = dictionaries.getCombinatoricsDictionary();
    File combinatoricsDictionaryFile = new File(compiledDicHomeFile, combinatorics + ".dic.compiled");
    sortCompile(combinatoricsDictionary, combinatoricsDictionaryFile, charsetName);
   
    //
    File compliedMetadataFile = new File(dicHomeFile, ".compiled/most-words-mode/.metadata");
View Full Code Here

    File dicHomeFile = new File(dicHome);
    File compiledDicHomeFile = new File(dicHomeFile, ".compiled/sorting");
    compiledDicHomeFile.mkdirs();
   
    //
    Dictionary vocabularyDictionary = dictionaries.getVocabularyDictionary();
    File vocabularyFile = new File(compiledDicHomeFile, "vocabulary.dic.compiled");
    sortCompile(vocabularyDictionary, vocabularyFile, charsetName);

    //
    Dictionary noiseCharactorsDictionary = dictionaries.getNoiseCharactorsDictionary();
    File noiseCharactorsDictionaryFile = new File(compiledDicHomeFile, noiseCharactor + ".dic.compiled");
    sortCompile(noiseCharactorsDictionary, noiseCharactorsDictionaryFile, charsetName);
    //
    Dictionary noiseWordsDictionary = dictionaries.getNoiseWordsDictionary();
    File noiseWordsDictionaryFile = new File(compiledDicHomeFile, noiseWord + ".dic.compiled");
    sortCompile(noiseWordsDictionary, noiseWordsDictionaryFile, charsetName);
    //
    Dictionary unitsDictionary = dictionaries.getUnitsDictionary();
    File unitsDictionaryFile = new File(compiledDicHomeFile, unit + ".dic.compiled");
    sortCompile(unitsDictionary, unitsDictionaryFile, charsetName);
    //
    Dictionary confucianFamilyDictionary = dictionaries.getConfucianFamilyNamesDictionary();
    File confucianFamilyDictionaryFile = new File(compiledDicHomeFile, confucianFamilyName + ".dic.compiled");
    sortCompile(confucianFamilyDictionary, confucianFamilyDictionaryFile, charsetName);
    //
    Dictionary combinatoricsDictionary = dictionaries.getCombinatoricsDictionary();
    File combinatoricsDictionaryFile = new File(compiledDicHomeFile, combinatorics + ".dic.compiled");
    sortCompile(combinatoricsDictionary, combinatoricsDictionaryFile, charsetName);

    //
    File compliedMetadataFile = new File(dicHomeFile, ".compiled/sorting/.metadata");
View Full Code Here

   
    File dicHomeFile = new File(dicHome);
    File compiledDicHomeFile = new File(dicHomeFile, ".compiled/most-words-mode");
    compiledDicHomeFile.mkdirs();
    //
    Dictionary vocabularyDictionary = dictionaries.getVocabularyDictionary();
    File vocabularyFile = new File(compiledDicHomeFile, "vocabulary.dic.compiled");
    compileVocabulary(vocabularyDictionary, knife, vocabularyFile, charsetName);

    //
    Dictionary noiseCharactorsDictionary = dictionaries.getNoiseCharactorsDictionary();
    File noiseCharactorsDictionaryFile = new File(compiledDicHomeFile, noiseCharactor + ".dic.compiled");
    sortCompile(noiseCharactorsDictionary, noiseCharactorsDictionaryFile, charsetName);
    //
    Dictionary noiseWordsDictionary = dictionaries.getNoiseWordsDictionary();
    File noiseWordsDictionaryFile = new File(compiledDicHomeFile, noiseWord + ".dic.compiled");
    sortCompile(noiseWordsDictionary, noiseWordsDictionaryFile, charsetName);
    //
    Dictionary unitsDictionary = dictionaries.getUnitsDictionary();
    File unitsDictionaryFile = new File(compiledDicHomeFile, unit + ".dic.compiled");
    sortCompile(unitsDictionary, unitsDictionaryFile, charsetName);
    //
    Dictionary confucianFamilyDictionary = dictionaries.getConfucianFamilyNamesDictionary();
    File confucianFamilyDictionaryFile = new File(compiledDicHomeFile, confucianFamilyName + ".dic.compiled");
    sortCompile(confucianFamilyDictionary, confucianFamilyDictionaryFile, charsetName);
    //
    Dictionary combinatoricsDictionary = dictionaries.getCombinatoricsDictionary();
    File combinatoricsDictionaryFile = new File(compiledDicHomeFile, combinatorics + ".dic.compiled");
    sortCompile(combinatoricsDictionary, combinatoricsDictionaryFile, charsetName);
   
    //
    File compliedMetadataFile = new File(dicHomeFile, ".compiled/most-words-mode/.metadata");
View Full Code Here

    File dicHomeFile = new File(dicHome);
    File compiledDicHomeFile = new File(dicHomeFile, ".compiled/sorting");
    compiledDicHomeFile.mkdirs();
   
    //
    Dictionary vocabularyDictionary = dictionaries.getVocabularyDictionary();
    File vocabularyFile = new File(compiledDicHomeFile, "vocabulary.dic.compiled");
    sortCompile(vocabularyDictionary, vocabularyFile, charsetName);

    //
    Dictionary noiseCharactorsDictionary = dictionaries.getNoiseCharactorsDictionary();
    File noiseCharactorsDictionaryFile = new File(compiledDicHomeFile, noiseCharactor + ".dic.compiled");
    sortCompile(noiseCharactorsDictionary, noiseCharactorsDictionaryFile, charsetName);
    //
    Dictionary noiseWordsDictionary = dictionaries.getNoiseWordsDictionary();
    File noiseWordsDictionaryFile = new File(compiledDicHomeFile, noiseWord + ".dic.compiled");
    sortCompile(noiseWordsDictionary, noiseWordsDictionaryFile, charsetName);
    //
    Dictionary unitsDictionary = dictionaries.getUnitsDictionary();
    File unitsDictionaryFile = new File(compiledDicHomeFile, unit + ".dic.compiled");
    sortCompile(unitsDictionary, unitsDictionaryFile, charsetName);
    //
    Dictionary confucianFamilyDictionary = dictionaries.getConfucianFamilyNamesDictionary();
    File confucianFamilyDictionaryFile = new File(compiledDicHomeFile, confucianFamilyName + ".dic.compiled");
    sortCompile(confucianFamilyDictionary, confucianFamilyDictionaryFile, charsetName);
    //
    Dictionary combinatoricsDictionary = dictionaries.getCombinatoricsDictionary();
    File combinatoricsDictionaryFile = new File(compiledDicHomeFile, combinatorics + ".dic.compiled");
    sortCompile(combinatoricsDictionary, combinatoricsDictionaryFile, charsetName);

    //
    File compliedMetadataFile = new File(dicHomeFile, ".compiled/sorting/.metadata");
View Full Code Here

  public synchronized Dictionary getVocabularyDictionary() {
    if (vocabularyDictionary == null) {
      // 大概有5639个字有词语,故取0x2fff=x^13>8000>8000*0.75=6000>5639
      vocabularyDictionary = new HashBinaryDictionary(
          getVocabularyWords(), 0x2fff, 0.75f);
      Dictionary noiseWordsDic = getNoiseWordsDictionary();
      for (int i = 0; i < noiseWordsDic.size(); i++) {
        Hit hit = vocabularyDictionary.search(noiseWordsDic.get(i), 0, noiseWordsDic.get(i).length());
        if (hit.isHit()) {
          hit.getWord().setNoiseWord();
        }
      }
      Dictionary noiseCharactorsDic = getNoiseCharactorsDictionary();
      for (int i = 0; i < noiseCharactorsDic.size(); i++) {
        Hit hit = vocabularyDictionary.search(noiseCharactorsDic.get(i), 0, noiseCharactorsDic.get(i).length());
        if (hit.isHit()) {
          hit.getWord().setNoiseCharactor();
        }
      }
     
View Full Code Here

  public synchronized Dictionary getVocabularyDictionary() {
    if (vocabularyDictionary == null) {
      // 大概有5639个字有词语,故取0x2fff=x^13>8000>8000*0.75=6000>5639
      vocabularyDictionary = new HashBinaryDictionary(
          getVocabularyWords(), 0x2fff, 0.75f);
      Dictionary noiseWordsDic = getNoiseWordsDictionary();
      for (int i = 0; i < noiseWordsDic.size(); i++) {
        Hit hit = vocabularyDictionary.search(noiseWordsDic.get(i), 0, noiseWordsDic.get(i).length());
        if (hit.isHit()) {
          hit.getWord().setNoiseWord();
        }
      }
      Dictionary noiseCharactorsDic = getNoiseCharactorsDictionary();
      for (int i = 0; i < noiseCharactorsDic.size(); i++) {
        Hit hit = vocabularyDictionary.search(noiseCharactorsDic.get(i), 0, noiseCharactorsDic.get(i).length());
        if (hit.isHit()) {
          hit.getWord().setNoiseCharactor();
        }
      }
     
View Full Code Here

   
    File dicHomeFile = new File(dicHome);
    File compiledDicHomeFile = new File(dicHomeFile, ".compiled/most-words-mode");
    compiledDicHomeFile.mkdirs();
    //
    Dictionary vocabularyDictionary = dictionaries.getVocabularyDictionary();
    File vocabularyFile = new File(compiledDicHomeFile, "vocabulary.dic.compiled");
    compileVocabulary(vocabularyDictionary, knife, vocabularyFile, charsetName);

    //
    Dictionary noiseCharactorsDictionary = dictionaries.getNoiseCharactorsDictionary();
    File noiseCharactorsDictionaryFile = new File(compiledDicHomeFile, noiseCharactor + ".dic.compiled");
    sortCompile(noiseCharactorsDictionary, noiseCharactorsDictionaryFile, charsetName);
    //
    Dictionary noiseWordsDictionary = dictionaries.getNoiseWordsDictionary();
    File noiseWordsDictionaryFile = new File(compiledDicHomeFile, noiseWord + ".dic.compiled");
    sortCompile(noiseWordsDictionary, noiseWordsDictionaryFile, charsetName);
    //
    Dictionary unitsDictionary = dictionaries.getUnitsDictionary();
    File unitsDictionaryFile = new File(compiledDicHomeFile, unit + ".dic.compiled");
    sortCompile(unitsDictionary, unitsDictionaryFile, charsetName);
    //
    Dictionary confucianFamilyDictionary = dictionaries.getConfucianFamilyNamesDictionary();
    File confucianFamilyDictionaryFile = new File(compiledDicHomeFile, confucianFamilyName + ".dic.compiled");
    sortCompile(confucianFamilyDictionary, confucianFamilyDictionaryFile, charsetName);
    //
    Dictionary combinatoricsDictionary = dictionaries.getCombinatoricsDictionary();
    File combinatoricsDictionaryFile = new File(compiledDicHomeFile, combinatorics + ".dic.compiled");
    sortCompile(combinatoricsDictionary, combinatoricsDictionaryFile, charsetName);
   
    //
    File compliedMetadataFile = new File(dicHomeFile, ".compiled/most-words-mode/.metadata");
View Full Code Here

    File dicHomeFile = new File(dicHome);
    File compiledDicHomeFile = new File(dicHomeFile, ".compiled/sorting");
    compiledDicHomeFile.mkdirs();
   
    //
    Dictionary vocabularyDictionary = dictionaries.getVocabularyDictionary();
    File vocabularyFile = new File(compiledDicHomeFile, "vocabulary.dic.compiled");
    sortCompile(vocabularyDictionary, vocabularyFile, charsetName);

    //
    Dictionary noiseCharactorsDictionary = dictionaries.getNoiseCharactorsDictionary();
    File noiseCharactorsDictionaryFile = new File(compiledDicHomeFile, noiseCharactor + ".dic.compiled");
    sortCompile(noiseCharactorsDictionary, noiseCharactorsDictionaryFile, charsetName);
    //
    Dictionary noiseWordsDictionary = dictionaries.getNoiseWordsDictionary();
    File noiseWordsDictionaryFile = new File(compiledDicHomeFile, noiseWord + ".dic.compiled");
    sortCompile(noiseWordsDictionary, noiseWordsDictionaryFile, charsetName);
    //
    Dictionary unitsDictionary = dictionaries.getUnitsDictionary();
    File unitsDictionaryFile = new File(compiledDicHomeFile, unit + ".dic.compiled");
    sortCompile(unitsDictionary, unitsDictionaryFile, charsetName);
    //
    Dictionary confucianFamilyDictionary = dictionaries.getConfucianFamilyNamesDictionary();
    File confucianFamilyDictionaryFile = new File(compiledDicHomeFile, confucianFamilyName + ".dic.compiled");
    sortCompile(confucianFamilyDictionary, confucianFamilyDictionaryFile, charsetName);
    //
    Dictionary combinatoricsDictionary = dictionaries.getCombinatoricsDictionary();
    File combinatoricsDictionaryFile = new File(compiledDicHomeFile, combinatorics + ".dic.compiled");
    sortCompile(combinatoricsDictionary, combinatoricsDictionaryFile, charsetName);

    //
    File compliedMetadataFile = new File(dicHomeFile, ".compiled/sorting/.metadata");
View Full Code Here

TOP

Related Classes of net.paoding.analysis.dictionary.Dictionary

Copyright © 2018 www.massapicom. 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.