Write your own script

You may want to write a script that makes use of Qumín’s built-in utilities. While some of the functions are easy to use independently, many are specific to Qumín and require preparatory steps. In this How-to, we focus on the basic operation of reading pre-computed alternation patterns. This is often the first step before writing a more complex script.

Read paradigms

from qumin.utils.tools import get_paradigms

paradigms = get_paradigms("folder/package.json")

This will return a Paradigms object. To explore its attributes and methods, turn to the corresponding API documentation.

Read patterns

from qumin.utils.tools import get_paradigms

paradigms, patterns = get_patterns("folder/package.json",
                                   "patterns/metadata.json")

This will return a PatternStore object. Some useful methods:

# Get a list of microclasses
paradigms.to_microclasses()

# Produce a lattice
paradigms.to_lattice()

# Create an incidence table
paradigms.to_incidence_table() # Play with the weight=True argument!

To explore all attributes and methods, turn to the corresponding API documentation.

The best solution to understand how paradigms and patterns can be used in further computations is probably to dive into the scripts which are provided with Qumin. They are available at the root of Qumin’s source code.