Package de.anomic.data.ymark

Examples of de.anomic.data.ymark.YMarkMetadata


        } catch (RowSpaceExceededException e) {
          Log.logException(e);
        }
          } else if (isWordCount || isMetadata || isURLdb || isCrawlStart) {
            try {
                  final YMarkMetadata meta = new YMarkMetadata(new DigestURI(post.get(ROOT).substring(2)), sb.indexSegments);
              meta.loadDocument(sb.loader);
              if(isWordCount)  {
                final TreeMap<String,Word> words = meta.getWordCounts();
              final ArrayList<String> topwords = new ArrayList<String>(words.descendingKeySet());
              for(int i = 0; i < 20 && i < topwords.size(); i++) {
                String word = topwords.get(i);
                int occur = words.get(word).occurrences();
                prop.put("folders_"+count+"_foldername","<small><b>"+word+":</b> [" + occur + "]</small>");
                  putProp(count, "meta");
                  count++;
              }
              count--;
              prop.put("folders_"+count+"_comma", "");
              count++;
                  prop.put("folders", count);
              } else if(isMetadata) {
                count = putMeta(count, meta.loadMetadata());
              } else if(isURLdb) {
            count = putMeta(count, meta.getMetadata());
              } else if(isCrawlStart) {
                Log.logInfo("YMark", "I am looking for CrawlStart: "+post.get(ROOT).substring(2));
                final YMarkCrawlStart crawlStart = new YMarkCrawlStart(sb.tables, post.get(ROOT).substring(2));
                final Iterator<String> iter = crawlStart.keySet().iterator();
                String key;
View Full Code Here


        } catch (final RowSpaceExceededException e) {
          Log.logException(e);
        }
          } else if (isAutoTagger || isMetadata || isURLdb || isCrawlStart) {
            try {
                  final YMarkMetadata meta = new YMarkMetadata(new DigestURI(post.get(ROOT).substring(2)), sb.indexSegments);
              final Document document = meta.loadDocument(sb.loader);
              final TreeMap<String, YMarkTag> tags = sb.tables.bookmarks.getTags(bmk_user);
              if(isAutoTagger)  {
                prop.put("folders_"+count+"_foldername","<small><b>meta-"+YMarkMetadata.METADATA.KEYWORDS.name().toLowerCase()+":</b> " + meta.loadMetadata().get(YMarkMetadata.METADATA.KEYWORDS) + "</small>");
                putProp(count, "meta");
                count++;
            prop.put("folders_"+count+"_foldername","<small><b>with preference: </b>"+YMarkAutoTagger.autoTag(document, 4, tags)+"</small>");
              putProp(count, "meta");
              count++;
            prop.put("folders_"+count+"_foldername","<small><b>without preference: </b>"+YMarkAutoTagger.autoTag(document, 4, new  TreeMap<String, YMarkTag>())+"</small>");
              putProp(count, "meta");
              count++;
                  prop.put("folders", count);
              } else if(isMetadata) {
                count = putMeta(count, meta.loadMetadata());
              } else if(isURLdb) {
            count = putMeta(count, meta.getMetadata());
              } else if(isCrawlStart) {
                Log.logInfo("YMark", "I am looking for CrawlStart: "+post.get(ROOT).substring(2));
                final YMarkCrawlStart crawlStart = new YMarkCrawlStart(sb.tables, post.get(ROOT).substring(2));
                final Iterator<String> iter = crawlStart.keySet().iterator();
                String key;
View Full Code Here

      if (!hasProtocol) {
          url=YMarkTables.PROTOCOLS.HTTP.protocol(url);
      }

          try {
        final YMarkMetadata meta = new YMarkMetadata(new DigestURI(url), sb.indexSegments);
        final Document document = meta.loadDocument(sb.loader);
        final EnumMap<YMarkMetadata.METADATA, String> metadata = meta.loadMetadata();

        prop.putXML("title", metadata.get(YMarkMetadata.METADATA.TITLE));
        prop.putXML("desc", metadata.get(YMarkMetadata.METADATA.DESCRIPTION));
        prop.put("keywords", putTags(document.dc_subject(','), "keywords"));
        prop.put("autotags", putTags(YMarkAutoTagger.autoTag(document, 5, sb.tables.bookmarks.getTags(bmk_user)), "autotags"));
View Full Code Here

TOP

Related Classes of de.anomic.data.ymark.YMarkMetadata

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.