All Downloads are FREE. Search and download functionalities are using the official Maven repository.

resources.grammar.all.jape Maven / Gradle / Ivy

There is a newer version: 8.6
Show newest version
/*
*  trained.jape
*
* Copyright (c) 1998-2001, 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, 10 Sep 2001
* 
*  $Id $
*/


Phase:	All
Input: Lookup Token
Options: control = appelt debug = false

Rule: DateGaz
Priority: 100

(
 ({Lookup.majorType == date}|
 {Lookup.majorType == time})+
 ):tag
 -->
 :tag.Date = {kind = gaz, rule = DateGaz}

 Rule: DateKeySimple
 Priority: 50
 (
  {Lookup.majorType == date_key}
  {Token.kind == word}
 ):tag
 -->
 :tag.Date = {rule = DateKeySimple}
 

 
/*Rule: Money
Priority:300
(
 {Lookup.majorType == Money, Lookup.minorType == inferred}
 ({Lookup.majorType == Money, Lookup.minorType == inferred})*
 ):tag
 -->
:tag.Money = {kind = inferred, rule = "MoneyInferred"}
*/

Rule: Percent
Priority:300
(
 ({Lookup.majorType == Percent}|
 {Token.string == "%"})
 ({Lookup.majorType == number}|
 {Token.kind == number})+
 ):tag
 -->
:tag.Percent = {rule = "Percent"}


/*
Rule: LocGaz
Priority:150
(
 {Lookup.majorType == location, Lookup.minorType == other}|
 {Lookup.majorType == location, Lookup.minorType == mountain}|
 {Lookup.majorType == location, Lookup.minorType == river}
 ):tag
 -->
:tag.Location = {kind = gaz, rule = "LocGaz"}
*/

Rule:GpeGaz
Priority:200
(
 {Lookup.majorType == location, Lookup.minorType == city}|
 {Lookup.majorType == location, Lookup.minorType == country}
 ):tag
 -->
 :tag.Gpe = {kind = gaz, rule = "GpeGaz"}
 


Rule: OrgGaz
Priority:75

(
 {Lookup.majorType == organisation}
 ):loc
 -->
:loc.Organization  = {kind = gaz, rule = "OrgGaz"}

/*Rule:Surname
Priority: 150
(
(
 {Lookup.majorType == person}
)+
{Token}
)
:tag
-->
:tag.Person = {rule= Surname}
*/

Rule: FirstName
Priority:50

(
( 
 ({Lookup.minorType == male}|{Lookup.minorType == female})+
 // ({Token})
 )
 ):tag
 -->
:tag.Person  = {kind = gaz, rule = "FirstnameOnly"}

/*Rule: PersonGaz
Priority:150

(
(
 ({Lookup.minorType == surname})
 ({Lookup.minorType == male}|{Lookup.minorType == female})
 )+
 ):tag
 -->
:tag.Person  = {kind = gaz, rule = "PersonGaz"}
*/


Rule: NotPerson
Priority:200

(
 ({Lookup.majorType == person})+
 {Lookup.majorType == article}
):tag
-->
{}
 







© 2015 - 2024 Weber Informatics LLC | Privacy Policy