Class CatalanSynthesizer

  • All Implemented Interfaces:
    org.languagetool.synthesis.Synthesizer

    public class CatalanSynthesizer
    extends org.languagetool.synthesis.BaseSynthesizer
    Catalan word form synthesizer. There are special additions: "DT" tag adds "el, la, l', els, les" according to the gender and the number of the word and the Catalan rules for apostrophation (l'). "DTa" adds "al, a la, a l', als, a les" "DTde" adds "del, de la, de l', dels, de les" "DTper" adds "pel, per la, per l', pels, per les" "DTca" adds "cal, ca la, ca l', cals, ca les"
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static java.util.regex.Pattern pFemNo  
      private static java.util.regex.Pattern pFemYes  
      private static java.util.regex.Pattern pFP  
      private static java.util.regex.Pattern pFS  
      private static java.util.regex.Pattern pMascNo  
      private static java.util.regex.Pattern pMascYes
      Patterns for apostrophation
      private static java.util.regex.Pattern pMP  
      private static java.util.regex.Pattern pMS
      Patterns for number and gender
      private static java.util.regex.Pattern pPrep
      Pattern for previous preposition passed in the postag
      private static java.util.regex.Pattern pVerb
      Patterns verb
      • Fields inherited from class org.languagetool.synthesis.BaseSynthesizer

        possibleTags, SPELLNUMBER_TAG
    • Constructor Summary

      Constructors 
      Constructor Description
      CatalanSynthesizer​(org.languagetool.Language lang)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private void lookupWithEl​(java.lang.String lemma, java.lang.String posTag, java.lang.String prep, java.util.List<java.lang.String> results, morfologik.stemming.IStemmer synthesizer)
      Lookup the inflected forms of a lemma defined by a part-of-speech tag.
      java.lang.String[] synthesize​(org.languagetool.AnalyzedToken token, java.lang.String posTag)  
      java.lang.String[] synthesize​(org.languagetool.AnalyzedToken token, java.lang.String posTag, boolean posTagRegExp)  
      • Methods inherited from class org.languagetool.synthesis.BaseSynthesizer

        createStemmer, getDictionary, getPosTagCorrection, getSpelledNumber, getStemmer, initPossibleTags, lookup
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • pMS

        private static final java.util.regex.Pattern pMS
        Patterns for number and gender
      • pFS

        private static final java.util.regex.Pattern pFS
      • pMP

        private static final java.util.regex.Pattern pMP
      • pFP

        private static final java.util.regex.Pattern pFP
      • pPrep

        private static final java.util.regex.Pattern pPrep
        Pattern for previous preposition passed in the postag
      • pMascYes

        private static final java.util.regex.Pattern pMascYes
        Patterns for apostrophation
      • pMascNo

        private static final java.util.regex.Pattern pMascNo
      • pFemYes

        private static final java.util.regex.Pattern pFemYes
      • pFemNo

        private static final java.util.regex.Pattern pFemNo
      • pVerb

        private static final java.util.regex.Pattern pVerb
        Patterns verb
    • Constructor Detail

      • CatalanSynthesizer

        public CatalanSynthesizer​(org.languagetool.Language lang)
    • Method Detail

      • synthesize

        public java.lang.String[] synthesize​(org.languagetool.AnalyzedToken token,
                                             java.lang.String posTag)
                                      throws java.io.IOException
        Specified by:
        synthesize in interface org.languagetool.synthesis.Synthesizer
        Overrides:
        synthesize in class org.languagetool.synthesis.BaseSynthesizer
        Throws:
        java.io.IOException
      • synthesize

        public java.lang.String[] synthesize​(org.languagetool.AnalyzedToken token,
                                             java.lang.String posTag,
                                             boolean posTagRegExp)
                                      throws java.io.IOException
        Specified by:
        synthesize in interface org.languagetool.synthesis.Synthesizer
        Overrides:
        synthesize in class org.languagetool.synthesis.BaseSynthesizer
        Throws:
        java.io.IOException
      • lookupWithEl

        private void lookupWithEl​(java.lang.String lemma,
                                  java.lang.String posTag,
                                  java.lang.String prep,
                                  java.util.List<java.lang.String> results,
                                  morfologik.stemming.IStemmer synthesizer)
        Lookup the inflected forms of a lemma defined by a part-of-speech tag. Adds determiner "el" properly inflected and preposition (prep. +) det. + noun. / adj.
        Parameters:
        lemma - the lemma to be inflected.
        posTag - the desired part-of-speech tag.
        results - the list to collect the inflected forms.
        synthesizer - the stemmer to use.