Alpheios and Treebank Publications

The Alpheios Reading Tools and Perseids Treebank Template can be used together to augment the features provided by the Alpheios Reading tools for treed texts.

Trees published via the Treebank Template can be used by Alpheios to:

  1. Disambiguate the morphological data shown to a user for a word.
  2. Show the visual representation of the dependency tree.


1. Decide how Alpheios will be enabled for the page.

The treebank functionality will work with Alpheios version 3.3.x and later, whether it is accessed through Browser Extensions or the Embedded library. If you are publishing your own page anyway, however, we recommend using the Embedded library as it provides greater flexibility as well as support for mobile devices. See the Alpheios Embedded Library Tutorial for detailed instructions.

Example HTML

NOTE: In the above example we specify to use whatever is the latest available version of the Alpheios code by referencing the @latest tag in the URLs. This ensures that your page automatically gets updated with new versions of Alpheios as they are released. While Alpheios releases are normally backwards-compatible and this should not create any problems for your page, if you want to have tighter control over when your site gets Alpheios code updates, you can specify the exact version of the Alpheios code to use, rather than using the @latest tag. You can find a full list of available versions at the NPM package pages for the Alpheios Embedded Library and its companion package Alpheios Components (clicking on the Versions tab). See the following example:

Example HTML

2. Instruct Alpheios to use treebank data for a chunk of text.

To signal to Alpheios that a tree is available for a chunk of text on the page, you need to add some attributes to the top level parent element for the text. This can be any element that encompasses all of the text which is treed, but it's simplest to use the <body> tag. The attributes you need to add are:

Example HTML

3. Identify the treebank document for a chunk of text.

Next, you need to tell Alpheios what treebank document corresponds to the text. This is done by adding the data-alpheios_tb_doc attribute to the parent element of the chunk of text. Note that it is possible to align text chunks from different documents on the same page.

Example HTML

4. Align the sentences to the treebank document.

Finally, you need to tell Alpheios which sentence of a treebank document corresponds to the text on the page. This is done by adding the data-alpheios_tb_sent attribute added to the parent element of the chunk of text that contains the sentence.

Example HTML

5. Refine word alignment.

Alpheios and Arethusa will use the context to try to find the word within the treebank data for a sentence that corresponds to the word in the text on the page. In most cases this will work well, but in certain circumstances, you may need to override the default behavior and specify which tokens in the treebank data correspond to the word on the page. The data-alpheios_tb_word attribute can be used to do this.

Example HTML

6. Test

Make your HTML file available under a web server (e.g. such as GitHub Pages) and load it in your browser. Double-click on the words to confirm that they are linked to the treebank correctly.

NOTE: the Alpheios treebank functionality will not work on a file loaded from the filesystem. It must be served by a web server.

Demo Scenarios

The following are active demonstrations of the Alpheios/Treebank Template integration. Double-clicking the Latin or Greek text will show disambiguated morphology and linked tree displays.

Text and treebank aligned by sentence.

This sentence has the following characteristics:

τοῦτο δ᾽ ἐστὶν οὐ μόνον τὸ μὴ προκατεγνωκέναι μηδέν, οὐδὲ τὸ τὴν εὔνοιαν ἴσην ἀποδοῦναι, ἀλλὰ τὸ καὶ τῇ τάξει καὶ τῇ ἀπολογίᾳ, ὡς βεβούληται καὶ προῄρηται τῶν ἀγωνιζομένων ἕκαστος, οὕτως ἐᾶσαι χρήσασθαι.

Example HTML

Text and treebank aligned by sentence, with additional select word-level specificity.

This text has the following characteristics:

οὐ γάρ ἐστιν ἴσον νῦν ἐμοὶ τῆς παρ᾽ ὑμῶν εὐνοίας διαμαρτεῖν καὶ τούτῳ μὴ ἑλεῖν τὴν γραφήν, ἀλλ᾽ ἐμοὶ μὲν—οὐ βούλομαι δυσχερὲς εἰπεῖν οὐδὲν ἀρχόμενος τοῦ λόγου, οὗτος δ᾽ ἐκ περιουσίας μου κατηγορεῖ.

Example HTML