Examples of Dictionary


Examples of com.sohospace.dictionary.Dictionary

  public int dissect(Collector collector, CharSequence beaf, int offset) {
    if (CharSet.isCjkUnifiedIdeographs(beaf.charAt(beaf.length() - 1))
         && offset > 0 && beaf.length() - offset < 50){
      return -offset;
    }
    Dictionary vocabulary = factory.getVocabulary();
    /* ����:�����ס�ڱ�����ˮ̶�Ÿ��� */
    // setup��end���ڹ涨��֮��������Ƿ�Ϊ�ʵ����
    int setup, end;
    // ΪunidentifiedIndex����Ϊ���ҳ��Ĵ������λ�õ�����ߣ�e.g '��','��','��','��'
    int identifiedEnd = offset;
    // ���ڶ�λδ�ִܷʵĿ�Ŀ�ʼλ�ã�e.g '��'
    int unidentifiedIndex = -1;
    //���ڸ����ж��Ƿ����shouldAWord()����
    int maxWordLength = 0;
    Hit word = null;
    for (setup = offset, end = offset; setup < beaf.length()
        && CharSet.isCjkUnifiedIdeographs(beaf.charAt(setup)); end = ++setup) {
      for (int count = 1; end < beaf.length()
          && CharSet.isCjkUnifiedIdeographs(beaf.charAt(end++)); count++) {
        //��һ��forѭ��ʱ��end=setup+1
        word = vocabulary.search(beaf, setup, count);
        if (word.isUndefined()) {
          if (unidentifiedIndex < 0 && setup >= identifiedEnd) {
            unidentifiedIndex = setup;
          }
          break;
View Full Code Here

Examples of easyJ.system.data.Dictionary

     * @param relatedValue
     * @return
     */
    public static Long getIdByRelatedValue(String type, Long relatedValue)
            throws EasyJException {
        Dictionary dict = new Dictionary();
        dict.setDicType(type);
        dict.setRelatedValue(relatedValue);
        ArrayList list = sdp.query(dict);
        if (list.size() == 0) {
            return null;
        } else {
            dict = (Dictionary) list.get(0);
            return dict.getDicValueId();
        }
    }
View Full Code Here

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

    public void testNgram() throws IOException {
        URL dictUrl = getClass().getResource("100.dict");
        URL noisedictUrl = getClass()
                .getResource("/edu/cmu/sphinx/models/acoustic/wsj/noisedict");

        Dictionary dictionary = new FullDictionary(dictUrl,
                                                   noisedictUrl,
                                                   null,
                                                   false,
                                                   null,
                                                   false,
                                                   false,
                                                   new UnitManager());

        URL lm = getClass().getResource("100.arpa.dmp");
        LargeTrigramModel model = new LargeTrigramModel("",
                                                        lm,
                                                        null,
                                                        100,
                                                        100,
                                                        false,
                                                        3,
                                                        dictionary,
                                                        false,
                                                        1.0f,
                                                        1.0f,
                                                        1.0f,
                                                        false);
        dictionary.allocate();
        model.allocate();
        assertThat(model.getMaxDepth(), equalTo(3));

        Word[] words = {
            new Word("huggins", null, false),
View Full Code Here

Examples of edu.mit.jwi.Dictionary

   * Initialize WordNet dictionary.
   */
  public static IDictionary getDictionary() throws IOException {

    URL url = new URL("file", null, wordNetPath);
    IDictionary iDictionary = new Dictionary(url);
    iDictionary.open();
   
    return iDictionary;
  }
View Full Code Here

Examples of eu.danieldk.dictomaton.Dictionary

            if (StringUtils.getLevenshteinDistance(str, permuted) <= distance)
                shouldHave.add(permuted);
        }

        Dictionary dict = new DictionaryBuilder().addAll(all).build();
        LevenshteinAutomaton la = new LevenshteinAutomaton(str, distance);

        Assert.assertEquals(shouldHave, la.intersectionLanguage(dict));
    }
View Full Code Here

Examples of flash.swf.Dictionary

        {
            this.topLevel = null;
        }

        stack = new Stack();
        dict = new Dictionary();
    }
View Full Code Here

Examples of gannuNLP.dictionaries.Dictionary

    {
      System.out.println("Usage: java -cp \"gannu.jar\" gannuWSD.DataLoader connectorClass dictionaryVersion dictFilesPath for parsing a corpora/dictionary first.");
    }
    else
    {
      Dictionary dict=(Dictionary)Class.forName(args[0]).newInstance();
      dict.setVersion(args[1]);
      File f;
      File sourceList=new File("./data/"+dict.getName()+".sl");
      f=new File("./data/"+dict.getName()+"/");
      f.mkdirs();
      f=new File("./data/"+dict.getName()+"/"+dict.getName()+".sta");
      if(f.exists())//then try to upload a corpus
      {
        DataBroker db=new DataBroker(args[0],args[1]);
        db.load("Glosses;");       
        System.out.println("Dictionary uploaded!");
        System.out.println("Loading samples from SemCor files!");
        f=new File(args[2]);
        if(f.exists())
        {
          Corpus c=new Corpus(args[2],db, true);
          DataLoader.addSourceList(sourceList,c.getName());
          c.WriteSuperLemmas("./data/"+dict.getName()+"/");         
          System.out.println("Finished!");
        }
        else
        {
          System.out.println("Corpus not found!");
        }
      }
      else//then try to upload a dictionary
      {   
       
        if(!dict.isWeb())
        {         
          dict.setPath("./Resources/"+dict.getName());
          ArrayList<File> files=Util.getAllFiles(new File(args[2]));
          File dir=new File("Resources/"+dict.getName());
          dir.mkdirs();
          for(File file:files)
          {
            FileChannel source=new FileInputStream(file).getChannel();
            File tfile=new File("Resources/"+dict.getName()+"/"+file.getName());
            tfile.createNewFile();
            FileChannel target=new FileOutputStream(tfile).getChannel();
            if (target != null && source != null) {
              target.transferFrom(source, 0, source.size());
            }
            if (source != null) {
              source.close();
            }
            if (target != null) {
              target.close();
            }

          }
          System.out.println("Uploading dictionary! Wait some minutes please!");
           dict.loadCoreData();
          dict.parseSamplesFromDictionary();                 
          dict.load("Glosses;Samples");
          dict.WriteSuperLemmas("./data/"+dict.getName()+"/");
          System.out.println("Dictionary uploaded!");

        }
        else
        {
          System.out.println("Online dictionaries cannot be uploaded with this tool!");
        }
        DataLoader.addSourceList(sourceList,dict.getName());       
      }
    }
  }
View Full Code Here

Examples of java.util.Dictionary

        }
        return -1;
    }

    private static Integer getMaxSliderValue(JSlider slider) {
        Dictionary dictionary = slider.getLabelTable();
        if (dictionary != null) {
            Enumeration keys = dictionary.keys();
            int max = slider.getMinimum() - 1;
            while (keys.hasMoreElements()) {
                max = Math.max(max, ((Integer)keys.nextElement()).intValue());
            }
            if (max == slider.getMinimum() - 1) {
View Full Code Here

Examples of java.util.Dictionary

        }
        return null;
    }

    private static Integer getMinSliderValue(JSlider slider) {
        Dictionary dictionary = slider.getLabelTable();
        if (dictionary != null) {
            Enumeration keys = dictionary.keys();
            int min = slider.getMaximum() + 1;
            while (keys.hasMoreElements()) {
                min = Math.min(min, ((Integer)keys.nextElement()).intValue());
            }
            if (min == slider.getMaximum() + 1) {
View Full Code Here

Examples of java.util.Dictionary

     *  the default namespace, if any.
     * @param localName element tag, without any embedded colon
     */
    public ElementEx createElementEx (String namespace, String localName)
    {
  Dictionary  mapping = null;

  if (namespace == null)
      namespace = defaultNs;

  if (nsMappings != null)
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.