gate.plugins.Lang_French.grammar.loc_context.jape Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gate-extraction Show documentation
Show all versions of gate-extraction Show documentation
Gate based component, that can process the Text units to extract informations using Gate's tools (such as grammars, gazetteers, tokenizer or POS Taggers).
This project contains two versions, a simple component and webservice one.
/*
* loc_context.jape
*
* Copyright (c) 1998-2004, The University of Sheffield.
*
* This file is part of GATE (see http://gate.ac.uk/), and is free
* software, licenced under the GNU Library General Public License,
* Version 2, June 1991 (in the distribution as file licence.html,
* and also available at http://gate.ac.uk/gate/licence.html).
*
* Diana Maynard, 02 Aug 2001
*
* $Id: loc_context.jape 11883 2009-11-03 16:27:32Z markagreenwood $
*/
Phase: Loc_Context
Input: Unknown Token Location
Options: control = appelt
Rule: LocConjLoc1
Priority: 10
(
{Unknown.kind == PN}
):loc
(
{Token.category == CC}
({Token.category == DT}
)?
{Location}
)
-->
{
gate.AnnotationSet loc = (gate.AnnotationSet) bindings.get("loc");
gate.FeatureMap features = Factory.newFeatureMap();
features.put("rule ", "LocConjLoc1");
outputAS.add(loc.firstNode(), loc.lastNode(), "Location",
features);
outputAS.removeAll(loc);
}
Rule: LocConjLoc2
Priority: 10
(
{Location}
{Token.category == CC}
({Token.category == DT}
)?
)
(
{Unknown.kind == PN}
):loc
-->
{
gate.AnnotationSet loc = (gate.AnnotationSet) bindings.get("loc");
gate.FeatureMap features = Factory.newFeatureMap();
features.put("rule ", "LocConjLoc2");
outputAS.add(loc.firstNode(), loc.lastNode(), "Location",
features);
outputAS.removeAll(loc);
}
Rule: UnknownLocRegion
Priority: 50
(
({Token.string == "at"}|
{Token.string == "in"}
)
)
(
{Unknown}
):loc
(
{Token.string == ","}
{Location.kind == region}
)
-->
:loc.Location = {rule = "UnknownLocRegion"}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy