Ejemplo n.º 1
0
        private void Init(System.IO.TextReader input, HebMorph.StreamLemmatizer _lemmatizer,
            HebMorph.LemmaFilters.LemmaFilterBase _lemmaFilter, bool AlwaysSaveMarkedOriginal)
        {
			termAtt = AddAttribute <ITermAttribute>();
	        offsetAtt = AddAttribute<IOffsetAttribute>();
	        posIncrAtt = AddAttribute<IPositionIncrementAttribute>();
			typeAtt = AddAttribute <ITypeAttribute>();
            //payAtt = (PayloadAttribute)AddAttribute(typeof(PayloadAttribute));

        	this.input = input;
            this._streamLemmatizer = _lemmatizer;
            this._streamLemmatizer.SetStream(input);
            this.alwaysSaveMarkedOriginal = AlwaysSaveMarkedOriginal;
            this.lemmaFilter = _lemmaFilter;
        }
Ejemplo n.º 2
0
        private void Init(System.IO.TextReader input, HebMorph.StreamLemmatizer _lemmatizer,
                          HebMorph.LemmaFilters.LemmaFilterBase _lemmaFilter, bool AlwaysSaveMarkedOriginal)
        {
            termAtt    = AddAttribute <ITermAttribute>();
            offsetAtt  = AddAttribute <IOffsetAttribute>();
            posIncrAtt = AddAttribute <IPositionIncrementAttribute>();
            typeAtt    = AddAttribute <ITypeAttribute>();
            //payAtt = (PayloadAttribute)AddAttribute(typeof(PayloadAttribute));

            this.input             = input;
            this._streamLemmatizer = _lemmatizer;
            this._streamLemmatizer.SetStream(input);
            this.alwaysSaveMarkedOriginal = AlwaysSaveMarkedOriginal;
            this.lemmaFilter = _lemmaFilter;
        }
        public void Run(string reportPath)
        {
            radix = null;
            radix = new DictRadix<CoverageData>();

            ReportProgress(0, "Initializing hspell...", true);
            lemmatizer = new HebMorph.StreamLemmatizer(HSpellPath, true, false) {TolerateWhenLemmatizingStream = false};

            corpusReader.OnDocument += GotDocument;
            corpusReader.OnProgress += ReportProgress;
            corpusReader.AbortReading = false;
            corpusReader.Read();

            if (!WasAbortSet && !string.IsNullOrEmpty(reportPath))
            {
                SaveReport(reportPath);
            }

            ReportProgress(100, "Finalizing...", false);
        }
Ejemplo n.º 4
0
 public MorphAnalyzer(string HSpellDataFilesPath)
     : base()
 {
     hebMorphLemmatizer = new HebMorph.StreamLemmatizer();
     hebMorphLemmatizer.InitFromHSpellFolder(HSpellDataFilesPath, true, false);
 }
Ejemplo n.º 5
0
 public MorphAnalyzer(HebMorph.StreamLemmatizer hml)
     : base()
 {
     hebMorphLemmatizer = hml;
 }
Ejemplo n.º 6
0
 public StreamLemmasFilter(System.IO.TextReader input, HebMorph.StreamLemmatizer _lemmatizer,
                           HebMorph.LemmaFilters.LemmaFilterBase _lemmaFilter)
 //: base(input) <- converts to CharStream, and causes issues due to a call to ReadToEnd in ctor
 {
     Init(input, _lemmatizer, _lemmaFilter, false);
 }
Ejemplo n.º 7
0
 public StreamLemmasFilter(System.IO.TextReader input, HebMorph.StreamLemmatizer _lemmatizer,
                           HebMorph.LemmaFilters.LemmaFilterBase _lemmaFilter, bool AlwaysSaveMarkedOriginal)
 //: base(input) <- converts to CharStream, and causes issues due to a call to ReadToEnd in ctor
 {
     Init(input, _lemmatizer, _lemmaFilter, AlwaysSaveMarkedOriginal);
 }
Ejemplo n.º 8
0
 public MorphAnalyzer(MorphAnalyzer other)
     : base()
 {
     hebMorphLemmatizer = other.hebMorphLemmatizer;
 }