/twitter-location-parser

Twitter user's location parser

Primary LanguageJavaApache License 2.0Apache-2.0

#Twitter Location Parser

Fast twitter user's location parser

This project purpose is to parse the location field in twitter's user object.

The main requirment while writing this project is to support the speed of Twitter's firehose streaming api, which is ~10000 msg / sec.

###Getting Started ####Installation #####Maven *Currntly the project is not deplyed in maven repoistory.

Download the latest version here and run mvn install to install it into your local maven repository. Then include this dependency in the pom.xml

<dependency>
  <groupId>com.taykey</groupId>
  <artifactId>twitter-location-parser</artifactId>
  <version>${twitter-location-parser.version}</version>
</dependency>   

Another option is to run mvn package and use the jar in target folder.

####Usage

import com.taykey.twitterlocationparser.dto.Location
import com.taykey.twitterlocationparser.LocationParser;
import com.taykey.twitterlocationparser.DefaultLocationParser;
.
.
.
LocationParser locationParser = new DefaultLocationParser();
String text = "i live in Tel Aviv";
Location location = locationParser.parseText(text);
System.out.println(location.getName());

Or by using Spring:

Import the spring config of twitter location parser by adding this to the spring-config.xml:

<import resource="classpath:twitter-location-parser-spring-config.xml"/>

And then:

import com.taykey.twitterlocationparser.dto.Location
import com.taykey.twitterlocationparser.LocationParser;
.
.
.
@Autowired
  private LocationParser locationParser;
.
.
.
String text = "i live in Tel Aviv"
Location location = locationParser.parseText(text)
System.out.println(location.getName());

####TODO's: The To-do's for the project are location in TODO file.