Examples of HashTag


Examples of com.datasalt.pangool.examples.topnhashtags.Beans.HashTag

      String hashTag = hashTags.get((int)(Math.random() * hashTags.size()));
      SimpleTweet tweet = new SimpleTweet();
      tweet.setCreated_at(SimpleTweet.dateFormat.format(new Date(date)));
      tweet.setEntities(new Entities());
      tweet.getEntities().setHashtags(new ArrayList<HashTag>());
      tweet.getEntities().getHashtags().add(new HashTag());
      tweet.getEntities().getHashtags().get(0).setText(hashTag);
      tweet.setUser(new UserInfo());
      tweet.getUser().setLocation(location);
      writer.write(mapper.writeValueAsString(tweet) + "\n");
    }
View Full Code Here

Examples of com.datasalt.pangool.examples.topnhashtags.Beans.HashTag

    ObjectMapper mapper = new ObjectMapper();
    SimpleTweet tweet = new SimpleTweet();
    tweet.setCreated_at(SimpleTweet.dateFormat.format(new Date(date)));
    tweet.setEntities(new Entities());
    tweet.getEntities().setHashtags(new ArrayList<HashTag>());
    tweet.getEntities().getHashtags().add(new HashTag());
    tweet.getEntities().getHashtags().get(0).setText(hashTag);
    tweet.setUser(new UserInfo());
    tweet.getUser().setLocation(location);
    return mapper.writeValueAsString(tweet);
  }
View Full Code Here

Examples of net.fortytwo.twitlogic.model.Hashtag

        if (l.startsWith("a ") | l.startsWith("an ")) {
            String rest = normed.substring(normed.indexOf(" ") + 1);

            if (TweetSyntax.HASHTAG_PATTERN.matcher(rest).matches()) {
                try {
                    context.handleCompletedTriple(new URIReference(RDF.TYPE), new Hashtag(rest.substring(1)));
                } catch (HandlerException e) {
                    throw new MatcherException(e);
                }
            } else {
                String rl = rest.toLowerCase();
View Full Code Here

Examples of net.fortytwo.twitlogic.model.Hashtag

    private TokenizedObjectPropertyClause forHashtagObject(final String normed) {
        ThreeParts t = divide(normed, TweetSyntax.HASHTAG_PATTERN);
        return null == t
                ? null
                : new TokenizedObjectPropertyClause(t.first, new Hashtag(t.second.substring(1)), t.third);
    }
View Full Code Here

Examples of net.fortytwo.twitlogic.model.Hashtag

            text = text.substring(ASPIRATIONAL_SCREENNAME.length()).trim();
        }*/

        String link = null;
        if (TweetSyntax.HASHTAG_PATTERN.matcher(text).matches()) {
            link = PersistenceContext.uriOf(new Hashtag(text.substring(1)));
        } else if (TweetSyntax.USERNAME_PATTERN.matcher(text).matches()) {
            link = PersistenceContext.uriOf(new User(text.substring(1)).getHeldBy());
        }

        if (null == link) {
View Full Code Here

Examples of net.fortytwo.twitlogic.model.Hashtag

        if (null == tweet.getEntities() && null != tweet.getText()) {
            Entities entities = new Entities();

            Collection<Resource> topics = entities.getTopics();
            for (String tag : TweetSyntax.findHashtags(tweet.getText())) {
                topics.add(new Hashtag(tag));
            }

            // Note: dollar tags are not "sniffed" here.

            Collection<URIReference> links = entities.getLinks();
View Full Code Here

Examples of net.fortytwo.twitlogic.model.Hashtag

    public void testPartsOfSpeech() throws Exception {
        assertExpected("@joshsh #knows @xixiluo",
                new Triple(JOSHSH, KNOWS, XIXILUO));
        assertExpected("#joshsh #knows @xixiluo",
                new Triple(new Hashtag("joshsh"), KNOWS, XIXILUO));
        assertExpected("\"josh\" #knows @xixiluo");
        assertExpected("http://example.org/joshsh #knows @xixiluo");

        assertExpected("@joshsh #knows @xixiluo",
                new Triple(JOSHSH, KNOWS, XIXILUO));
        assertExpected("@joshsh @knows @xixiluo");
        assertExpected("@joshsh \"knows\" @xixiluo");
        assertExpected("@joshsh http://example.org/knows @xixiluo");
       
        assertExpected("@joshsh #knows @xixiluo",
                new Triple(JOSHSH, KNOWS, XIXILUO));
        assertExpected("@joshsh #knows #xixiluo",
                new Triple(JOSHSH, KNOWS, new Hashtag("xixiluo")));
        assertExpected("@joshsh #knows \"xixiluo\"",
                new Triple(JOSHSH, KNOWS, new PlainLiteral("xixiluo")));
        assertExpected("@joshsh #knows http://example.org/xixiluo",
                new Triple(JOSHSH, KNOWS, new TypedLiteral("http://example.org/xixiluo", XMLSchema.NAMESPACE + "anyURI")));
    }
View Full Code Here

Examples of net.fortytwo.twitlogic.model.Hashtag

        assertExpected("@joshsh (#knows) @xixiluo");
    }

    public void testMultipleMatches() throws Exception {
        assertExpected("A #one, a #two, a #one #two #three #four!",
                new Triple(new Hashtag("one"), new Hashtag("two"), new Hashtag("three")),
                new Triple(new Hashtag("two"), new Hashtag("three"), new Hashtag("four")));
    }
View Full Code Here

Examples of org.encuestame.persistence.domain.HashTag

    final MultiValueMap<String, Object> tweetParams = new LinkedMultiValueMap<String, Object>();
    String hashStrign = "";
    if (hashtags.size() > 0) {
      Iterator<HashTag> iterator = hashtags.iterator();
        while(iterator.hasNext()) {
          HashTag setElement = iterator.next();
            hashStrign  = hashStrign + setElement.getHashTag() + ",";
        }
        tweetParams.add("tags",  hashStrign.substring(0,hashStrign.length()-1));
    }    
        tweetParams.add("type","text");
        tweetParams.add("state","published");       
View Full Code Here

Examples of org.encuestame.persistence.domain.HashTag

     * Create {@link HashTag}.
     * @param name tag name
     * @return {@link HashTag}.
     */
    public final HashTag createHashTag(final String name){
        final HashTag hashTag = new HashTag();
        hashTag.setHashTag(ValidationUtils.removeNonAlphanumericCharacters(name));
        hashTag.setHits(1L); //FIXME: should be parametrized ?
        hashTag.setSize(12L); //FIXME: should be parametrized ?
        hashTag.setUpdatedDate(Calendar.getInstance().getTime());
        getHashTagDao().saveOrUpdate(hashTag);
        return hashTag;
    }
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.