Skip to content

Commit

Permalink
update README for TokenizedAttributedString->setTokenDictionaryAttrib…
Browse files Browse the repository at this point in the history
…ute() and ->lowercaseTokens()
  • Loading branch information
apemsel committed Mar 1, 2016
1 parent 2c239bc commit 657f33a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,8 @@ A class to work with attributed strings in PHP. Attributed strings are strings t
$tas->getTokenOffsets(); // [0, 4, 10, 16], start offsets of the tokens in the string
$tas->setTokenRangeAttribute(2, 3, "underlined"); // set tokens 2 to 3 to "underlined"
$tas->getAttributesAtToken(2); // ["bold", "underlined"]
$tas->lowercaseTokens(); // convert tokens to lowercase
$tas->setTokenDictionaryAttribute(["a", "an", "the"], "article"); // set all tokens contained in given dictionary to an attribute
$tas->getAttributesAtToken(0); // "article"

```

0 comments on commit 657f33a

Please sign in to comment.