Compressed representation of sequence edits
Project description
Sequence Edits
Compressed representation of sequence edits
Edits
class Skip:
id: int
tag = 'skip'
class Insert:
idx: int
value: T
tag = 'insert'
Edit = Skip | Insert
All edits are applied w.r.t. the original list. So, order of edits only affects the order in which values are insterted to a same index.
Usage
import sequence_edits as se
edits = [
se.Insert(idx=1, value='the'),
se.Skip(idx=4)
]
xs = ['And', 'earth', 'was', 'without', 'no', 'form']
list(se.apply(edits, xs))
# ['And', 'the', 'earth', 'was', 'without', 'form']
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
sequence_edits-0.1.8.tar.gz
(2.5 kB
view hashes)
Built Distribution
Close
Hashes for sequence_edits-0.1.8-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4a540b1358740f8a71c0338080bfcef643bd6fab53f818f416f3cefd0eb677a6 |
|
MD5 | 9747c4d3ee72f4fa3b24951a8a368645 |
|
BLAKE2b-256 | 5f03d45da801d040665857f7d56f85ae30f5f8740b242d8edca25f4b2958b241 |