From 1857eefb96481ac2bd3b20bf1eb79d2e4171fd1a Mon Sep 17 00:00:00 2001 From: Peter von Kaehne Date: Thu, 26 Oct 2017 08:36:26 +0000 Subject: corrected handling of strongs and morph markup git-svn-id: https://www.crosswire.org/svn/sword-tools/trunk@515 07627401-56e2-0310-80f4-f8cd0041bdcd --- modules/conf/confmaker.pl | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/modules/conf/confmaker.pl b/modules/conf/confmaker.pl index f5e6f23..355e7e1 100755 --- a/modules/conf/confmaker.pl +++ b/modules/conf/confmaker.pl @@ -136,7 +136,7 @@ if ((length($language)>0) && (length($doc_lang)==0)) { ##GlobalOptionsFilter - prepare my @doc_features = ('title', 'note', 'reference', 'q', 'figure', 'rdg'); -my @word_features = ('lemma', 'gloss', 'morph',); +my @word_features = ('lemma', 'strong', 'gloss', 'morph',); my @char_features = ('Hebrew Vowel Points', 'Arabic Vowel Points', 'Hebrew Cantillation', 'Greek Accents'); my %doc_filters = ( 'title' => "OSISHeadings", @@ -154,7 +154,7 @@ my %doc_filters = ( 'title' => "OSISHeadings", ); -my %doc_feature = ( 'lemma' => 'StrongsNumbers', +my %doc_feature = ( 'strong' => 'StrongsNumbers', 'figure' => 'Images', 'p' => 'NoParagraphs', @@ -163,7 +163,7 @@ my %doc_feature = ( 'lemma' => 'StrongsNumbers', my %diacritics = ( 'Hebrew Vowel Points' => "UTF8HebrewPoints", 'Arabic Vowel Points' => 'UTF8ArabicPoints', 'Hebrew Cantillation' => 'UTF8Cantillation', -# 'Greek Accents' => 'UTF8GreekAccents', + 'Greek Accents' => 'UTF8GreekAccents', ); @@ -189,6 +189,20 @@ foreach my $f(@word_features) { } +if ($doc_has_feature{'lemma'}) { + foreach my $e(@elements) { + if ($e->hasAttribute('lemma')) { + my $lemma = $e->getAttribute('lemma'); + + if (index(lc($lemma), 'strong') != -1) { + $doc_has_feature{'strong'}=true; + last; + } + } + } +} + + my @paragraphs = $doc->getElementsByTagName('p'); if (@paragraphs==0) {$doc_has_feature{'p'}=true}; @@ -230,7 +244,6 @@ foreach (@word_features) { } foreach $filter(@char_features) { - my $tmp = new Sword::SWBuf($hs->parse($doc->toString())); $manager->filterText($filter, $tmp); -- cgit