Examples of Vocabulary


Examples of org.deri.grefine.rdf.vocab.Vocabulary

    }
   
    private Map<String,Vocabulary> clone(Map<String,Vocabulary> original){
      Map<String,Vocabulary> copy = new HashMap<String, Vocabulary>();
      for(Entry<String, Vocabulary> entry : original.entrySet()){
        copy.put(entry.getKey(), new Vocabulary(entry.getValue().getName(),entry.getValue().getUri()));
      }
     
      return copy;
    }
View Full Code Here

Examples of org.geotools.resources.i18n.Vocabulary

     */
    @Override
    public synchronized String getBackingStoreDescription() throws FactoryException {
        final Citation   authority = getAuthority();
        final TableWriter    table = new TableWriter(null, " ");
        final Vocabulary resources = Vocabulary.getResources(null);
        CharSequence cs;
        if ((cs=authority.getEdition()) != null) {
            table.write(resources.getString(VocabularyKeys.VERSION_OF_$1, "EPSG"));
            table.write(':');
            table.nextColumn();
            table.write(cs.toString());
            table.nextLine();
        }
        try {
            String s;
            final DatabaseMetaData metadata = getConnection().getMetaData();
            if ((s=metadata.getDatabaseProductName()) != null) {
                table.write(resources.getLabel(VocabularyKeys.DATABASE_ENGINE));
                table.nextColumn();
                table.write(s);
                if ((s=metadata.getDatabaseProductVersion()) != null) {
                    table.write(' ');
                    table.write(resources.getString(VocabularyKeys.VERSION_$1, s));
                }
                table.nextLine();
            }
            if ((s=metadata.getURL()) != null) {
                table.write(resources.getLabel(VocabularyKeys.DATABASE_URL));
                table.nextColumn();
                table.write(s);
                table.nextLine();
            }
        } catch (SQLException exception) {
View Full Code Here

Examples of syntaxLearner.corpus.Vocabulary

   *
   */
  public void recordCorpusData (Corpus c, Learner l){
    if (!isRecording) return;
    this.c=c;
    Vocabulary v = c.getVocabulary();
    Set<Map.Entry<String, Integer>> entrySet = v.getWordIndicesEntrySet();
    Set<Map.Entry<Integer, Word>> wordSet = v.getWordEntrySet();
    StringBuilder s = new StringBuilder(v.getNumOfWords()*30);
    corpusFile = new File(mainPath, "corpus_"+name+".js");

    s.append(String.format("corpus_%1$s = \n{\n\tname:\"%1$s\",\n", name));
    s.append(String.format("\ttokenCount: %1$s,\n", c.tokenCount));
    s.append(String.format("\ttypeCount: %1$s,\n", v.getNumOfWords()));
    s.append(String.format("\tcommonTypes: %1$s,\n", (v.getNumOfWords()-v.countWordsBelowThreshold(l.RARE_WORD_THRESHOLD))));
    s.append(String.format("\tclusterCount: %1$s,\n", l.NUMBER_OF_CLUSTERS));
    //TODO add proper number formatters
    s.append(String.format("\tidentityEps: %1$s,\n", l.IDENTITY_EPSILON));
    s.append(String.format("\titerationCount: %1$s,\n", iterationCounter));
    s.append("\ttypeToId: \n\t{\n\t");
    for (Map.Entry<String, Integer> e: entrySet){
      if (v.getWord(e.getValue()).frequency >= l.RARE_WORD_THRESHOLD){ //TODO see if necessary
        s.append(String.format("\t\t\"%1$s\": %2$s,\n", e.getKey(), e.getValue()));
      }
    }
    s.append("},\n");
    s.append("\tidToType: {");
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.