Skip to main content

Tools for easy statistical analysis of the Voynich Manuscript

Project description

A Python library for easy statistical analysis of the Voynich Manuscript.

Installation

pip install pykeedy

Development:

git clone https://github.com/pwspen/pykeedy.git
cd pykeedy
pip install -e .

Features

  • Easily-loadable VMS transliteration (EVA or CUVA alphabet)
  • Filtering by every available property (Currier language, illustration type, locus type, etc)
  • Naibbe encoder supporting arbitrary encoding tables + decoder implementing algorithm from paper
  • Handful of comparison manuscripts in European languages + easily load and chuck em all into the same analysis
  • Plotter functions for common data types / analyses (see examples)
  • Functions to easily calculate, at either character or word level:
    • n-gram frequency rank (most common character, word, character pair, word pair...)
    • n-gram co-occurence (aka, pair attraction for n=2)
    • entropy
      • single (Shannon), pair, conditional
    • Position distributions (letter in word, word in line, letter in page, etc)
  • Highly composable and extensible
  • Automatic analysis: All of these plots were generated with a single function call

Usage

from pykeedy import VMS, LocusProp
from pykeedy.analysis import shannon_entropy, conditional_entropy
from pykeedy.utils import load_corpus, scatterplot
from pykeedy.crypt import naibbe_encrypt

vms = VMS.to_text()  # Single string
vms = VMS.to_lines() # List of line strings
vms = VMS.to_words() # List of word strings

# Processing options
vms = VMS.to_text(alphabet="cuva", normalize_gaps=False)

# Filter by any property, or many at once
voynich_b = VMS.filter(props=[LocusProp.CurrierLanguage.B]).to_text()

plains = load_corpus() # Loads set of comparison plaintexts 
                       # (Latin, German, Italian)

analyze = {}
for name, text in plains.items()
    analyze[name] = text
    # Encrypt plaintexts in method that best matches Voynich statistically
    analyze[name + '_naibbe_encrypt'] = naibbe_encrypt(text)
analyze['vms b'] = voynich_b # Add VMS

results = {name: (shannon_entropy(text), conditional_entropy(text))
                                    for name, text in analyze.items()}

scatterplot(results) # Saves to scatterplot.png

[!WARNING] This library is not yet stable. You may find bugs and updates may break things. Please report any bugs.

Documentation

The current documentation is 10+ thoroughly commented examples which you can find in the examples folder.

There are examples that plot each of the following in around 20 lines or less:

  • Word frequency in Voynich A and B
  • Character and conditional entropy for the VMS vs plaintext comparison manuscripts
  • Word length distribution (token and type)
  • Character and word co-occurence / pair attraction heatmaps
  • Most common character & word pairs / triplets
  • Character & word position distributions
  • Entropies of VMS + plaintexts + Naibbe cipher encryptions of those plaintexts
  • You can see all of the plots generated by examples in examples/results.md

Goals

Library goals:

  1. Lower the barrier to entry for Voynich statistical analysis
    • There are some tools out there, but they're scattered, relatively basic, and far from user friendly, even for programmers. This library aims to be very capable while not sacrificing any usability.
  2. Reproduce all the important statistical results in one place
    • There is a TON of analysis out there, but it's even more scattered, and a lot of it is just results with no reproduction available, which means it's difficult to tweak and experiment with and build on.

Issues & PRs welcome!

Voynich resources

Wishlist / todo

Advanced

  • Automated topic analysis
  • Measure of clustering strength for similar words

Research directions

  • Auto-solving Naibbe ciphers
  • Simple reference self-citation algorithm

General

  • docstrings
  • then generate real docs
  • Find better corpus for comparison manuscripts
  • More composable system for corpus
  • Option to generate subplots
  • More options for dealing with spaces and newlines in entropy, freq, cooccurence analysis
  • STA alphabet support
  • character and word pair attraction symmetry scalar
  • Support for recognizing single glyphs in non-basic EVA
  • Measure of Naibbe encoding ambiguity
  • Voynich font alongside transliteration for plots
  • basic testing suite
  • support for bitrans rulefiles
  • encoding scorer (ambiguity, reconstruction, simplicity, match to VMS)

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

pykeedy-0.1.0.tar.gz (1.7 MB view details)

Uploaded Source

Built Distribution

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

pykeedy-0.1.0-py3-none-any.whl (3.5 MB view details)

Uploaded Python 3

File details

Details for the file pykeedy-0.1.0.tar.gz.

File metadata

  • Download URL: pykeedy-0.1.0.tar.gz
  • Upload date:
  • Size: 1.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.14

File hashes

Hashes for pykeedy-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a6b5beb9f4407dff5df4df3c38238a4ecba606c581865aab52a362cfc3902926
MD5 aa2abdb24e3ce6f2ce1a780387f1d4e6
BLAKE2b-256 68acdc790c23883d93b4653789fbf5191a50f16f0bf4f6a38c116a0edba9261f

See more details on using hashes here.

File details

Details for the file pykeedy-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pykeedy-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.5 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.14

File hashes

Hashes for pykeedy-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 06f1768a2034838b304ad1347da2cd095ca4c7f9fbc76771957548eaa228d931
MD5 484c6acfb144783c0fbc0084d0d8a33b
BLAKE2b-256 a2e46a831f255a7b1d95686f5c3d98dab89125ff1b63cc9b51fafe027a51e42b

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