Examples of Dictionary


Examples of org.ictclas4j.bean.Dictionary

    if (fileName != null) {
      this.coreDict = coreDict;
      if (type == Utility.TAG_TYPE.TT_NORMAL)
        this.unknownDict = coreDict;
      else {
        unknownDict = new Dictionary();
        unknownDict.load(fileName + ".dct");

      }
      context = new ContextStat();
      context.load(fileName + ".ctx");
View Full Code Here

Examples of org.ictclas4j.bean.Dictionary

    PosContext cs = new PosContext("data\\lexical.ctx");
    System.out.println(cs);
  }
 
  public static void test3(){
    Dictionary cs = new Dictionary("E:\\document\\NLP\\corpus\\eve\\bigramDict.dct");
    System.out.println(cs);
  }
View Full Code Here

Examples of org.ictclas4j.bean.Dictionary

    //testRead();
    convertFormat();
  }
 
  public static  void testWrite(){
    Dictionary dict =new Dictionary();
  }
View Full Code Here

Examples of org.ictclas4j.bean.Dictionary

  //�Ѵʵ��Ӿɸ�ʽת���¸�ʽ��������wordMaxLen
  public static void convertFormat(){
    Dictionary0 dict=new Dictionary0(false);
    dict.load("data\\tr.dct");
    Dictionary dict2=new Dictionary(false);
    WordTable[] wts=dict2.getWts();
   
    long size=0;
    for(int i=0;i<dict.dict_count;i++){
      WordTable0 wt0=dict.wts[i];
      ArrayList<WordItem0> wis0=wt0.getWords();
      int count=0;
      int wordMaxLen=0;
      if(wis0!=null){
        System.out.println("size:"+i+","+wis0.size()+","+size);
        HashMap<String, SegAtom> wordMap = new HashMap<String, SegAtom>();
        for(int j=0;j<wis0.size();j++){
          SegAtom sa=new SegAtom();
          WordItem0 wi=wis0.get(j);
          sa.setWord(wi.getWord());
          sa.addPos(new Pos(wi.getHandle(),wi.getFreq(),false));
          count++;
          size+=8+wi.getWord().getBytes().length;
         
          //����ͬ�Ĵʣ����кϲ�
          while(j<wis0.size()-1 && wis0.get(j).getWord()!=null && wis0.get(j).getWord().equals(wis0.get(j+1).getWord())){
            wi=wis0.get(j+1);
            sa.addPos(new Pos(wi.getHandle(),wi.getFreq(),false));
            j++;
            size+=8;
          }
         
          wordMap.put(sa.getWord(), sa);
          if(sa.getWord().length()>wordMaxLen)
            wordMaxLen=sa.getWord().length();
         
        }
       
        WordTable wt=new WordTable();
        wt.setWordCount(count);
        wt.setWordMaxLen(wordMaxLen);
        wt.setWordMap(wordMap);
        wts[i]=wt;
      }
    }
   
    dict2.save("data2\\tr.dct");
  }
View Full Code Here

Examples of org.jboss.test.bpel.ws.consumption.partner.spi.Dictionary

  throws TDictionaryNotAvailable, TTextNotTranslatable, RemoteException {
    TDocument document = translationRequest.getDocument();
    Locale sourceLocale = new Locale(document.getHead().getLanguage());
    Locale targetLocale = new Locale(translationRequest.getTargetLanguage());
    DictionaryFactory dictionaryFactory = DictionaryFactory.getInstance(sourceLocale, targetLocale);
    Dictionary dictionary = dictionaryFactory.createDictionary(sourceLocale, targetLocale);
    return dictionary.translate(document);
  }
View Full Code Here

Examples of org.owasp.passfault.dictionary.Dictionary

    for(String group: wordListGroups){
      String groupName = wordsConfig.getProperty(group + WORDLIST_NAME, group);
      int runningTotal = 0, i=1;
      while (wordsConfig.containsKey(buildFileName(group, i))){
        String wordListName = wordsConfig.getProperty(buildFileName(group, i)); //for example: wordlist.english.1=english.words
        Dictionary dictionary = buildDictionary(groupName, wordListName);
        runningTotal += dictionary.getWordCount();
        dictionary.setWordCount(runningTotal);
        finders.addAll(buildDictionaryFinders(dictionary));
        i++;
      }
    }
    finders.addAll(buildStandardFinders());
View Full Code Here

Examples of org.tinyradius.dictionary.Dictionary

   * @param vendorId vendor ID or -1
   * @param attributeType attribute type
   * @return RadiusAttribute instance
   */
  public static RadiusAttribute createRadiusAttribute(int vendorId, int attributeType) {
    Dictionary dictionary = DefaultDictionary.getDefaultDictionary();
    return createRadiusAttribute(dictionary, vendorId, attributeType);
  }
View Full Code Here

Examples of org.tinyradius.dictionary.Dictionary

   * used.
   * @param attributeType attribute type
   * @return RadiusAttribute instance
   */
  public static RadiusAttribute createRadiusAttribute(int attributeType) {
    Dictionary dictionary = DefaultDictionary.getDefaultDictionary();
    return createRadiusAttribute(dictionary, -1, attributeType);
  }
View Full Code Here

Examples of org.tinyradius.dictionary.Dictionary

public class TestDictionary {

  public static void main(String[] args)
  throws Exception {
    InputStream source = new FileInputStream("test.dictionary");
    Dictionary dictionary = DictionaryParser.parseDictionary(source);
    AccessRequest ar = new AccessRequest("UserName", "UserPassword");
    ar.setDictionary(dictionary);
    ar.addAttribute("WISPr-Location-ID", "LocationID");
    ar.addAttribute(new IpAttribute(8, 1234567));
    System.out.println(ar);
View Full Code Here

Examples of pl.net.bluesoft.rnd.processtool.dict.xml.Dictionary

  public List<XmlDictionaryItemWrapper> getItems(final String dictionaryId, final String languageCode) {
    return getDictionary(dictionaryId, languageCode).getItems();
  }

  public XmlDictionaryWrapper getDictionary(final String dictionaryId, final String languageCode) {
    Dictionary dictionary = from(processDictionaries.getDictionaries()).where(new P<Dictionary>() {
      @Override
      public boolean invoke(Dictionary dictionary) {
        return dictionary.getDictionaryId().equals(dictionaryId) && dictionary.getLanguageCode().equals(languageCode);
      }
    }).firstOrDefault();
    if (dictionary == null) {
      dictionary = new Dictionary();
      dictionary.setDictionaryId(dictionaryId);
      dictionary.setLanguageCode(languageCode);
      processDictionaries.getDictionaries().add(dictionary);
    }
    return new XmlDictionaryWrapper(dictionary);
  }
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.