Homogenous Groups (Duplication detection, Frequent Itemsets, etc.)
Project description
hg
Homogenous Groups, Duplication detection, Frequent Itemsets etc.
To install: pip install hg
Examples
>>> from hg import deduplicate_string_lines
>>> example_text = '''Lorem ipsum
... dolor sit amet
... dolor sit amet
... dolor sit amet
... Consectetur adipiscing
... Lorem ipsum
... dolor sit amet
... dolor sit amet
... Consectetur adipiscing
... Something else
... '''
>>> final_text, removed = deduplicate_string_lines(example_text, min_block_size=3)
>>> print("=== Deduplicated Lines ===")
=== Deduplicated Lines ===
>>> print(final_text)
Lorem ipsum
dolor sit amet
dolor sit amet
dolor sit amet
Consectetur adipiscing
Consectetur adipiscing
Something else
>>> print("\n=== Removed Blocks ===")
<BLANKLINE>
=== Removed Blocks ===
>>> for block in removed:
... print(f"Removed block starting at line {block['removed_start']} with length {block['length']}:")
... for item in block['block_items']:
... print(f" {item}")
... print()
Removed block starting at line 5 with length 3:
Lorem ipsum
dolor sit amet
dolor sit amet
<BLANKLINE>
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
hg-0.0.7.tar.gz
(9.3 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
hg-0.0.7-py3-none-any.whl
(9.9 kB
view details)
File details
Details for the file hg-0.0.7.tar.gz.
File metadata
- Download URL: hg-0.0.7.tar.gz
- Upload date:
- Size: 9.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8f5bd9567c0a6a1c716ae052479d8d01bb437f88d69d5c663ea57927d8d93991
|
|
| MD5 |
baaab00a18f07b4777c8818ee55c3f25
|
|
| BLAKE2b-256 |
25e5ed9eb57c72cc87ecf290d07d1c3890152f7158c568a37e15b8331fc83228
|
File details
Details for the file hg-0.0.7-py3-none-any.whl.
File metadata
- Download URL: hg-0.0.7-py3-none-any.whl
- Upload date:
- Size: 9.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
512e5cb8e9c1ef7a07ab4d77619d12ea67c709ab9bf8b52f5ef3fbdfb52a3e7f
|
|
| MD5 |
943e331ae322f4e412beb3903cdcbac6
|
|
| BLAKE2b-256 |
adffb92ed60bad233130b3694b77e1c0c309b2ad90b59fd2ad8c150ac96b1229
|