Package: seqsim
seqsimPython library for computing measures of distance and similarity for sequences of hashable data types.While developed as a general-purpose library,seqsimis mostly designed for usage
in research within the field of cultural evolution, and particularly of the
cultural evolution of textual traditions. Some methods act as a thin-wrapper
to either the standard Python library or of to other libraries such astextdistance.InstallationIn any standard Python environment,seqsimcan be installed with:$pipinstallseqsimUsageThe library offers different methods to compare sequences of arbitrary hashable elements.
It is possible to mix sequence and element types.Full documentation is offered atReadTheDocsand
code with almost complete coverage is offered in thetests. For most common usages,
a wrapper.distance()function can be used.>>>importseqsim>>>seqsim.edit.levenshtein_dist("kitten","string")5>>>seqsim.edit.levenshtein_dist("kitten","string",normal=True)>>>0.8333333333333334>>>seqsim.sequence.ratcliff_obershelp([1,2,3,4],[2,4,3,5])0.5>>>seqsim.compression.entropy_ncd([1,2,3,4],[2,4,3,5])0.08333333333333333DemonstrationThe core of the library are the metrics for sequence distance/similarity on
arbitrary data types, as in the table below.Method"kitten" / "sitting"(1, 2, 3, 4) / (3, 4, 2, 1)arith_ncd1.250.888889arith_ncd_normal1.250.888889birnbaum0.6666670.7birnbaum_normal0.6666670.7birnbaum_simil73birnbaum_simil_normal0.250.3bulk_delete33bulk_delete_normal0.4285710.75damerau34damerau_normal0.4285711entropy0.1013410entropy_normal0.1013410fragile_ends_simil33.5fragile_ends_simil_normal0.51jaccard0.70jaccard_normal0.70jaro0.2539680.5jaro_normal0.2539680.5jaro_winkler0.2539680.5jaro_winkler_normal0.2539680.5levenshtein34levenshtein_normal0.4285711mmcwpa0.5384620.387628mmcwpa_normal0.5384620.387628ratcliff_obershelp0.3846150.5ratcliff_obershelp_normal0.3846150.5sorensen0.3846150sorensen_normal0.3846150stemmatological_simil33stemmatological_simil_normal0.4285710.75subseq_jaccard0.7515560.547008subseq_jaccard_normal0.7515560.547008ChangelogVersion 0.3.1:Fixed bug due to typo in one of the methodsSelected one Birnbaum implementationVersion 0.3:Improvements to code quality, documentation, and referencesAdded new methods and scaffolding for future expansionsVersion 0.2:First release for new roadmap supporting sequences of any hashable Python
datatype, importing code from other projects (mostly fromtitivillus)Community guidelinesWhile the authors can be contacted directly for support, it is recommended that third
parties use GitHub standard features, such as issues and pull requests, to contribute,
report problems, or seek support.Contributing guidelines, including a code of conduct, can be found in theCONTRIBUTING.mdfile.Authors and citationThe library is developed in the context of "Cultural Evolution of Text",
project, with funding from the Riksbankens Jubileumsfond (grant agreement ID:MXM19-1087:1).If you useseqsim, please cite it as:Tresoldi, Tiago; Maurits, Luke; Dunn, Michael. (2021). seqsim, a library
for computing measures of distance and similarity for sequences of hashable data
types. Version 0.3.2. Uppsala: Uppsala universitet.
Available at:https://github.com/evotext/seqsimIn BibTeX:@misc{Tresoldi2021seqsim,
  author = {Tresoldi, Tiago; Maurits, Luke; Dunn, Michael},
  title = {seqsim, a library for computing measures of distance and similarity for sequences of hashable data types. Version 0.3.2},
  howpublished = {\url{https://github.com/evotext/seqsim}},
  address = {Uppsala},
  publisher = {Uppsala universitet},
  year = {2021},
}ReferencesThe image at the top of this file is derived from Yves de Saint-Denis,Vie et martyre de saint
Denis et de ses compagnons, versions latine et française. It is available in high
resolution fromBibliothèque nationale de France, Département des Manuscrits, Français 2090,
fol. 12v.References to the various implementation are available in the source code comments and in
theonline documentation.