当前位置: 首页>>代码示例>>Java>>正文


Java Item.getTitle方法代码示例

本文整理汇总了Java中eu.socialsensor.framework.common.domain.Item.getTitle方法的典型用法代码示例。如果您正苦于以下问题:Java Item.getTitle方法的具体用法?Java Item.getTitle怎么用?Java Item.getTitle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在eu.socialsensor.framework.common.domain.Item的用法示例。


在下文中一共展示了Item.getTitle方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: execute

import eu.socialsensor.framework.common.domain.Item; //导入方法依赖的package包/类
public void execute(Tuple input) {
	try {
		Item item = (Item)input.getValueByField("Item");
		if(item == null)
			return;
		
		String title = item.getTitle();
		if(title != null) {
			List<Entity> entities = extract(title);
			item.setEntities(entities);
		}
		_collector.emit(new Values(item));
	}
	catch(Exception e) {
		_logger.error(e);
	}
}
 
开发者ID:socialsensor,项目名称:storm-focused-crawler,代码行数:18,代码来源:EntityExtractionBolt.java

示例2: toString

import eu.socialsensor.framework.common.domain.Item; //导入方法依赖的package包/类
public String toString()
{
	String repr = "Title: "+this.title+"\n";
	repr = repr + "Keywords:";
	for (Entry<String,Double> tmp_entry : this.keywords.entrySet())
	{
		repr = repr + " " + tmp_entry.getKey();
	}
	repr = repr + "\n";
	repr = repr + "Representative Docs:";
	for (Item i : this.representativeDocuments)
	{
		String txt = i.getTitle();
		if (txt.length() > 140)
			txt = txt.substring(0, 140);
		repr = repr + i.getTitle() + " -- ";
	}
	return repr;
}
 
开发者ID:socialsensor,项目名称:topic-detection,代码行数:20,代码来源:LDATopic.java

示例3: execute

import eu.socialsensor.framework.common.domain.Item; //导入方法依赖的package包/类
@Override
public void execute(Tuple input) {
	Item item = (Item)input.getValueByField("Item");
	if(item == null)
		return;
	
	String title = item.getTitle();
	if(title != null) {
		List<TaggedWord> taggedSentences = tag(title);
		_collector.emit(new Values(item, taggedSentences));
	}
}
 
开发者ID:socialsensor,项目名称:storm-focused-crawler,代码行数:13,代码来源:POSTaggingBolt.java

示例4: toString

import eu.socialsensor.framework.common.domain.Item; //导入方法依赖的package包/类
public String toString() {
    String dyscoString = "Id: " + id + "\n";
    dyscoString += "Creation date: " + creationDate + "\n";
    dyscoString += "Score: " + score + "\n";
    dyscoString += "Items: \n";
    for (Item item : items) {
        dyscoString += item.getId() + ":" + item.getTitle() + "\n";
    }
    dyscoString += "Entities: \n";
    for (Entity entity : entities) {
        dyscoString += entity.getName() + "@@@" + entity.getType().toString() + ":" + entity.getCont() + "\n";
    }
    dyscoString += "Tags: \n";
    Iterator<Entry<String, Double>> iteratorHashtags = hashtags.entrySet().iterator();
    while (iteratorHashtags.hasNext()) {
        Entry<String, Double> hashtag = iteratorHashtags.next();
        dyscoString += hashtag.getKey() + ":" + hashtag.getValue() + "\n";
    }
    dyscoString += "Keywords: \n";
    Iterator<Entry<String, Double>> iteratorKeywords = keywords.entrySet().iterator();
    while (iteratorKeywords.hasNext()) {
        Entry<String, Double> keyword = iteratorKeywords.next();
        dyscoString += keyword.getKey() + ":" + keyword.getValue() + "\n";
    }
    dyscoString += "SolrQuery : " + solrQueryString + "\n";
    dyscoString += "Trending : " + trending + "\n";
    dyscoString += "DyscoType : " + dyscoType.toString() + "\n";
    return dyscoString;
}
 
开发者ID:socialsensor,项目名称:socialsensor-framework-common,代码行数:30,代码来源:Dysco.java

示例5: SolrNewsFeed

import eu.socialsensor.framework.common.domain.Item; //导入方法依赖的package包/类
public SolrNewsFeed(Item item){
	id = item.getId();
       title = item.getTitle();
       description = item.getDescription();
       publicationTime = item.getPublicationTime();
       source = item.getUrl();
       lists = item.getList();
}
 
开发者ID:socialsensor,项目名称:socialsensor-framework-client,代码行数:9,代码来源:SolrNewsFeed.java

示例6: SolrTopicDetectionItem

import eu.socialsensor.framework.common.domain.Item; //导入方法依赖的package包/类
public SolrTopicDetectionItem(Item item) {
    id = item.getId();
    title = item.getTitle();
    
    tags = item.getTags();
    
    if (item.getEntities()!=null && item.getEntities().size()!=0)
    {
    	List<Entity> e = item.getEntities();
    	entities = new String[e.size()];
    
    	for(int i=0; i<e.size(); i++) {
    		entities[i] = e.get(i).getName();
    	}
    }
    else
    	entities = null;
    
    if (item.getLinks()!=null && item.getLinks().length!=0)
    {
    	URL[] links = item.getLinks();
    	urls = new String[links.length];
    	for(int i=0; i<links.length; i++)
    		urls[i] = links[i].toString();
    }
    else
    	urls = null;
    publicationTime = item.getPublicationTime();
}
 
开发者ID:socialsensor,项目名称:socialsensor-framework-client,代码行数:30,代码来源:SolrTopicDetectionItem.java

示例7: getTerms

import eu.socialsensor.framework.common.domain.Item; //导入方法依赖的package包/类
public Set<String> getTerms(Item item){
        String tmp_item_text=item.getTitle();
        Set<String> tmp_urls=getURLs(tmp_item_text);
        Iterator it = tmp_urls.iterator();
        while (it.hasNext()) {
            String next_url=(String) it.next();
            tmp_item_text=tmp_item_text.replaceAll(next_url, "");
        }

        Set<String> tmp_set=new HashSet<String>();
        Scanner tokenize;
        String tmp_word;
        if(tmp_item_text!=null){
            tokenize = new Scanner(tmp_item_text);
            //Punctuation and white space is used for 
            //splitting the text in tokens.
            tokenize.useDelimiter(delimiters);
            while (tokenize.hasNext()) {
                tmp_word=tokenize.next().toLowerCase();
                tmp_word.replaceAll(delimiters, "");
                //The following lines try to remove punctuation.
                //Maybe it should be skipped or revised
                String[] tmp_str=tmp_word.split(punctuation);
                while((tmp_word.length()>0)&&((tmp_word.charAt(0)+"").matches(punctuation)))
                    tmp_word=tmp_word.substring(1);
                while((tmp_word.length()>0)&&((tmp_word.charAt(tmp_word.length()-1)+"").matches(punctuation)))
                    tmp_word=tmp_word.substring(0,tmp_word.length()-1);
                if(!isUserMention(tmp_word)){
    //                if((!StopWords.IsStopWord(tmp_word))&&(tmp_word.length()>=Constants.MIN_WORD_LENGTH))
                    if((tmp_word.length()>=3))
                        tmp_set.add(tmp_word);
                }
//                else if(Constants.TWEET_REMOVE_USER_MENTIONS==false)
//                    tmp_set.add(tmp_word);
            }
        }
        return tmp_set;
    }
 
开发者ID:socialsensor,项目名称:topic-detection,代码行数:39,代码来源:DyscoCreator.java

示例8: main

import eu.socialsensor.framework.common.domain.Item; //导入方法依赖的package包/类
public static void main(String[] args) throws UnknownHostException, InterruptedException {
				
		EntitiesExtractor extractor = new EntitiesExtractor();
		ItemDAO itemDAO = new ItemDAOImpl("localhost", "loc", "Items");
		while(true) {
		List<Item> items = itemDAO.getItemsSince(0);
		for(Item item : items) {
			String title = item.getTitle();
			try {
				List<Entity> entities = extractor.getEntities(title);
				item.setEntities(entities);
				
				itemDAO.updateItem(item);
			} catch (Exception e) {
				continue;
			}
		}
		
		Thread.sleep(5000);
		}
//		
//		List<Entity> entities;
//		try {
//			entities = extractor.getEntities(items);
//			for (Entity entity : entities) {
////	            System.out.println(entity.getName() + " - " + entity.getType() + 
////	            		" - " + entity.getCont());
//	            System.out.println(entity.toJSONString());
//	        }
//		} catch (Exception e) {
//			e.printStackTrace();
//		}
		
	}
 
开发者ID:socialsensor,项目名称:socialsensor-multimedia-analysis,代码行数:35,代码来源:EntitiesExtractor.java

示例9: main

import eu.socialsensor.framework.common.domain.Item; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
				
		EntitiesExtractor extractor = new EntitiesExtractor();
		ItemDAO itemDAO = new ItemDAOImpl("localhost", "loc", "Items");
		while(true) {
		List<Item> items = itemDAO.getItemsSince(0);
		for(Item item : items) {
			String title = item.getTitle();
			try {
				List<Entity> entities = extractor.getEntities(title);
				item.setEntities(entities);
				
				itemDAO.updateItem(item);
			} catch (Exception e) {
				continue;
			}
		}
		
		Thread.sleep(5000);
		}
//		
//		List<Entity> entities;
//		try {
//			entities = extractor.getEntities(items);
//			for (Entity entity : entities) {
////	            System.out.println(entity.getName() + " - " + entity.getType() + 
////	            		" - " + entity.getCont());
//	            System.out.println(entity.toJSONString());
//	        }
//		} catch (Exception e) {
//			e.printStackTrace();
//		}
		
	}
 
开发者ID:socialsensor,项目名称:socialsensor-multimedia-analysis,代码行数:35,代码来源:EntitiesExtractor.java


注:本文中的eu.socialsensor.framework.common.domain.Item.getTitle方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。