lv.semti.morphology.webservice.MorphoServer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of webservices Show documentation
Show all versions of webservices Show documentation
Webservice API for Tēzaurs.lv and other ailab.lv Latvian computational linguistic tools
/*******************************************************************************
* Copyright 2012, 2013, 2014 Institute of Mathematics and Computer Science, University of Latvia
* Author: Pēteris Paikens
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*******************************************************************************/
package lv.semti.morphology.webservice;
import lv.lumii.ner.NerPipe;
import lv.semti.morphology.corpus.TaggedCorpus;
import org.restlet.*;
import org.restlet.data.*;
import edu.stanford.nlp.ie.AbstractSequenceClassifier;
import edu.stanford.nlp.ie.ner.CMMClassifier;
import edu.stanford.nlp.ling.CoreLabel;
import edu.stanford.nlp.sequences.LVMorphologyReaderAndWriter;
import lv.lumii.expressions.Expression;
import lv.semti.morphology.analyzer.*;
import lv.semti.morphology.attributes.TagSet;
import lv.ailab.domainnames.AlternativeBuilder;
import lv.ailab.lnb.fraktur.Transliterator;
import org.restlet.service.CorsService;
import java.io.InputStream;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Properties;
public class MorphoServer {
static private Analyzer analyzer;
static synchronized Analyzer getAnalyzer() { return MorphoServer.analyzer; };
static synchronized void setAnalyzer(Analyzer analyzer) { MorphoServer.analyzer = analyzer; };
static private Analyzer latgalian_analyzer;
static synchronized Analyzer getLatgalian_analyzer() { return MorphoServer.latgalian_analyzer; }
static synchronized void setLatgalian_analyzer(Analyzer analyzer) { MorphoServer.latgalian_analyzer = analyzer; };
static Transliterator translit;
static TagSet tagset;
// static AbstractSequenceClassifier NERclassifier;
static NerPipe NERclassifier;
static AbstractSequenceClassifier morphoClassifier;
static public AlternativeBuilder alternatives = null;
static public TaggedCorpus corpus;
static public boolean enableTransliterator = false;
static public boolean enableDomeniims = false;
static public boolean enableTezaurs = false;
static public boolean enableCorpus = false;
static public boolean enableTagger = true;
static public boolean enableNERTagger = false;
static public boolean enableTranscription = false;
static public boolean enableLatgalian = true;
static private int port = 8182;
public static void main(String[] args) throws Exception {
for (int i=0; i
© 2015 - 2025 Weber Informatics LLC | Privacy Policy