From: Tara L Andrews Date: Sat, 2 Jun 2012 14:54:15 +0000 (+0200) Subject: introspect for morphology values; include these in help; make sure Perseus results... X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=cc86fa11ccfa3c352cd20830538a2e85fbfc2712;p=scpubgit%2Fstemmaweb.git introspect for morphology values; include these in help; make sure Perseus results are unique --- diff --git a/lib/stemmaweb/Controller/Relation.pm b/lib/stemmaweb/Controller/Relation.pm index 38cae7e..8ec7673 100644 --- a/lib/stemmaweb/Controller/Relation.pm +++ b/lib/stemmaweb/Controller/Relation.pm @@ -1,5 +1,6 @@ package stemmaweb::Controller::Relation; use Moose; +use Module::Load; use namespace::autoclean; use TryCatch; @@ -29,19 +30,6 @@ sub index :Path :Args(0) { $c->stash->{'template'} = 'relate.tt'; } -=head2 help - - GET relation/help - -Returns the help window HTML. - -=cut - -sub help :Local :Args(0) { - my( $self, $c ) = @_; - $c->stash->{'template'} = 'relatehelp.tt'; -} - =head2 definitions GET relation/definitions @@ -134,9 +122,38 @@ sub main :Chained('text') :PathPart('') :Args(0) { $c->stash->{'startseg'} = $startseg if defined $startseg; $c->stash->{'svg_string'} = $svg_str; $c->stash->{'text_title'} = $tradition->name; + $c->stash->{'text_lang'} = $tradition->language; $c->stash->{'template'} = 'relate.tt'; } +=head2 help + + GET relation/help/$language + +Returns the help window HTML. + +=cut + +sub help :Local :Args(1) { + my( $self, $c, $lang ) = @_; + # Display the morphological help for the language if it is defined. + if( $lang && $lang ne 'Default' ) { + my $mod = 'Text::Tradition::Language::' . $lang; + try { + load( $mod ); + } catch { + $c->log->debug("Warning: could not load $mod"); + } + my $has_mod = $mod->can('morphology_tags'); + $DB::single = 1; + if( $has_mod ) { + my $tagset = &$has_mod; + $c->stash->{'tagset'} = $tagset; + } + } + $c->stash->{'template'} = 'relatehelp.tt'; +} + =head2 relationships GET relation/$textid/relationships diff --git a/root/src/relate.tt b/root/src/relate.tt index 2aa7d3a..3e35dc7 100644 --- a/root/src/relate.tt +++ b/root/src/relate.tt @@ -13,7 +13,7 @@ $(document).ready(function () {

Relationship mapper

[% text_title %]

diff --git a/root/src/relatehelp.tt b/root/src/relatehelp.tt index 607f22d..9995d28 100644 --- a/root/src/relatehelp.tt +++ b/root/src/relatehelp.tt @@ -11,7 +11,7 @@

The premise of the tool is that, once a set of texts has been collated, there will be a need to chart the relationships between the variants—are they substantially the same word? Different words meaning the same thing? Is one an orthographic variant of the other that should be excluded from any eventual apparatus?

-

Instructions for use

+

Making relationships between words

The tool itself is an interface for allowing these relationships to be declared. The collation is presented as a variant graph running from left to right. In a variant graph, each node is a reading, and each witness takes a single path through the readings from beginning to end. When readings appear vertically aligned with each other, it is an indication that they are variant readings, occurring at the same point in the text. @@ -35,6 +35,41 @@

The relationships are displayed as colored paths between readings; while in 'edit' mode, clicking on a relationship path will display the information associated with it, and give the user an option to delete it. Deletion of a 'global' relationship will remove that relationship throughout the graph. When you are ready to move elsewhere in the graph, click the 'hand' icon to return to select mode.

-

Please note that this tool is known to work with recent versions of Firefox (e.g. 8, 9, 10); it is known not to work with Safari and Chrome.

+[% IF language != 'NONE' %] +

Adding [% language %] morphological information to readings

+

It is also possible to add morphological information to the readings in this text (that is, lemma and morphological tagging). Double click on any reading to bring up the morphology info. The options therein are:

+ + + +

If initial lemmatization has been performed on the text, a number of readings may appear in yellow rather than green; this means that there are multiple possible morphologies for the reading in question. Double click on the reading to select and save the correct morphology.

+[% END -%] [% PROCESS footer.tt %] \ No newline at end of file