Permalink
Browse files

lower-case handling of tags and mentions

  • Loading branch information...
1 parent e1ec300 commit 080ed4ab6d5573f03c5f1b3c86a9fbb64443cf43 @jexp committed Aug 15, 2012
View
12 pom.xml
@@ -40,4 +40,16 @@
<url>http://repo.springsource.org/libs-milestones</url>
</repository>
</repositories>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.6</source>
+ <target>1.6</target>
+ <encoding>UTF-8</encoding>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build >
</project>
@@ -122,7 +122,7 @@ private void addOriginalTweet(Tweet tweet, final Long replyId) {
final Matcher matcher = p.matcher(text);
Set<String> result=new LinkedHashSet<String>();
while (matcher.find()) {
- result.add(matcher.group(1));
+ result.add(matcher.group(1).toLowerCase());
}
return result;
}
@@ -74,7 +74,8 @@ public void testImportTweets() throws Exception {
boolean found=false;
for ( Tag tag : tweet.getTags() )
{
- if (tag.getTag().equals( "neo4j" )) found=true;
+ final String tagName = tag.getTag();
+ if (tagName.equalsIgnoreCase("neo4j")) found=true;
}
assertEquals("found neo4j tag", true, found );
}
@@ -84,6 +85,6 @@ public void testExtractMentions() throws Exception {
assertThat(twitterService.extractMentions("test @mesir11 test"), hasItems("mesir11"));
assertThat(twitterService.extractMentions("test @mesir11"), hasItems("mesir11"));
assertThat(twitterService.extractMentions("@mesir11 test"), hasItems("mesir11"));
- assertThat(twitterService.extractMentions("@mesir11 test @SpringSource"), hasItems("mesir11","SpringSource"));
+ assertThat(twitterService.extractMentions("@mesir11 test @springsource"), hasItems("mesir11","springsource"));
}
}

0 comments on commit 080ed4a

Please sign in to comment.