DLx Word Aligner Library

Daniel W. Hieber
Digital Linguistics
1 min readJul 25, 2020

When working with interlinear glossed examples in linguistics, the standard convention is to vertically align words using tabs, whitespace, or tables to make them more readable. Compare these two examples (from Nuuchahnulth, a Wakashan language spoken in the Pacific Northwest):

Example 1

histaqšiƛ ḥuu hiɬinʕatu.
his-taq-ši(ƛ) ḥuː hiɬ-inʕatu
there-come.from-MOM over.there there-towards.west
came.from over.there way.far.west
‘Qawiqaalth is from the far west.’

Example 2

histaqšiƛ           ḥuu        hiɬinʕatu.
his-taq-ši(ƛ) ḥuː hiɬ-inʕatu
there-come.from-MOM over.there there-towards.west
came.from over.there way.far.west
‘Qawiqaalth is from the far west.’

The second example is much easier to read. However, it is both tedious and time consuming to manually align words, especially if using just white space instead of tabs or tables. Formatting a few examples is fine, but if you’re writing a paper or book with dozens or even hundreds of examples, or if you’re working with a large corpus, formatting that many examples by hand simply isn’t practical.

The DLx Word Aligner library helps with this problem. It is a JavaScript / Node library that accepts multiple lines of text as input, and vertically aligns them using either white space or tabs, depending on your preference. Check out the live example below!

This library even handles some tricky problems counting the length of a Unicode string (although not all edge cases are accounted for).

For more information on the DLx word-aligner library, check out the project page.

--

--