From: Tara L Andrews Date: Sun, 8 Jun 2014 10:05:18 +0000 (+0200) Subject: make CollateX parser recognize and cope with a.c. labels X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=39d16d81c5ab3c8e57b0ede54abbb89700f2bab4;p=scpubgit%2Fstemmatology.git make CollateX parser recognize and cope with a.c. labels --- diff --git a/base/lib/Text/Tradition/Parser/CollateX.pm b/base/lib/Text/Tradition/Parser/CollateX.pm index 2eec71b..dea5d7f 100644 --- a/base/lib/Text/Tradition/Parser/CollateX.pm +++ b/base/lib/Text/Tradition/Parser/CollateX.pm @@ -50,6 +50,7 @@ binmode STDOUT, ":utf8"; binmode STDERR, ":utf8"; eval { no warnings; binmode $DB::OUT, ":utf8"; }; +# Test a simple CollateX input my $cxfile = 't/data/Collatex-16.xml'; my $t = Text::Tradition->new( 'name' => 'inline', @@ -70,6 +71,32 @@ if( $t ) { is( $related[0]->id, 'n18', "Correct transposition link" ); } +# Now test a CollateX result with a.c. witnesses + +my $ct = Text::Tradition->new( + name => 'florilegium', + input => 'CollateX', + file => 't/data/florilegium_cx.xml' ); + +is( ref( $ct ), 'Text::Tradition', "Parsed the CollateX input" ); +if( $ct ) { + is( scalar $ct->collation->readings, 309, "Collation has all readings" ); + is( scalar $ct->collation->paths, 361, "Collation has all paths" ); + is( scalar $ct->witnesses, 13, "Collation has correct number of witnesses" ); + + my %layered = ( E => 1, P => 1, Q => 1, T => 1 ); + foreach my $w ( $ct->witnesses ) { + is( $w->is_layered, $layered{$w->sigil}, + "Witness " . $w->sigil . " has correct layered setting" ); + } + + my $pseq = $ct->witness('P')->text; + my $pseqac = $ct->witness('P')->layertext; + is( scalar @$pseq, 264, "Witness P has correct number of tokens" ); + is( scalar @$pseqac, 261, "Witness P (a.c.) has correct number of tokens" ); +} + + =end testing =cut @@ -127,11 +154,16 @@ sub parse { ## Add the path for each witness listesd. # Create the witness objects if they does not yet exist. foreach my $wit ( split( /, /, $e->{$WITKEY} ) ) { - if( $tradition->witness( $wit ) ) { - $tradition->witness( $wit )->is_collated( 1 ); - } else { - $tradition->add_witness( - 'sigil' => $wit, 'sourcetype' => 'collation' ); + my $sigil = _base_sigil( $collation, $wit ) || $wit; + my $wit_object = $tradition->witness( $sigil ); + unless( $wit_object ) { + $wit_object = $tradition->add_witness( + sigil => $sigil, + sourcetype => 'collation' ); + } + $wit_object->is_collated(1); + if( $wit ne $sigil ) { + $wit_object->is_layered(1); } $collation->add_path( $from->{$IDKEY}, $to->{$IDKEY}, $wit ); } @@ -142,8 +174,6 @@ sub parse { } } - # TODO Split readings by word unless we're asked not to - # Mark initialization as done so that relationship validation turns on $tradition->_init_done( 1 ); # Now apply transpositions as appropriate. @@ -202,6 +232,15 @@ sub parse { # later on $tradition->collation->text_from_paths(); } + +sub _base_sigil { + my( $collation, $sigil ) = @_; + my $acstr = $collation->ac_label; + if( $sigil =~ /^(.*)\Q$acstr\E$/ ) { + return $1; + } + return undef; +} =head1 BUGS / TODO diff --git a/base/lib/Text/Tradition/Witness.pm b/base/lib/Text/Tradition/Witness.pm index 69a5e66..37e6a66 100644 --- a/base/lib/Text/Tradition/Witness.pm +++ b/base/lib/Text/Tradition/Witness.pm @@ -288,7 +288,9 @@ has 'uncorrected_path' => ( isa => 'ArrayRef[Text::Tradition::Collation::Reading]', clearer => 'clear_uncorrected_path', ); - + +## TODO is_layered should be set automatically when an a.c. reading +## is added to the graph. has 'is_layered' => ( is => 'rw', isa => 'Bool', diff --git a/base/t/data/florilegium_cx.xml b/base/t/data/florilegium_cx.xml new file mode 100644 index 0000000..c2cebe8 --- /dev/null +++ b/base/t/data/florilegium_cx.xml @@ -0,0 +1 @@ +0011Μαξίμου22ἁγίου33Ἡ44περὶ55τῆς66τοῦ77πνεύματος88τοῦ99ἁγίου1010πνεύματος1111βλασφημία1211βλασφημίας1312ἀπορία1413αὐτόθι1513αὐτόθεν1614ἔχειν1714ἔχει1815τὴν1916λύσιν·2017ὁ2118δὲ2219δεύτερος2320ἐστὶν2421οὗτος·2522ὅτάν2623τις2724ἐν2825ἁμαρτίαις2926ἐνεχόμενος,3027ἀκούων3128δὲ3229τοῦ3330κυρίου3431λέγοντος3532μὴ3633κρίνετε3734κρίνεται3835φοβούμενος3936οὐδένα4037κρίνει4137κρίνῃ4238ἐν4339τῇ4440ἐξετάσει4541τῶν4642βεβιωμένων4743ὡς4844φύλαξ4945τῆς5046ἐντολῆς5147οὐ5248κρίνεται·5349εἰ5450μὴ5551τὸ5652γενέσθαι5753πιστόν,5854εἰκότως5955ὅταν6056ἐν6157ἁμαρτίαις6258τίς6359ὢν6460οἰκονομῆται6560οἰκονομεῖται6661ἐκ6762τῆς6863προνοίας6964ἐν7065συμφοραῖς,7166ἐν7267ἀνάγκαις,7368ἐν7469νόσοις7570ὡς7671οὐκ7772οἶδε7873γὰρ7974διὰ8075τῶν8176τοιούτων8277καθαίρει8377καθεαυτὸν8478αὐτὸν8579ὁ8680θεός8781οὖν8881τῶν8982τῷ9083ἐν9184ἀπιστίᾳ9284ἀπιστεία9385τὸν9486βίον9587κατακλείσαντι9687κατακλύσαντι9787καταλύσαντι9888οὔτε9989ἐνταῦθα10090οὔτε10191ἐν10292τῷ10393μέλλοντι10494ἀφεθήσεται10595τῆς10696ἀπιστίας10797καὶ10898ἀθεΐας10999ἡ110100ἁμαρτία.111101Ἰσιδώρου112101νείλου113102πηλουσιώτ(ου)114102Πηλουσίου115102τοῦ116103Γρηγορίου117103νύσσης118104Νύσης119105Ἤκουσά120106που121107τῆς122108ἁγίας123109γραφῆς124110κατακινούσης125110κατακρινούσης126111ἐκείνους,127112οἳ128113κατὰ129114τῆς130115τοῦ131116θεοῦ132117βλασφημίας133118αἴτιοι134119γίνονται.135120Οὐαὶ136121γὰρ137122φησὶν138123δι᾽139124οὓς140125τὸ141126ὄνομά142127μου143128βλασφημεῖται144129ἐν145130τοῖς146131ἔθνεσι.147132Διὰ148133τοῦτο149134γὰρ150135χαλεπὴν151136τοῖς152137τοιούτοις153138ἀπειλὴν154139ὁ155140λόγος156141ἐπανατείνεται157142λέγων158143ἐκείνοις159144εἶναι160145τὸ161146Οὐαὶ162147δι᾽163148οὓς164149τὸ165150ὄνομά166151μου167152βλασφημεῖται168153ἐν169154τοῖς170155ἔθνεσιν.171156Νείλου172157ἡ173157μοναχοῦ174158ἀπὸ175159τῶν176160τῆς177161κακίας178162ὀκτῶ179163λογισμῶν180164Ὄψις181165γυναικὸς182166μέλος183166βέλος184167ἐστὶ185168πεφαρμακευμένον186169βέλος187170ἐστὶ188171ἔτρωσε189172τὴν190173ψυχὴν,191174καὶ192175τὸν193176ἰὸν194177ἐναπέθετο,195178καὶ196179ὅσον197180χρονίζει,198181πλείονα199182τὴν200183σῆψιν201184ἐργάζεται.202185βέλτιον203186γὰρ204187οἴκοι205188μένοντα206189σχολάζειν207190διηνεκῶς208191τῇ209192προσευχῇ,210193ἢ211194διὰ212195τοῦ213196τιμᾶν214197τὰς215198ἑορτὰς216199πάρεργον217199παρανάλωμα218200γίνεσθαι219201τῶν220201τὸν221202ἐχθρῶν222202ἐχθρόν223203Φεῦγε224204συντυχίας225205γυναικῶν226206ἐὰν227207θέλῃς228208σωφρονεῖν,229209καὶ230210μὴ231210μηδαμῶς232211δῷς233212αὐτῆς234212αὐταῖς235213παρρησίαν236214θαρρῆσαι237215σοί238216ποτε.239217θάλπει240217Θάλλει241218ἑστῶσα242219βοτάνη243220ἰστῶσα244220ἑστῶσα245220ἐστῶσα246221παρ᾽247222ὕδατι,248223καὶ249224πάθος250225ἀκολασίας,251226ἐν252227συντυχίαις253228γυναικῶν.254229τοῦ255230Χρυσοστόμου256231Τοὺς257232ἐν258233τῇ259234πόλει260235βλασφημοῦντας,261236σωφρόνιζε.262237Κἂν263238ἀκούσῃς264239τινὸς265240ἐν266241ἀμφόδῳ267242ἢ268243ἐν269244ὁδῶ270245ἢ271246ἐν272247ἀγορᾷ273248βλασφημοῦντος274249τὸν275250Θεόν,276251πρόσελθε,277252ἐπιτίμησον,278253κἂν279254πληγὰς280255ἐπιθεῖναι281256δέῃ,282257μὴ283258παρεστήση284258παραιτήσῃ285259ῥάπισον286260αὐτοῦ287261τὴν288262ὄψιν,289263σύντριψον290264αὐτοῦ291265τὸ292266στόμα,293267ἁγίασόν294268σου295269τὴν296270χεῖρα297271διὰ298272τῆς299273πληγῆς,300274κἂν301275ἐγκαλῶσι302276τινές,303277κὰν304278εἰς305279δικαστήριον306280ἕλκωσιν,307281ἀκολούθησον.3082820pathG1pathC2pathB3pathD, E, E (a.c.), Q, Q (a.c.), T, T (a.c.)4pathA, F, H, K, P, P (a.c.), S5pathF, H6pathP, P (a.c.)7pathA, K, S8pathF, H9pathA, D, E, E (a.c.), F, H, K, Q, Q (a.c.), S, T, T (a.c.)10pathH11pathA, C, D, E, E (a.c.), F, K, P, P (a.c.), S, T, T (a.c.)12pathQ, Q (a.c.)13pathA, C, D, E, E (a.c.), F, K, T, T (a.c.)14pathP, P (a.c.), S15pathD16pathA, C, E, E (a.c.), F, H, K, T, T (a.c.)17pathA, C, E, E (a.c.), F, H, K, T, T (a.c.)18pathA, C, E, E (a.c.), F, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)19pathD, P, P (a.c.), Q, Q (a.c.), S20pathA, C, E, E (a.c.), F, H, K, T, T (a.c.)21pathQ, Q (a.c.)22pathD, P, P (a.c.), S23pathQ, Q (a.c.)24pathA, C, D, E, E (a.c.), F, H, K, P, P (a.c.), S, T, T (a.c.)25pathA, C, D, F, H, P, P (a.c.), S, T, T (a.c.)26pathE, E (a.c.), K27pathP, P (a.c.)28pathA, C, D, F, H, S, T, T (a.c.)29pathE, E (a.c.), K, Q, Q (a.c.)30pathP, P (a.c.)31pathA, C, D, E, E (a.c.), F, H, K, Q, Q (a.c.), S, T, T (a.c.)32pathA, C, D, E, E (a.c.), F, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)33pathA, C, D, E, E (a.c.), F, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)34pathA, C, D, E, E (a.c.), F, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)35pathA, C, D, E, E (a.c.), F, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)36pathA, C, D, E, E (a.c.), F, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)37pathA, C, D, E, E (a.c.), F, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)38pathA, C, D, E, E (a.c.), F, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)39pathA, C, D, E, E (a.c.), H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)40pathF41pathA, C, D, E, E (a.c.), H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)42pathA, C, D, E, E (a.c.), F, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)43pathA, C, D, E, E (a.c.), F, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)44pathA, C, D, E, E (a.c.), F, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)45pathA, C, D, E, E (a.c.), F, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)46pathA, C, D, E, E (a.c.), F, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)47pathA, C, D, E, E (a.c.), F, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)48pathA, C, D, E, E (a.c.), F, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)49pathA, C, D, E, E (a.c.), F, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)50pathC, E, E (a.c.), F, H, K, P, P (a.c.), Q, Q (a.c.), S51pathA, D, T, T (a.c.)52pathC, E, E (a.c.), F, K, P, P (a.c.), Q, Q (a.c.), S53pathH54pathA, D, H, T, T (a.c.)55pathA, C, D, E, E (a.c.), F, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)56pathA, D, E, E (a.c.), F, H, K, Q (a.c.), T, T (a.c.)57pathC, P, P (a.c.), Q, S58pathA, D, E, E (a.c.), F, H, K, Q (a.c.), T, T (a.c.)59pathC, P, P (a.c.), Q, S60pathA, C, D, E, E (a.c.), F, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)61pathA, C, D, E, E (a.c.), F, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)62pathA, C, D, E, E (a.c.), F, G, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)63pathA, C, D, E, E (a.c.), F, G, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)64pathA, C, D, E, E (a.c.), F, G, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)65pathA, C, D, E, E (a.c.), F, G, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)66pathA, C, D, E, E (a.c.), F, G, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)67pathA, C, D, E, E (a.c.), F, G, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)68pathA, C, D, E, E (a.c.), F, G, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)69pathA, C, D, E, E (a.c.), F, G, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)70pathA, C, D, E, E (a.c.), F, G, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)71pathA, C, D, E, E (a.c.), F, G, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)72pathA, C, D, E, E (a.c.), F, G, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)73pathA, C, D, E, E (a.c.), F, G, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)74pathA, C, D, E, E (a.c.), F, G, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)75pathA, C, D, E, E (a.c.), F, G, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)76pathA, C, D, E, E (a.c.), F, G, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)77pathA, C, D, E, E (a.c.), F, G, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)78pathA, C, D, E, E (a.c.), F, G, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)79pathA, C, D, E, E (a.c.), F, G, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)80pathA, C, D, E, E (a.c.), F, G, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)81pathA, C, K, P, P (a.c.), Q, Q (a.c.)82pathD, E, E (a.c.), F, G, H, S, T, T (a.c.)83pathA, C, K, P, P (a.c.), Q, Q (a.c.)84pathD, E, E (a.c.), F, G, H, S, T, T (a.c.)85pathA, C, D, E, E (a.c.), F, G, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)86pathA, C, D, E, E (a.c.), F, G, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)87pathA, C, D, E, E (a.c.), F, G, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)88pathA, C, D, E, E (a.c.), F, G, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)89pathA, C, D, E, E (a.c.), F, G, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)90pathA, C, D, E, E (a.c.), F, G, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)91pathA, C, D, E, E (a.c.), F, G, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)92pathA, C, D, E, E (a.c.), F, G, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)93pathP (a.c.)94pathA, C, D, E, E (a.c.), F, G, H, K, P, Q, Q (a.c.), S, T, T (a.c.)95pathA, C, D, E, E (a.c.), F, G, H, K, P, Q, Q (a.c.), S, T, T (a.c.)96pathA, C, D, E, E (a.c.), F, G, H, K, P, Q, Q (a.c.), S, T, T (a.c.)97pathA, C, D, E, E (a.c.), F, G, H, K, P, Q, Q (a.c.), S, T, T (a.c.)98pathA, C, D, E, E (a.c.), F, G, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)99pathA, C, D, E, E (a.c.), F, G, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)100pathA, C, D, E, E (a.c.), F, G, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)101pathA, C, D, E, E (a.c.), F, G, H, K, P, P (a.c.), Q, Q (a.c.), T, T (a.c.)102pathS103pathA, C, D, E, E (a.c.), F, G, H, K, P, P (a.c.), Q, Q (a.c.), T, T (a.c.)104pathS105pathA, C, D, E, E (a.c.), F, G, H, K, P, P (a.c.), Q, Q (a.c.), T, T (a.c.)106pathA, C, D, E, E (a.c.), F, G, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)107pathE, E (a.c.), G108pathA, C, D, F, H, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)109pathK110pathA, C, D, F, H, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)111pathK112pathA, C, D, E, E (a.c.), F, G, H, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)113pathC, E, E (a.c.), F, G, H, K, Q, Q (a.c.), S, T, T (a.c.)114pathA, D, P, P (a.c.)115pathC, E, E (a.c.), F, G, H, K, Q, Q (a.c.), S, T, T (a.c.)116pathA, D, P, P (a.c.)117pathA, C, D, E, E (a.c.), F, G, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)118pathA, C, D, H, K, P, P (a.c.), Q (a.c.), S, T, T (a.c.)119pathE, G120pathE (a.c.), F, Q121pathA, C, D, H, K, P, P (a.c.), Q (a.c.), S, T, T (a.c.)122pathE, G123pathE (a.c.), F, Q124pathA, C, D, E, E (a.c.), F, G, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)125pathA, C, D, E, E (a.c.), F, G, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)126pathA, C, D, E, E (a.c.), F, G, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)127pathA, C, D, E, E (a.c.), F, G, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)128pathA, C, D, E, E (a.c.), F, G, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)129pathA, C, D, E, E (a.c.), F, G, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)130pathA, C, D, E, E (a.c.), F, G, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)131pathA, C, D, E, E (a.c.), F, G, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)132pathA, C, D, E, E (a.c.), F, G, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)133pathA, C, D, E, E (a.c.), F, G, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)134pathA, C, D, E, E (a.c.), F, G, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)135pathA, C, D, E, E (a.c.), F, G, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)136pathK137pathC, D, E, E (a.c.), H, P, P (a.c.), S138pathA, F, G, T, T (a.c.)139pathQ, Q (a.c.)140pathD, P, P (a.c.), S141pathC, E, E (a.c.), H142pathQ, Q (a.c.)143pathD, P, P (a.c.), S144pathC, E, E (a.c.), H145pathQ, Q (a.c.)146pathA, C, D, E, E (a.c.), F, G, H, P, P (a.c.), S, T, T (a.c.)147pathQ, Q (a.c.)148pathA, C, D, E, E (a.c.), F, G, H, P, P (a.c.), S, T, T (a.c.)149pathA, C, D, E, E (a.c.), F, G, H, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)150pathA, C, D, E, E (a.c.), F, G, H, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)151pathA, C, D, E, E (a.c.), F, G, H, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)152pathA, C, D, E, E (a.c.), F, G, H, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)153pathQ (a.c.)154pathA, C, D, E, E (a.c.), F, G, H, P, P (a.c.), Q, S, T, T (a.c.)155pathQ (a.c.)156pathA, C, D, E, E (a.c.), F, G, H, P, P (a.c.), Q, S, T, T (a.c.)157pathA, C, D, E, E (a.c.), F, G, H, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)158pathA, C, D, E, E (a.c.), F, G, H, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)159pathA, C, D, E, E (a.c.), F, G, H, P, P (a.c.), S, T, T (a.c.)160pathQ, Q (a.c.)161pathA, C, D, E, E (a.c.), F, G, H, P, P (a.c.), S, T, T (a.c.)162pathA, C, D, E, E (a.c.), F, G, H, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)163pathA, C, D, E, E (a.c.), F, G, H, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)164pathA, C, D, E, E (a.c.), F, G, H, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)165pathA, C, D, E, E (a.c.), F, G, H, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)166pathA, C, D, E, E (a.c.), F, G, H, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)167pathA, C, D, E, E (a.c.), F, G, H, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)168pathA, C, D, E, E (a.c.), G, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)169pathF, H170pathA, C, D, E, E (a.c.), G, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)171pathA, C, D, E, E (a.c.), F, G, H, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)172pathA, C, D, E, E (a.c.), F, G, H, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)173pathA, B, C, D, E, E (a.c.), F, G, H, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)174pathA, B, C, D, E, E (a.c.), F, G, H, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)175pathA, B, C, D, E, E (a.c.), F, G, H, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)176pathA, B, C, D, E, E (a.c.), F, G, H, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)177pathA, B, C, D, E, E (a.c.), F, G, H, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)178pathA, B, C, D, E, E (a.c.), F, G, H, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)179pathA, B, C, D, E, E (a.c.), F, G, H, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)180pathA, B, C, D, E, E (a.c.), F, G, H, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)181pathQ, Q (a.c.)182pathA, B, C, D, E, E (a.c.), F, G, H, P, P (a.c.), S, T, T (a.c.)183pathQ, Q (a.c.)184pathA, B, C, D, E, E (a.c.), F, G, H, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)185pathA, B, C, D, E, E (a.c.), F, G, H, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)186pathA, B, C, D, E, E (a.c.), F, G, H, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)187pathA, B, C, D, E, E (a.c.), F, G, H, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)188pathA, B, C, D, E, E (a.c.), F, G, H, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)189pathA, B, C, D, E, E (a.c.), F, G, H, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)190pathA, B, C, D, E, E (a.c.), F, G, H, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)191pathA, B, C, D, E, E (a.c.), F, G, H, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)192pathA, B, C, D, E, E (a.c.), F, G, H, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)193pathA, B, C, D, E, E (a.c.), F, G, H, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)194pathA, B, C, D, E, E (a.c.), F, G, H, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)195pathA, B, C, D, E, E (a.c.), F, G, H, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)196pathA, B, C, D, E, E (a.c.), F, G, H, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)197pathA, B, C, D, E, E (a.c.), F, G, H, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)198pathA, B, C, D, E, E (a.c.), F, G, H, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)199pathA, B, C, D, E, E (a.c.), F, G, H, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)200pathA, B, C, D, E, E (a.c.), F, G, H, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)201pathA, B, C, D, E, E (a.c.), F, G, H, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)202pathA, B, C, D, E, E (a.c.), F, G, H, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)203pathA, B, C, D, E, E (a.c.), F, G, H, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)204pathA, B, C, D, E, E (a.c.), F, G, H, Q, Q (a.c.), S, T, T (a.c.)205pathP, P (a.c.)206pathH207pathA, B, C, D, E, E (a.c.), F, G, Q, Q (a.c.), S, T, T (a.c.)208pathK209pathH210pathF211pathA, B, C, D, E, E (a.c.), G, Q, Q (a.c.), S, T, T (a.c.)212pathF213pathF214pathF215pathF216pathF217pathF218pathA, B, C, D, E, E (a.c.), F, G, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)219pathT, T (a.c.)220pathB, P, P (a.c.), S221pathA, C, D, E, E (a.c.), F, G, H, K, Q, Q (a.c.)222pathT, T (a.c.)223pathA, C, D, E, E (a.c.), F, G, H, K, Q, Q (a.c.)224pathA, C, D, E, E (a.c.), F, G, H, K, Q, Q (a.c.), T, T (a.c.)225pathB, P, P (a.c.), S226pathA, C, D, E, E (a.c.), F, G, H, K, Q, Q (a.c.), T, T (a.c.)227pathB, P, P (a.c.), S228pathB, P, P (a.c.), S229pathA, B, C, D, E, E (a.c.), F, G, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)230pathA, B, C, D, E, E (a.c.), F, G, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)231pathA, B, C, D, E, E (a.c.), F, G, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)232pathA, B, C, D, E, E (a.c.), F, G, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)233pathA, B, C, D, E, E (a.c.), F, G, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)234pathA, B, C, D, E, E (a.c.), F, G, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)235pathA, B, C, D, E, E (a.c.), F, G, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)236pathA, B, C, D, E, E (a.c.), F, G, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)237pathA, B, C, D, E, E (a.c.), F, G, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)238pathA, B, C, D, E, E (a.c.), F, G, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)239pathA, B, C, D, E, E (a.c.), F, G, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)240pathA, B, C, D, E, E (a.c.), F, G, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)241pathA, B, C, D, E, E (a.c.), F, G, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)242pathA, B, C, D, E, E (a.c.), F, G, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)243pathA, B, C, D, E, E (a.c.), F, G, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)244pathA, B, C, D, E, E (a.c.), F, G, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)245pathA, B, C, D, E, E (a.c.), F, G, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)246pathA, B, C, D, E, E (a.c.), F, G, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)247pathA, B, C, D, E, E (a.c.), F, G, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)248pathA, B, C, D, E, E (a.c.), F, G, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)249pathA, B, C, D, E, E (a.c.), F, G, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)250pathA, B, C, D, E, E (a.c.), F, G, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)251pathA, B, C, D, E, E (a.c.), F, G, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)252pathA, B, C, D, E, E (a.c.), F, G, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)253pathA, B, C, D, E, E (a.c.), F, G, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)254pathA, B, C, D, E, E (a.c.), F, G, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)255pathA, B, C, D, E, E (a.c.), F, G, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)256pathA, B, C, D, E, E (a.c.), F, G, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)257pathH258pathA, B, C, D, E, E (a.c.), F, G, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)259pathH260pathB, C, D, E, E (a.c.), F, G, H, K, P, P (a.c.), Q, Q (a.c.), S, T261pathA, T (a.c.)262pathB, C, D, E, E (a.c.), F, G, H, K, P, P (a.c.), Q, Q (a.c.), S, T263pathT (a.c.)264pathA265pathB, C, D, E, E (a.c.), F, G, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)266pathA267pathA, B, C, D, E, E (a.c.), F, G, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)268pathA, B, C, D, E, E (a.c.), F, G, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)269pathA, B, C, D, E, E (a.c.), F, G, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)270pathA, B, C, D, E, E (a.c.), F, G, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)271pathA, B, C, D, E, E (a.c.), F, G, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)272pathA, B, C, D, E, E (a.c.), F, G, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)273pathA, B, C, D, E, E (a.c.), F, G, H, K, P, P (a.c.), Q, Q (a.c.), T, T (a.c.)274pathS275pathA, B, C, D, E, E (a.c.), F, G, H, K, P, P (a.c.), Q, Q (a.c.), T, T (a.c.)276pathS277pathP, P (a.c.)278pathA, B, C, D, E, E (a.c.), F, G, H, K, Q, Q (a.c.), T, T (a.c.)279pathP, P (a.c.)280pathA, B, C, D, E, E (a.c.), F, G, H, K, Q, Q (a.c.), S, T, T (a.c.)281pathA, B, C, D, E, E (a.c.), F, G, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)282pathA, B, C, D, E, E (a.c.), F, G, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)283pathA, B, C, D, E, E (a.c.), F, G, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)284pathB, P, P (a.c.), S285pathA, C, D, E, E (a.c.), F, G, H, K, Q, Q (a.c.), T, T (a.c.)286pathB, P, P (a.c.), S287pathA, C, D, E, E (a.c.), F, G, H, K, Q, Q (a.c.), T, T (a.c.)288pathB, P, P (a.c.), S289pathH290pathB, P, P (a.c.), S291pathA, C, D, E, E (a.c.), F, G, K, Q, Q (a.c.)292pathT, T (a.c.)293pathH294pathA, C, D, E, E (a.c.), F, G, K, Q, Q (a.c.)295pathT, T (a.c.)296pathA, B, C, D, E, E (a.c.), F, G, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)297pathA, B, C, D, E, E (a.c.), F, G, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)298pathA, B, C, D, E, E (a.c.), F, G, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)299pathA, B, C, D, E, E (a.c.), F, G, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)300pathA, B, C, D, E, E (a.c.), F, G, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)301pathA, B, C, D, E, E (a.c.), F, G, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)302pathA, B, C, D, E, E (a.c.), F, G, H, K, P, P (a.c.), Q, Q (a.c.), S, T, T (a.c.)303pathA, B, C, P, P (a.c.), S304pathD, E, E (a.c.), F, G, H, K, Q, Q (a.c.), T, T (a.c.)305pathA, B, C, P, P (a.c.), S306pathA, B, C, P, P (a.c.), S307pathA, B, C, P, P (a.c.), S308pathA, B, C, P, P (a.c.), S309pathA, B, C, P, P (a.c.), S310pathA, B, C, P, P (a.c.), S311pathA, B, C, P, P (a.c.), S312pathA, B, C, P, P (a.c.), S313pathA, B, C, P, P (a.c.), S314pathA, B, C, P, P (a.c.), S315pathA, B, C, P, P (a.c.), S316pathA, B, C, P, P (a.c.), S317pathB, P, P (a.c.), S318pathA, C319pathB, P, P (a.c.), S320pathB, P, P (a.c.), S321pathB, P, P (a.c.), S322pathA, B, C, P, P (a.c.), S323pathA, B, C, P, P (a.c.), S324pathA, B, C, P, P (a.c.), S325pathA, B, C, P, P (a.c.), S326pathA, B, C, P, P (a.c.), S327pathA, B, C, P, P (a.c.), S328pathA, B, C, P, P (a.c.), S329pathA, B, C, P, P (a.c.), S330pathA, B, C, P, P (a.c.), S331pathA, B, C, P, P (a.c.), S332pathA, B, C, P, P (a.c.), S333pathA, B, C, P, P (a.c.), S334pathS335pathA, B, C, P, P (a.c.)336pathS337pathA, B, C, P, P (a.c.)338pathA, B, C, P, P (a.c.), S339pathA, B, C, P, P (a.c.), S340pathA, B, C, P, P (a.c.), S341pathA, B, C, P, P (a.c.), S342pathA, B, C, P, P (a.c.), S343pathA, B, C, P, P (a.c.), S344pathA, B, C, P, P (a.c.), S345pathA, B, C, P, P (a.c.), S346pathA, B, C, P, P (a.c.), S347pathA, B, C, P, P (a.c.), S348pathA, B, C, P, P (a.c.), S349pathA, B, C, P, P (a.c.), S350pathA, B, C, P, P (a.c.), S351pathA, B, C, P, P (a.c.), S352pathA, B, C, P, P (a.c.), S353pathA, B, C, P, P (a.c.), S354pathA, B, C, P, P (a.c.), S355pathA, B, C, P, P (a.c.), S356pathA, B, C, P, P (a.c.), S357pathA, B, C, P, P (a.c.), S358pathA, B, C, P, P (a.c.), S359pathA, B, C, P, P (a.c.), S360pathA, B, C, P, P (a.c.), S \ No newline at end of file diff --git a/base/t/text_tradition_parser_collatex.t b/base/t/text_tradition_parser_collatex.t index 3b95ecd..fdc27e0 100644 --- a/base/t/text_tradition_parser_collatex.t +++ b/base/t/text_tradition_parser_collatex.t @@ -13,6 +13,7 @@ binmode STDOUT, ":utf8"; binmode STDERR, ":utf8"; eval { no warnings; binmode $DB::OUT, ":utf8"; }; +# Test a simple CollateX input my $cxfile = 't/data/Collatex-16.xml'; my $t = Text::Tradition->new( 'name' => 'inline', @@ -32,6 +33,32 @@ if( $t ) { is( scalar @related, 1, "Reading links to transposed version" ); is( $related[0]->id, 'n18', "Correct transposition link" ); } + +# Now test a CollateX result with a.c. witnesses + +my $ct = Text::Tradition->new( + name => 'florilegium', + input => 'CollateX', + file => 't/data/florilegium_cx.xml' ); + +is( ref( $ct ), 'Text::Tradition', "Parsed the CollateX input" ); +if( $ct ) { + is( scalar $ct->collation->readings, 309, "Collation has all readings" ); + is( scalar $ct->collation->paths, 361, "Collation has all paths" ); + is( scalar $ct->witnesses, 13, "Collation has correct number of witnesses" ); + + my %layered = ( E => 1, P => 1, Q => 1, T => 1 ); + foreach my $w ( $ct->witnesses ) { + is( $w->is_layered, $layered{$w->sigil}, + "Witness " . $w->sigil . " has correct layered setting" ); + } + + my $pseq = $ct->witness('P')->text; + my $pseqac = $ct->witness('P')->layertext; + is( scalar @$pseq, 264, "Witness P has correct number of tokens" ); + is( scalar @$pseqac, 261, "Witness P (a.c.) has correct number of tokens" ); +} + }