2 unstable releases

Uses old Rust 2015

0.2.0 May 19, 2020
0.1.0 Mar 11, 2019

#6 in #tweet

Download history 299/week @ 2024-03-11 121/week @ 2024-03-18 210/week @ 2024-03-25 162/week @ 2024-04-01 113/week @ 2024-04-08 207/week @ 2024-04-15 103/week @ 2024-04-22 53/week @ 2024-04-29 74/week @ 2024-05-06 83/week @ 2024-05-13 47/week @ 2024-05-20 100/week @ 2024-05-27 29/week @ 2024-06-03 47/week @ 2024-06-10 84/week @ 2024-06-17 51/week @ 2024-06-24

213 downloads per month
Used in 3 crates

Apache-2.0

150KB
5K SLoC

Pest 3.5K SLoC // 0.0% comments Rust 1.5K SLoC // 0.1% comments

twitter-text in Rust

This repo is a Rust implementation of twitter-text. All aspects of tweet text are parsed by a Pest PEG grammar, with the exception of URL length and character weighting. See the parser directory for the grammar. Procedural validation for URL lengths and character weights is performed by the Extractor code.

To run the tests, install Rust, and then try this in the terminal:

> cargo build
> cargo test

The original Twitter README content is below.

twitter-text

This repo is a collection of libraries and conformance tests to standardize parsing of Tweet text. It synchronizes development, testing, creating issues, and pull requests for twitter-text's implementations and specification. These libraries are responsible for determining the quantity of characters in a Tweet and identifying and linking any url, @username, #hashtag, or $cashtag.

See implementations and conformance in this repo below:

Copyright 2012-2018 Twitter, Inc and other contributors

Copyright 2019 Robert Sayre

Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0

Dependencies

~3.5–4.5MB
~118K SLoC