Changeset 301

Show
Ignore:
Timestamp:
06/22/08 20:32:07 (7 months ago)
Author:
chris
Message:

Change names of Hebrew morphological features as requested by Nicolai.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • lex/trunk/src/com/qwirx/lex/morph/HebrewMorphemeGenerator.java

    r298 r301  
    182182            } 
    183183             
    184             handler.convert("graphical_preformative", false, tense, "V/TNS"); 
     184            handler.convert("graphical_preformative", false, tense, "V/TAM"); 
    185185             
    186186            // String stemNum = word.getEMdFValue("verbal_stem").toString(); 
     
    188188                stem, "V/STM"); 
    189189             
    190             handler.convert("graphical_lexeme", false, gloss, "V/LEX"); 
     190            handler.convert("graphical_lexeme", false, gloss, "V/NUC"); 
    191191             
    192192            handler.convert("graphical_verbal_ending", false, 
    193                 verbEnding, "V/PGN"); 
    194  
    195             handler.convert("graphical_pron_suffix", true, suffixGloss, "V/SFX"); 
     193                verbEnding, "AG/PSA"); 
     194 
     195            handler.convert("graphical_pron_suffix", true, suffixGloss, 
     196                "PRON/DCA"); 
    196197        } 
    197198        else if (psp.equals("noun") 
    198199            || psp.equals("proper_noun")) 
    199200        { 
    200             String type = "HEAD/NCOM"; 
     201            String type = "N/NUC"; 
    201202             
    202203            if (psp.equals("proper_noun")) 
     
    207208            handler.convert("graphical_lexeme", false, gloss, type); 
    208209            handler.convert("graphical_nominal_ending", false, 
    209                 nounEnding, "MARK/N"); 
    210             handler.convert("graphical_pron_suffix", true, suffixGloss, "SFX/N"); 
     210                nounEnding, "N/PNS"); 
     211            handler.convert("graphical_pron_suffix", true, suffixGloss, 
     212                "N/POS"); 
    211213        } 
    212214        else if (psp.equals("none")) 
  • lex/trunk/test/com/qwirx/lex/HebrewConverterTest.java

    r299 r301  
    121121        assertEquals("PERF-", columns.get(3)[1]); 
    122122    } 
     123 
     124    public void testMorphemeGeneration() throws Exception 
     125    { 
     126        StringBuffer hebrewText = new StringBuffer(); 
     127        List<String[]> columns = new ArrayList<String[]>(); 
     128         
     129        Sheaf sheaf = m_Emdros.getSheaf 
     130        ( 
     131            "SELECT ALL OBJECTS IN " + 
     132            "{" + m_Emdros.getMinM() + "-" + m_Emdros.getMaxM() + "} " + 
     133            "WHERE [clause self = 28951 " + // Gen 2,24(b) 
     134            "       GET logical_struct_id, logical_structure "+ 
     135            "        [phrase GET phrase_type, phrase_function, argument_name, "+ 
     136            "                    type_id, macrorole_number "+ 
     137            "          [word GET lexeme, phrase_dependent_part_of_speech, " + 
     138            "                    tense, stem, wordnet_gloss, wordnet_synset, " + 
     139            "                    graphical_preformative, " + 
     140            "                    graphical_locative, " + 
     141            "                    graphical_lexeme, " + 
     142            "                    graphical_pron_suffix, " + 
     143            "                    graphical_verbal_ending, " + 
     144            "                    graphical_root_formation, " + 
     145            "                    graphical_nominal_ending, " + 
     146            "                    person, number, gender, state, " + 
     147            "                    surface_consonants, " + 
     148            "                    suffix_person, suffix_number, suffix_gender " + 
     149            "          ]"+ 
     150            "        ]"+ 
     151            "      ]" 
     152        ); 
     153 
     154        MatchedObject clause = null; 
     155        SheafConstIterator sci = sheaf.const_iterator(); 
     156        if (sci.hasNext())  
     157        { 
     158            Straw straw = sci.next(); 
     159            StrawConstIterator swci = straw.const_iterator(); 
     160            if (swci.hasNext())  
     161            { 
     162                clause = swci.next(); 
     163            } 
     164        } 
     165 
     166        SheafConstIterator phrases = clause.getSheaf().const_iterator(); 
     167        List<MorphEdge> morphEdges = new ArrayList<MorphEdge>(); 
     168        boolean isFirstWord = true; 
     169        HebrewMorphemeGenerator generator = new HebrewMorphemeGenerator(); 
     170 
     171        while (phrases.hasNext())  
     172        { 
     173            MatchedObject phrase = 
     174                phrases.next().const_iterator().next(); 
     175 
     176            SheafConstIterator words = phrase.getSheaf().const_iterator(); 
     177             
     178            while (words.hasNext())  
     179            { 
     180                MatchedObject word = words.next().const_iterator().next(); 
     181 
     182                HebrewGlossTableGeneratingMorphemeHandler hmh =  
     183                    new HebrewGlossTableGeneratingMorphemeHandler( 
     184                        columns, word, hebrewText, 
     185                        morphEdges, isFirstWord, 
     186                        !phrases.hasNext() && !words.hasNext()); 
     187                     
     188                generator.parse(word, hmh, true, m_SQL); 
     189            } 
     190        } 
     191 
     192        assertEquals("CONJ",     morphEdges.get(0).symbol()); 
     193        assertEquals("V/TAM",    morphEdges.get(1).symbol()); 
     194        assertEquals("V/STM",    morphEdges.get(2).symbol()); 
     195        assertEquals("V/NUC",    morphEdges.get(3).symbol()); 
     196        assertEquals("AG/PSA",   morphEdges.get(4).symbol()); 
     197        assertEquals("PRON/DCA", morphEdges.get(5).symbol()); 
     198        assertEquals("P",        morphEdges.get(6).symbol()); 
     199        assertEquals("N/NUC",    morphEdges.get(7).symbol()); 
     200        assertEquals("N/PNS",    morphEdges.get(8).symbol()); 
     201        assertEquals("N/POS",    morphEdges.get(9).symbol()); 
     202    } 
    123203     
    124204    public static void main(String[] args)