https://github.com/openstenoproject/rtf_tokenize
Simple RTF tokenizer package for Python.
https://github.com/openstenoproject/rtf_tokenize
Last synced: about 1 year ago
JSON representation
Simple RTF tokenizer package for Python.
- Host: GitHub
- URL: https://github.com/openstenoproject/rtf_tokenize
- Owner: openstenoproject
- Created: 2021-10-10T23:10:36.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-10-11T02:10:36.000Z (over 4 years ago)
- Last Synced: 2025-03-19T02:49:24.317Z (about 1 year ago)
- Language: C
- Size: 4.88 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# RTF Tokenize
A simple RTF tokenizer.
API:
``` python
# Init:
from rtf_tokenize import RtfTokenizer
tokenizer = RtfTokenizer(rtf_string)
# Get next token (return `None` on end of string):
token = tokenizer.next_token()
# Rewind a token (next call to `next_token` will return it):
tokenizer.rewind_token(token)
# Current location (last tokenized, irrespective of rewound tokens):
position = tokenizer.lnum, tokenizer.cnum
```
## Release history
### 1.0.0
* first public release