kondrak-aline

Crates.iokondrak-aline
lib.rskondrak-aline
version0.1.5
created_at2025-05-18 19:15:25.27402+00
updated_at2025-09-12 08:53:13.058471+00
descriptionImplementation of Kondrak's ALINE alignment algorithm
homepage
repositoryhttps://forgejo.puffer.fish/matthieu/aline-rs
max_upload_size
id1678847
size41,176
Matthieu Pignolet (MatthieuCoder)

documentation

README

https://webdocs.cs.ualberta.ca/~kondrak/ Copyright 2002 by Grzegorz Kondrak.

ALINE is an algorithm for aligning phonetic sequences, described in [1]. This module is a port of Kondrak's (2002) ALINE. It provides functions for phonetic sequence alignment and similarity analysis. These are useful in historical linguistics, sociolinguistics and synchronic phonology.

ALINE has parameters that can be tuned for desired output. These parameters are:

  • C_skip, C_sub, C_exp, C_vwl
  • Salience weights
  • Segmental features

In this implementation, some parameters have been changed from their default values as described in [1], in order to replicate published results. All changes are noted in comments.

Get optimal alignment of two phonetic sequences

use kondrak_aline::align;

let alignment = align("θin", "tenwis", 0.0);

assert_eq!(
    alignment,
    vec![
        vec![
            ("θ", "t"),
            ("i", "e"),
            ("n", "n")
        ].iter()
        .map(|(a, b)| (a.to_string(), b.to_string()))
        .collect::<Vec<(String, String)>>()
    ]
);

References

[1] G. Kondrak. Algorithms for Language Reconstruction. PhD dissertation, University of Toronto.

Commit count: 0

cargo fmt