skip to main |
skip to sidebar
Iliados: Structural Search: Perform grammatical and syntactical searches on the Perseus Greek Treebank
This is a brief overview of the query language for searching the Perseus Treebank data,
which has syntactically annotated ancient texts, such as Homer's Iliad.
Each sentence in the texts are turned into trees, like sentence
diagrams, in a format called a dependency tree. The query language for searching these trees is just the CSS3 query language, with some custom additions.
- To begin, you can search for any lemma by simply typing the lemma directly:
φθογγή
- To search for all words in the accusative case, simply proceed the case by a colon (
:):
:accusative
- A term proceeded by a colon is called a "pseudo-selector". Any
part-of-speech, tense, gender, person, number, case, voice, mood, or
degree can be searched with this pseudo-selector syntax, as in
:accusative
:optative
:imperative
:dual
:verb
- To search for words that have multiple features, such as a singular,
third-person, verb, concatenate the pseudo-selectors together:
:third:singular:verb
- To search for the occurrence of a specific lemma with certain attributes, concatenate the lemma to the the pseudo-selectors:
αἰτέω:first:singular:present
- Another psuedo-selector worth knowing is the
:root selector. It searches for all "root" words in a sentence, i.e., the main clause, i.e., those words with parentId=0. It's worth noting that, in the dependency tree format, final punctuation (".", ";", and so forth) also have parentId=0. The :root selector, however, excludes punctuation. - To search for a specific morpheme/form (i.e., an inclined or conjugated word), use a selector like
[form=?], as in
[form=φθογγὴν]
- Selectors like
[a=?] are called "attribute-selectors". In addition to the form attribute-selector, the relation selector is very useful. Here is a search for all conditionals:
εἰ[relation=AuxC]
- With everything we've learned so far, it's easy to find substantival infinitives used as subjects, isn't it?
:infinitive:verb[relation=SBJ]
- Or we can search for genitive absolutes, my least favorite feature of Greek!
:genitive[relation=SBJ]
- So far we've seen how to search for individual words that have
certain inflectional and syntactic features. But we can also search for
the relationships between words, or in the jargon of
dependency-trees, the dependency relationship between terms. In a
dependency tree, a word that depends upon another, or modifies another,
has a parent-child relationship. For example, when an adjective modifies
a noun, the adjective is the child, the noun is the parent, and the
relationship between them is
ATR. Searching for parent-child relationships uses the greater-than (>) operator, as in
:noun > :adjective
- As a more concrete example, to find all adjectives modifying
μῆνις, do this:
μῆνις > :adjective[relation=ATR]
- It's worth noting that not adjectives aren't the only things that
can modify nouns. Certain genitives do this, as in "Διὸς μῆνις". Here is
a search for anything modifying "μῆνις"
μῆνις > [relation=ATR]
- At this point, we know enough to search for indicative verbs with accusative objects where the verb is that of a main clause:
:verb:indicative:root > :accusative[relation=OBJ]
- But we should note that the query above is incomplete! In fact, some
sentences begin with a coordinating conjunction ("but", "and", etc.).
In the dependency-tree scheme, these are the parents of the main verb.
So now we must express a pattern 3 levels deep:
[relation=COORD]:root > :verb:indicative > :accusative[relation=OBJ]
- Fortunately, it's possible to combine two independent queries together, by using the comma (
,) operator, as in selector1, selector2. So we can mingle the previous two queries like this:
:verb:indicative:root > :accusative[relation=OBJ], [relation=COORD]:root > :verb:indicative > :accusative[relation=OBJ]
- At this point, we also should know how to search for future-less-vivid conditionals, which could be my favorite!
:optative > εἰ[relation=AuxC] > :optative
- Another class of problems relates to the order of words
in sentences. Since the trees themselves express only syntactic
relationships, there are special operators to look for ordinal
relationships between words. For example, to search for
"subject-verb-object" word order, you can use the
:before and :after pseudo-selectors:
:verb:before([relation=SBJ]):after([relation=OBJ])
In this example, the before and after pseudo-selectors are functions that take arguments. There arguments are selectors themselves (e.g., [relation=SBJ]) and those are evaluated relative to a parent selector. That sounds a bit complicated, but it means that :verb:before([relation=SBJ]) will only look for words with [relation=SBJ] that are also children of the verb in the dependency tree. - Sometimes, however, it's simpler or more useful to search only for
word order and ignore any syntactic relationship between the words.
There are two ways to do this. The first uses the plus (
+) operator, which looks for immediately adjacent words within a sentence, as in
φίλος + γάρ + εἰμί
- The second is the tilda (
~) operator, which looks only at word order in a sentence, ignoring whether the terms are right next to each other:
φίλος ~ εἰμί
[First posted in AWOL 7 May 2012, updated 26 October 2018]
ΛΟΓΕΙΟΝ - Logeion
- Update September 2018: Welcome to the beta release of
Logeion 2, built by Philip Posner, Ethan Della Rocca and Josh Day.
Enjoy! Do go for a ride on the inverse word wheel.
- Logeion (literally, a place for words; in particular, a speaker's platform, or an archive) was developed after the example of dvlf.uchicago.edu,
to provide simultaneous lookup of entries in the many reference works
that make up the Perseus Classical collection. As always, we are
grateful for the Perseus Project's generosity in sharing their data.
None of this would be possible without their commitment to open access.
To enhance this site as both a research and a pedagogical tool, we add
information based on corpus data in the right side bar, as well as
references to chapters in standard textbooks.
- Update March 2017: We
are delighted to announce the advent of two new resources. First of
all, a team of scholar volunteers led by Gérard Gréco has worked to make
Gaffiot's famous 1934 Dictionnaire Latin Français
available in digital and updated form (including frequency data and
updated standard citations for texts, among many other things), and we
are delighted to incorporate this work, Gaffiot 2016, in Logeion. Many
thanks to Gérard Gréco and also to Mark de Wilde for helping us to work out our formatting problems.
- In addition, from Spain, we are delighted to add LMPG en línea,
the digitized version of the lexicon for magic and religion in the
Greek magical papyri originally published in 2001. Do visit the project's homepage to see the fuller array of functions available there. Many thanks, as always, to Prof. Somolinos and his team.
- Update January 2016: We are delighted to announce the advent of the Dictionary of Medieval Latin from British Sources in Logeion. Many thanks to the British Academy (specifically, its Projects committee and its DMLBS committee), and in particular to the editor of DMLBS, Richard Ashdowne,
for making this happen. We are thrilled to add another newly-released
resource on the Latin side. Academic users: please do urge your
libraries to purchase print copies of DMLBS (and DGE!), if they have not yet done so.
- Many thanks to Matt Shanahan, Josh Day, and XSLT wizard Alex Lee for their help in bringing DMLBS to Logeion.
- The Dictionary of Medieval Latin from British Sources
is the work of a century-long British Academy project, based first in
London and then at the University of Oxford, that ran from 1913 to the
completion of the printed dictionary in 2013. The DMLBS has been
based wholly on original research and it documents the vocabulary of
Latin in medieval Britain from the sixth to the sixteenth centuries. The
DMLBS is a copyright work and the text appears on the Logeion
site under licence from the British Academy, to whom we express our
thanks. Users will find the following resources at the DMLBS project
website helpful: A user's guide to the dictionary, the bibliography and notes to the bibliography, and guidelines for citing DMLBS.
- Hellenists also have reason to rejoice: The Woordenboek Grieks/Nederlands, a Dutch project in progress, has made its finished letter ranges available to us. We thank the editors-in-chief, Ineke Sluiter, Albert Rijksbaron, and Ton Kessels, and their project coordinator, Lucien van Beek. A full roster
of the team of writers and editors, and further information about the
project, can be found on its website. At Logeion we believe that all
users stand to benefit from up-to-date Greek dictionaries such as DGE
and Grieks/Nederlands, regardless of their mother tongue. This is the
first dictionary that Walt Shandruk has handled for Logeion; and
while it takes skill to adapt third-party data, Walt has dealt with that
but also confronted third-party code - with aplomb. Many thanks.
- In other news, BWL,
which is derived from a useful Dutch resource for intermediate Latin
students, and illustrates important constructions and idiomatic usages
of the most frequent Latin words, now features translations for its
example sentences. This was a long-time desideratum, and we thank Rebekah Spearman
for doing the last push that this project needed. She, however, cannot
be held responsible for all the thousands of translated sentences!
Please send your comments our way if you encounter problems. The other
existing dictionaries, too, have seen the usual additional cleanup of
infelicities in the original data entry process. Many thanks to all
users who pointed out errors. If you find more, please report them: we
are grateful for your assistance in incrementally improving this
resource.
- Update January 2015: We are grateful to Philip Peek of Bowling Green State University for making available his file with vocabulary for Chase & Phillips.
- Update August 2014:
In addition to the usual editing of existing dictionaries and
morphology (keep reporting typos to us, please!), we are delighted to
add a first author-specific lexicon on the Latin side, thanks to efforts
at Dickinson College. Users will now encounter Frieze-Dennison's lexicon to Vergil's Aeneid for relevant entries. Many thanks to Christopher Francese and the DCC 'crew'! On another note, Logeion and the Logeion app got a mention in the New York Times,
which we are thrilled about. We are, as always, grateful to Josh, Matt
& Josh for developing this site and the app, and to the College of
the University of Chicago for its support and its 'ambidextrous'
undergrads, who know their way around Python and XML as well as around
Greek and Latin.
- Update December 2013: We are delighted to announce that we are adding the premier dictionary for Ancient Greek, the Diccionario Griego-Español (DGE),
to Logeion. Both for entries from DGE and from DuCange, we will include
a link to these dictionaries' home sites for every entry we display. As
we work on displaying these entries better, we recommend (also)
visiting the home sites, which look positively elegant. This update also
brings the Latin-Dutch dictionary, LaNe, up to date with the printed
6th edition, which will be coming out soon.
- Update October 2013: Logeion is now available as an app for iOS, so that you can consult it even without a working internet connection. Find the Logeion app in Apple's app store.
- Update January 2012: We have now added a Latin-Dutch dictionary to the collection: The Woordenboek Latijn/Nederlands.
One notable feature of this dictionary, for those who do not speak
Dutch, is that a lot of attention has been paid to ensure accuracy of
vowel length for the lexical entries. For further information see below.
[First posted in AWOL 28 July 2009. Updated 14 September 2018]
News and updates
Welcome to Perseus under PhiloLogic. It's been a while since we released
an official update, but here it is, thanks to indefatigable wrangling
(of C, perl, apache and many other arcana) this summer by Walt Shandruk.
The intervening years have seen significant work especially on the side
of the Greek texts, and some enhancements to the functionality of
PhiloLogic for ... philologists. I'd like to thank all those who have
written to us over the years to report typos and other errors; or simply
to report a server outage. We are glad you keep coming back for more.
If the Perseus mothership at Tufts represents a well-outfitted library
carrel, with texts, commentaries, dictionaries and other resources all
within your reach on the same page, then the organization of this site
may come as a surprise. Rather than reading-with-apparatus, we aim to
offer exploration of the texts through a panoply of corpus queries.
Because many texts have been parsed by hand, and the rest of them with
the computer, you can search in ways that you don't see in too many
other places: For instance, search for present imperatives in Plato, or
the particle μέν only in lines spoken by Ismene. Looking for forms of
βροτός at the end of the sentence? We are here to serve them up. For
experienced and post-beginner readers, we also recommend tools that will
by now be familiar, I hope: the Keyword in Context view, and the
Collocation tool.
We are grateful for all problem reports and user suggestions; keep them
(and your donations:-)) coming. To keep abreast of developments,
consider following us on Twitter: @LogeionGkLat. Work that awaits: we
really want to incorporate more texts, which are steadily becoming
available from the Perseus Digital Library. More importantly, we need to
adapt the new generation of PhiloLogic, PhiloLogic4,
to the needs of classicists (think: navigation that is not by page
number in an edition; lemma searches; ...), so that we no longer depend
on fifteen-year-old technology. Stay tuned.