Tabnine Logo
ConstraintsGrammar.Parse
Code IndexAdd Tabnine to your IDE (free)

How to use
Parse
method
in
de.tudarmstadt.ukp.clarin.webanno.constraints.grammar.ConstraintsGrammar

Best Java code snippets using de.tudarmstadt.ukp.clarin.webanno.constraints.grammar.ConstraintsGrammar.Parse (Showing top 20 results out of 315)

origin: webanno/webanno

@Test
public void test1()
  throws Exception
{
  ConstraintsGrammar parser = new ConstraintsGrammar(new FileInputStream(
      "src/test/resources/rules/1.rules"));
  Parse p = parser.Parse();
}
origin: webanno/webanno

@Test
public void test3()
  throws Exception
{
  ConstraintsGrammar parser = new ConstraintsGrammar(new FileInputStream(
      "src/test/resources/rules/3.rules"));
  Parse p = parser.Parse();
}
origin: webanno/webanno

@Test
public void test4()
  throws Exception
{
  ConstraintsGrammar parser = new ConstraintsGrammar(new FileInputStream(
      "src/test/resources/rules/4.rules"));
  Parse p = parser.Parse();
}
origin: webanno/webanno

@Test
public void test7()
  throws Exception
{
  ConstraintsGrammar parser = new ConstraintsGrammar(new FileInputStream(
      "src/test/resources/rules/7.rules"));
  Parse p = parser.Parse();
}
origin: webanno/webanno

@Test
public void test2()
  throws Exception
{
  ConstraintsGrammar parser = new ConstraintsGrammar(new FileInputStream(
      "src/test/resources/rules/2.rules"));
  Parse p = parser.Parse();
}
origin: webanno/webanno

@Test
public void test6()
  throws Exception
{
  ConstraintsGrammar parser = new ConstraintsGrammar(new FileInputStream(
      "src/test/resources/rules/6.rules"));
  Parse p = parser.Parse();
}
origin: webanno/webanno

@Test
public void test8()
  throws Exception
{
  ConstraintsGrammar parser = new ConstraintsGrammar(new FileInputStream(
      "src/test/resources/rules/8.rules"));
  Parse p = parser.Parse();
}
origin: webanno/webanno

@Test
public void test5()
  throws Exception
{
  ConstraintsGrammar parser = new ConstraintsGrammar(new FileInputStream(
      "src/test/resources/rules/5.rules"));
  Parse p = parser.Parse();
}
origin: webanno/webanno

@Test
public void test()
  throws Exception
{
  ConstraintsGrammar parser = new ConstraintsGrammar(new FileInputStream(
      "src/test/resources/rules/6.rules"));
  Parse p = parser.Parse();
  List<Scope> scopes = new ArrayList<>();
  p.accept(new ScopeVisitor(), scopes);
  for (Scope scope : scopes) {
    System.out.printf("%s %n", scope);
  }
}
origin: webanno/webanno

@Test
public void test()
  throws Exception
{
  ConstraintsGrammar parser = new ConstraintsGrammar(new FileInputStream(
      "src/test/resources/rules/6.rules"));
  Parse p = parser.Parse();
  List<Rule> rules = new ArrayList<>();
  p.accept(new RuleVisitor(), rules);
  for (Rule rule : rules) {
    System.out.printf("%s %n", rule);
  }
}
origin: webanno/webanno

@Test
public void test()
  throws Exception
{
  ConstraintsGrammar parser = new ConstraintsGrammar(new FileInputStream(
      "src/test/resources/rules/6.rules"));
  Parse p = parser.Parse();
  ParsedConstraints constraints = p.accept(new ParserVisitor());
  System.out.printf("%s %n", constraints);
}
origin: webanno/webanno

  @Test
  public void test()
    throws Exception
  {
    ConstraintsGrammar parser = new ConstraintsGrammar(new FileInputStream(
        "src/test/resources/rules/6.rules"));
    Parse p = parser.Parse();

    List<Restriction> restrictions = new ArrayList<>();
    p.accept(new RestrictionVisitor(), restrictions);

    for (Restriction res : restrictions) {
      System.out.printf("%s %n", res);
    }
  }
}
origin: webanno/webanno

  @Test
  public void test()
    throws Exception
  {
    ConstraintsGrammar parser = new ConstraintsGrammar(new FileInputStream(
        "src/test/resources/rules/6.rules"));
    Parse p = parser.Parse();

    Map<String, String> imports = new LinkedHashMap<>();
    p.accept(new ImportVisitor(), imports);

    for (Entry<String, String> e : imports.entrySet()) {
      System.out.printf("[%s] is short for [%s]%n", e.getKey(), e.getValue());
    }

    assertEquals("de.tudarmstadt.ukp.dkpro.core.api.segmentation.type.Lemma",
        imports.get("Lemma"));
  }
}
origin: webanno/webanno

  @Test
  public void test()
    throws Exception
  {
    ConstraintsGrammar parser = new ConstraintsGrammar(new FileInputStream(
        "src/test/resources/rules/6.rules"));
    Parse p = parser.Parse();

    List<Condition> conditions = new ArrayList<>();
    p.accept(new ConditionVisitor(), conditions);

    for (Condition cond : conditions) {
      System.out.printf("%s %n", cond);
    }
  }
}
origin: webanno/webanno

Parse p = parser.Parse();
origin: webanno/webanno

@Test
public void testSimpleSymbolicRules()
  throws Exception
{
  ConstraintsGrammar parser = new ConstraintsGrammar(new FileInputStream(
      "src/test/resources/rules/symbolic1.rules"));
  Parse p = parser.Parse();
  ParsedConstraints constraints = p.accept(new ParserVisitor());
  JCas jcas = JCasFactory.createJCas();
  CollectionReader reader = createReader(Conll2006Reader.class,
      Conll2006Reader.PARAM_SOURCE_LOCATION, "src/test/resources/text/1.conll");
  
  reader.getNext(jcas.getCas());
  POS pos = new POS(jcas, 8, 9);
  pos.setPosValue("pronoun");
  pos.addToIndexes();
  
  Evaluator constraintsEvaluator = new ValuesGenerator();
  Lemma lemma = select(jcas, Lemma.class).iterator().next();
  
  List<PossibleValue> possibleValues = constraintsEvaluator.generatePossibleValues(lemma,
      "value", constraints);
  List<PossibleValue> expectedOutput = new ArrayList<>();
  expectedOutput.add(new PossibleValue("good", true));
  assertEquals(expectedOutput, possibleValues);
}
origin: webanno/webanno

@Test
public void testSimpleFeature()
  throws Exception
{
  ConstraintsGrammar parser = new ConstraintsGrammar(new FileInputStream(
      "src/test/resources/rules/9.rules"));
  Parse p = parser.Parse();
  ParsedConstraints constraints = p.accept(new ParserVisitor());
  JCas jcas = JCasFactory.createJCas();
  jcas.setDocumentText("is");
  Lemma lemma = new Lemma(jcas, 0, 2);
  lemma.setValue("be");
  lemma.addToIndexes();
  Evaluator constraintsEvaluator = new ValuesGenerator();
  List<PossibleValue> possibleValues = constraintsEvaluator.generatePossibleValues(lemma,
      "value", constraints);
  List<PossibleValue> expectedOutput = new LinkedList<>();
  expectedOutput.add(new PossibleValue("be", true));
  assertEquals(expectedOutput, possibleValues);
}
origin: webanno/webanno

Parse p = parser.Parse();
ParsedConstraints constraints = p.accept(new ParserVisitor());
origin: webanno/webanno

Parse p = parser.Parse();
ParsedConstraints constraints = p.accept(new ParserVisitor());
origin: webanno/webanno

Parse p = parser.Parse();
de.tudarmstadt.ukp.clarin.webanno.constraints.grammarConstraintsGrammarParse

Popular methods of ConstraintsGrammar

  • <init>
    Constructor.
  • Condition
  • Conditions
  • ImportDeclaration
  • Imports
  • Path
  • ReInit
    Reinitialise.
  • Restriction
  • Restrictions
  • RuleDeclaration
  • Rules
  • ScopedDeclarations
  • Rules,
  • ScopedDeclarations,
  • generateParseException,
  • jj_2_1,
  • jj_2_10,
  • jj_2_11,
  • jj_2_2,
  • jj_2_3,
  • jj_2_4

Popular in Java

  • Making http requests using okhttp
  • getSystemService (Context)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • getSupportFragmentManager (FragmentActivity)
  • PrintStream (java.io)
    Fake signature of an existing Java class.
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • NoSuchElementException (java.util)
    Thrown when trying to retrieve an element past the end of an Enumeration or Iterator.
  • Set (java.util)
    A Set is a data structure which does not allow duplicate elements.
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now