Code: Select all
<file>
<s>
<cl>
<milestone book='03' chapter='01' verse='01' />
<w id='030101' pos='C-' pc='--------' lemma='ἐπειδήπερ'>Ἐπειδήπερ</w>
<w id='030101' pos='A-' pc='----NPM-' lemma='πολύς'>πολλοὶ</w>
<w id='030101' pos='V-' pc='3AAI-P--' lemma='ἐπιχειρέω'>ἐπεχείρησαν</w>
<w id='030101' pos='V-' pc='-AMN----' lemma='ἀνατάσσομαι'>ἀνατάξασθαι</w>
<w id='030101' pos='N-' pc='----ASF-' lemma='διήγησις'>διήγησιν</w>
<w id='030101' pos='P-' pc='--------' lemma='περί'>περὶ</w>
<w id='030101' pos='RA' pc='----GPN-' lemma='ὁ'>τῶν</w>
<w id='030101' pos='V-' pc='-XPPGPN-' lemma='πληροφορέω'>πεπληροφορημένων</w>
<w id='030101' pos='P-' pc='--------' lemma='ἐν'>ἐν</w>
<w id='030101' pos='RP' pc='----DP--' lemma='ἐγώ'>ἡμῖν</w>
<w id='030101' pos='N-' pc='----GPN-' lemma='πρᾶγμα'>πραγμάτων</w>
<punc>,</punc>
</cl>
<cl>
<milestone book='03' chapter='01' verse='02' />
<w id='030102' pos='C-' pc='--------' lemma='καθώς'>καθὼς</w>
<w id='030102' pos='V-' pc='3AAI-P--' lemma='παραδίδωμι'>παρέδοσαν</w>
<w id='030102' pos='RP' pc='----DP--' lemma='ἐγώ'>ἡμῖν</w>
<w id='030102' pos='RA' pc='----NPM-' lemma='ὁ'>οἱ</w>
<w id='030102' pos='P-' pc='--------' lemma='ἀπό'>ἀπ’</w>
<w id='030102' pos='N-' pc='----GSF-' lemma='ἀρχή'>ἀρχῆς</w>
<w id='030102' pos='N-' pc='----NPM-' lemma='αὐτόπτης'>αὐτόπται</w>
<w id='030102' pos='C-' pc='--------' lemma='καί'>καὶ</w>
<w id='030102' pos='N-' pc='----NPM-' lemma='ὑπηρέτης'>ὑπηρέται</w>
<w id='030102' pos='V-' pc='-AMPNPM-' lemma='γίνομαι'>γενόμενοι</w>
<w id='030102' pos='RA' pc='----GSM-' lemma='ὁ'>τοῦ</w>
<w id='030102' pos='N-' pc='----GSM-' lemma='λόγος'>λόγου</w>
<punc>,</punc>
</cl>
<cl>
<milestone book='03' chapter='01' verse='03' />
<w id='030103' pos='V-' pc='3AAI-S--' lemma='δοκέω'>ἔδοξε</w>
<w id='030103' pos='RP' pc='----DS--' lemma='κἀγώ'>κἀμοὶ</w>
<w id='030103' pos='V-' pc='-XAPDSM-' lemma='παρακολουθέω'>παρηκολουθηκότι</w>
<w id='030103' pos='D-' pc='--------' lemma='ἄνωθεν'>ἄνωθεν</w>
<w id='030103' pos='A-' pc='----DPN-' lemma='πᾶς'>πᾶσιν</w>
<w id='030103' pos='D-' pc='--------' lemma='ἀκριβῶς'>ἀκριβῶς</w>
<w id='030103' pos='D-' pc='--------' lemma='καθεξῆς'>καθεξῆς</w>
<w id='030103' pos='RP' pc='----DS--' lemma='σύ'>σοι</w>
<w id='030103' pos='V-' pc='-AAN----' lemma='γράφω'>γράψαι</w>
<punc>,</punc>
</cl>
<cl>
<w id='030103' pos='A-' pc='----VSMS' lemma='κράτιστος'>κράτιστε</w>
<w id='030103' pos='N-' pc='----VSM-' lemma='Θεόφιλος'>Θεόφιλε</w>
<punc>,</punc>
</cl>
<cl>
<milestone book='03' chapter='01' verse='04' />
<w id='030104' pos='C-' pc='--------' lemma='ἵνα'>ἵνα</w>
<w id='030104' pos='V-' pc='2AAS-S--' lemma='ἐπιγινώσκω'>ἐπιγνῷς</w>
<w id='030104' pos='P-' pc='--------' lemma='περί'>περὶ</w>
<w id='030104' pos='RR' pc='----GPM-' lemma='ὅς'>ὧν</w>
<w id='030104' pos='V-' pc='2API-S--' lemma='κατηχέω'>κατηχήθης</w>
<w id='030104' pos='N-' pc='----GPM-' lemma='λόγος'>λόγων</w>
<w id='030104' pos='RA' pc='----ASF-' lemma='ὁ'>τὴν</w>
<w id='030104' pos='N-' pc='----ASF-' lemma='ἀσφάλεια'>ἀσφάλειαν</w>
<punc>.</punc>
</cl>
</s>
!!! SNIP !!!
Then I wrote a simple XQuery library that tests individual words for part of speech, number, person, tense, voice, mood, and case. After that, I wrote an XSLT stylesheet to present results.
Here are a few sample queries. They are all written in standard XQuery, the second and third queries use the morphology library I wrote.
- Clauses that contain the word βλέπω
Code: Select all
<out>{ for $clause in doc("luke.txt.xml")//cl where some $word in $clause/w satisfies $word/@lemma='βλέπω' return $clause }</out>
- Clauses that contain the word βλέπω, and also contain one noun that is nominative and one noun that is accusative
Code: Select all
import module namespace morph="http://ibiblio.org/bgreek/morph" at "./morph.xqlib"; <out>{ for $clause in doc("luke.txt.xml")//cl where (some $word in $clause//w satisfies $word/@lemma='βλέπω') and (some $word in $clause//w satisfies morph:is-noun($word) and morph:is-accusative($word)) and (some $word in $clause//w satisfies morph:is-noun($word) and morph:is-nominative($word)) return $clause }</out>
- Clauses that contain an adjective, article, and noun in that order, where all three are nominative
Code: Select all
import module namespace morph="http://ibiblio.org/bgreek/morph" at "./morph.xqlib"; <out>{ for $adj in doc("luke.txt.xml")//w let $art := $adj/following-sibling::w[1] let $noun := $art/following-sibling::w[1] where morph:is-adjective($adj) and morph:is-nominative($adj) and morph:is-article($art) and morph:is-nominative($art) and morph:is-noun($noun) and morph:is-nominative($noun) return $adj/parent::cl }</out>
Are there particular kinds of queries we should be sure this can handle?