Puristaa

Puristaa (Finnish for compress)

Provide a memory neutral and fast implementation that is clear to understand and works for the use case of extracting a common prefix of a sequence of strings and yielding that prefix and a generator for the compressed strings of the original sequence.

The latter is not yet clear. One simple implementation path is to receive a reference to a sequence, determine min-max, compare min to max by character and break with first index of enumaeration not matching. Finally yield first the prefix, subsequently all strings of the sequence each shortened by the prefix.

Another still open question is, if a composition of functions can be construed, such that the prefix finding algorithm respects a caller provided policy representing the inner structure of the strings. An example for an inner structure is a sequence of paths as strings. A path policy would provide a separator that modifies the prefix finding algorithm to backtrack to the previous such separator token.

why? well, imagine the sequence 'bar/baz', 'bar/bazaar' and a path policy providing the boolean predicate lambda x: x == '/' should not yield 'bar/baz', '', 'aar' but instead 'bar/', 'baz', 'bazaar'.

license Country of Origin Export Classification Control Number (ECCN) Configuration

Version Downloads Python Maintenance Status

Bug Tracker

Any feature requests or bug reports shall go to the todos of puristaa.

Primary Source repository

The main source of puristaa is on a mountain in central Switzerland. We use distributed version control (git). There is no central hub. Every clone can become a new source for the benefit of all. The preferred public clone of puristaa is:

  • at sourcehut - a collection of tools useful for software development.

Contributions

Please do not submit "pull requests" (I found no way to disable that "feature" on GitHub). If you like to share small changes under the repositories license please kindly do so by sending a patchset. You can either send such a patchset per email using git send-email or if you are a sourcehut user by selecting "Prepare a patchset" on the summary page of your fork at sourcehut.

Support

Please kindly submit issues at https://todo.sr.ht/~sthagen/puristaa or write plain text email to ~sthagen/[email protected] to submit patches and request support. Thanks.