Twitter Text Java

The Twitter Text Java library tokenizes and parses text according to platform text requirements.

github.com/twitter/twitter-text/tree/master/java
Twitter Text Java homepage screenshot

About Twitter Text Java

Twitter Text Java is the Java implementation of the twitter-text parsing library. It tokenizes and parses text to meet platform text requirements, with methods and classes to calculate length and validity and to parse @mentions, #hashtags, URLs, and more.

It uses configuration files to define length rules, including v1.json for traditional 140-character parsing and v2.json for weighted Tweets where Unicode ranges have independent weights. The parseTweet method returns weighted length, permillage relative to the maximum, validity, and display text ranges; permillage over 1000 indicates text longer than the allowable maximum.

Key features

  • Calculate weighted length and validity with parseTweet
  • Extract URLs from Tweet text with Extractor class
  • Auto-link mentions, hashtags, URLs and cashtags to HTML
  • Support v1 legacy and v2 weighted length configurations
  • Discount twemoji-supported emoji when emojiParsingEnabled is true
  • Report display and valid display text ranges
Best for: Java developers who need to validate, measure, extract from, or auto-link Tweet text.
Good for
  • Distributed via Maven Central with documented pom.xml dependency
  • Provides conformance and unit tests run with Maven
  • Supports both legacy 140-character and weighted length configurations

Twitter Text Java at a glance

Type
Open-source project
Pricing
Not confirmed. Check the site
Open source
Yes · Source code
Language
English
Last checked
Oct 5, 2026 · Online when checked
Listed
Oct 5, 2026

Twitter Text Java alternatives

Tools and sites you could use instead, ranked by how closely they match.

All 24 alternatives

frog

github.com/LanguageMachines/frog

Frog combines memory based NLP modules for Dutch, including tagging, lemmatization, morphology analysis, and dependency parsing.

Open source
24 alternatives

Popular in Programming Languages

Well-known listings from the same topic.

All 66

Twitter Text Java FAQ

How do I add twitter-text-java to a Maven project?
Add a dependency with groupId com.twitter.twittertext and artifactId twitter-text to pom.xml; artifacts are published to Maven Central.
How do I check length and validity of text?
Call TwitterTextParser.parseTweet with the text; it returns weightedLength, permillage, isValid, and display text ranges.
How do I build the library and run tests?
Run mvn clean install to build and mvn test to run conformance and unit tests.
Is something wrong or out of date?

Tell us and an editor will check it.

Own this website?

Claim the listing and suggest updates yourself. An editor checks every claim first.

Claim this listing