Skip to main content

Construction of the xbw transform

Project description

XBWT

PyPI version

This library allows to compute the xbwt transform. The following link refers to the article in which it was defined: https://www.semanticscholar.org/paper/Compressing-and-indexing-labeled-trees%2C-with-Ferragina-Luccio/8c4f49913e8db00dc09c31af480bf4dc37a853d9.

Documentation

https://htmlpreview.github.io/?https://github.com/dolce95/xbw-transform/blob/main/doc/xbwt.html

Installation

pip install xbwt

Usage from Python as a module

It is possible to use xbwt directly in a python script by import it.

import xbwt

xbwt_obj = xbwt.readAndImportTree(r'C:\Users\dolce\OneDrive\Desktop\tree.txt')
xbwt = xbwt_obj.computeXBWT()
xbwt_obj.printXBWT(xbwt)

"""
*** XBW TRANSFORM OF THE TREE T *** 

[S_LAST, S_ALPHA]

[0, ['A', 0]]
[0, ['C', 0]]
[0, ['D', 0]]
[1, ['D', 0]]
[1, ['a', 1]]
[1, ['a', 1]]
[1, ['c', 1]]
[0, ['C', 0]]
[0, ['a', 1]]
[1, ['B', 0]]
[1, ['b', 1]]
[1, ['E', 0]]
[0, ['B', 0]]
[0, ['a', 1]]
[1, ['B', 0]]
[1, ['c', 1]]
"""

Input format

The trees to be imported to build the xbw transform must comply with the format below. In particular, nodes must be specified through the [NODE] ... [\NODE] tag. It is important that the root node has the identifier "root" in its definition. Instead, the edges are specified via the [EDGE] ... [\EDGES] tag. In the latter case, for each node it is necessary to insert the respective nodes with which the edge is formed in the respective order.

[NODES]
root = 'label1'
n1 = 'label2'
n2 = 'label3'
n3 = 'label4'
n4 = 'label5'
[\NODES]

[EDGES]
root = [n1, n2]
n1 = [n3, n5]
[\EDGES]

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

xbwt-0.0.7.tar.gz (10.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

xbwt-0.0.7-py3-none-any.whl (10.0 kB view details)

Uploaded Python 3

File details

Details for the file xbwt-0.0.7.tar.gz.

File metadata

  • Download URL: xbwt-0.0.7.tar.gz
  • Upload date:
  • Size: 10.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.0

File hashes

Hashes for xbwt-0.0.7.tar.gz
Algorithm Hash digest
SHA256 6f83d80e4ae1d07a3286fd45cef2f4e8110486ef45bc02aa3f07c79678f5479f
MD5 e1cac53a520ae2ce5662e2586862fe1f
BLAKE2b-256 7aa9b2cfa1aea3be9c17551f815623dc39ada6a0f002f546a2f3806283ae9e44

See more details on using hashes here.

File details

Details for the file xbwt-0.0.7-py3-none-any.whl.

File metadata

  • Download URL: xbwt-0.0.7-py3-none-any.whl
  • Upload date:
  • Size: 10.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.0

File hashes

Hashes for xbwt-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 e2903e2a445e071ebd70d32cf04b2b275fbc7a473d74a2fc978434d1e9721080
MD5 096d4d78b24b7da2a3100326a5071d41
BLAKE2b-256 11f40e27b6a945c4b7373b98ce24ccfae80687ea0d350e614cd596c3d4ac4e85

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page