text
stringlengths 22
301k
|
---|
@CODE
# Initialize next break point line.
#var("break", 0)
G("break") = 0;
@@CODE
@PATH _ROOT _experienceZone
# If anchor is a breakpoint, starts a new instance.
@CHECK
if (
G("break") && G("break") == N("lineno", 1)
)
succeed();
fail();
#GeqN("break", "lineno", 1);
@POST
# Compute the next breakpoint line.
# Store it in global variable.
if (N("next anchor", 1) # If there is a next anchor.
&& N("lineno", 1)) # and a line number.
{
N("tmp") = N("next anchor") - N("lineno") - 1;
if (N("tmp") % 2) # If odd num of lines between anchors.
N("tmp") = (N("tmp") / 2) + X("noprestuff") + 1;
else
N("tmp") = N("tmp") / 2 + 1;
G("break") = N("lineno") + N("tmp");
}
# else breakpoint won't be matched.
single();
@RULES
_expStart <- _ANCHOR [s] @@
# Anchor that is not a break point.
@POST
# Compute the next breakpoint line.
# Store it in global variable.
if (N("next anchor", 1) # If there is a next anchor.
&& N("lineno", 1)) # and a line number.
{
N("tmp") = N("next anchor") - N("lineno") - 1;
if (N("tmp") % 2) # If odd num of lines between anchors.
N("tmp") = (N("tmp") / 2) + X("noprestuff") + 1;
else
N("tmp") = N("tmp") / 2 + 1;
G("break") = N("lineno") + N("tmp");
}
# else breakpoint won't be matched.
# noop()
@RULES
_xNIL <- _ANCHOR [s] @@
# A line that matches the breakpoint line number.
@CHECK
if (
G("break") && G("break") == N("lineno", 1)
)
succeed();
fail();
# GeqN("break", "lineno", 1);
@RULES
_expStart <- _LINE [s] @@
|
@NODES _enum
@POST
noop();
@RULES
_xNIL <-
_itemMarker ### (1)
_xWILD [group="_itemNum"] ### (2)
_itemMarker [lookahead] ### (3)
@@
_xNIL <-
_itemMarker ### (1)
_xWILD [group="_itemNum"] ### (2)
_endEnum ### (3)
@@
_xNIL <-
_itemMarker ### (1)
_xWILD [group="_itemNum"] ### (2)
_xEND ### (3)
@@
|
@NODES _LINE
@PRE
<2,2> length(1);
@POST
L("text") = N("$text");
if (L("text") != "(") {
L("bullet") = getconcept(G("format"),"bullet");
L("con") = AddUniqueCon(L("bullet"),L("text"));
IncrementCount(L("con"),"count");
single();
}
@RULES
_bullet <-
_xSTART ### (1)
_xWILD [one match=(_xCTRL _xPUNCT) fail=(\()] ### (2)
@@
|
# Look only at cap phrases within lines within experience zones.
@PATH _ROOT _experienceZone _LINE _Caps
# Job title root word (eg, "programmer") at the end of phrase
# gets a bonus.
@POST
++X("jobtitleroots"); # Bump in _Caps context node.
if (N("$end")) # If last node in caps phrase.
++X("end jobtitleroot"); # Bonus. Last word in cap phrase.
# noop() # Implicit.
@RULES
_xNIL <- _jobTitleRoot [s] @@
@POST
++X("companyroots");
if (N("$end"))
++X("end companyroot");
@RULES
_xNIL <- _companyRoot [s] @@
# Handling schools separately. #
# _xNIL <- _CompleteSchoolName [s] @@
@POST
++X("companymodroots");
if (N("$end"))
++X("end companymodroot");
@RULES
_xNIL <- _companyModroot [s] @@
@POST
++X("companymods");
@RULES
_xNIL <- _companyMod [s] @@
|
@NODES _ROOT
@PRE
<1,1> var("code");
@POST
if (N("type", 1) == "diagnosis") {
L("con") = AddUniqueCon(G("diagnosis_codes"), N("code", 1));
addstrval(L("con"), "keywords", strclean(N("$treetext", 1)));
}
else if (N("type", 1) == "procedure") {
L("con") = AddUniqueCon(G("procedure_codes"), N("code", 1));
L("attr") = addattr(L("con"), "keywords");
addstrval(L("con"), "keywords", strclean(N("$treetext", 1)));
}
noop();
@RULES
_xNIL <-
_term
@@
|
@NODES _LINE
@PRE
<1,1> cap();
<3,3> cap();
@RULES
# Ex: Digital\_Equipment
_companyPhrase [layer=(_Caps )] <- Digital [s] _xWHITE [star s] Equipment [s] @@
@PRE
<1,1> cap();
@RULES
# Ex: Canon
_companyPhrase [layer=(_Caps )] <- Canon [s] @@
# Ex: Fujitsi
_companyPhrase [layer=(_Caps )] <- Fujitsi [s] @@
# Ex: Mitsubishi
_companyPhrase [layer=(_Caps )] <- Mitsubishi [s] @@
# Ex: Honda
_companyPhrase [layer=(_Caps )] <- Honda [s] @@
# Ex: Toyota
_companyPhrase [layer=(_Caps )] <- Toyota [s] @@
# Ex: Suzuki
_companyPhrase [layer=(_Caps )] <- Suzuki [s] @@
# Ex: Lloyds
_companyPhrase [layer=(_Caps )] <- Lloyds [s] @@
# Ex: Nokia
_companyPhrase [layer=(_Caps )] <- Nokia [s] @@
# Ex: Ericsson
_companyPhrase [layer=(_Caps )] <- Ericsson [s] @@
@PRE
<2,2> cap();
@RULES
# Ex: 3Com
_companyPhrase [layer=(_Caps )] <- 3 [s] Com [s] @@
# Ex: 3M
_companyPhrase [layer=(_Caps )] <- 3 [s] M [s] @@
@PRE
<1,1> cap();
<3,3> cap();
@RULES
# Ex: A&P
_companyPhrase [layer=(_Caps )] <- A [s] \& [s] P [s] @@
@PRE
<1,1> cap();
@RULES
# Ex: Abbott
_companyPhrase [layer=(_Caps )] <- Abbott [s] @@
# Ex: ABC
_companyPhrase [layer=(_Caps )] <- ABC [s] @@
# Ex: Ace
_companyPhrase [layer=(_Caps )] <- Ace [s] @@
# Ex: Adecco
_companyPhrase [layer=(_Caps )] <- Adecco [s] @@
# Ex: Aerospace
_companyPhrase [layer=(_Caps )] <- Aerospace [s] @@
# Ex: Aerospatiale
_companyPhrase [layer=(_Caps )] <- Aerospatiale [s] @@
# Ex: Aetna
_companyPhrase [layer=(_Caps )] <- Aetna [s] @@
# Ex: AFLAC
_companyPhrase [layer=(_Caps )] <- AFLAC [s] @@
# Ex: AGCO
_companyPhrase [layer=(_Caps )] <- AGCO [s] @@
# Ex: Airborne
_companyPhrase [layer=(_Caps )] <- Airborne [s] @@
# Ex: Airlines
_companyPhrase [layer=(_Caps )] <- Airlines [s] @@
# Ex: AirTouch
_companyPhrase [layer=(_Caps )] <- AirTouch [s] @@
# Ex: Airways
_companyPhrase [layer=(_Caps )] <- Airways [s] @@
# Ex: Albertson's
_companyPhrase [layer=(_Caps )] <- Albertson [s] \' [s] s [s] @@
# Ex: Alcoa
_companyPhrase [layer=(_Caps )] <- Alcoa [s] @@
# Ex: Allegheny
_companyPhrase [layer=(_Caps )] <- Allegheny [s] @@
# Ex: Allegiance
_companyPhrase [layer=(_Caps )] <- Allegiance [s] @@
# Ex: AlliedSignal
_companyPhrase [layer=(_Caps )] <- AlliedSignal [s] @@
# Ex: Allmerica
_companyPhrase [layer=(_Caps )] <- Allmerica [s] @@
# Ex: Allstate
_companyPhrase [layer=(_Caps )] <- Allstate [s] @@
# Ex: Alltel
_companyPhrase [layer=(_Caps )] <- Alltel [s] @@
# Ex: Alstom
_companyPhrase [layer=(_Caps )] <- Alstom [s] @@
# Ex: Amazon.com
_companyPhrase [layer=(_Caps )] <- Amazon [s] \. [s] com [s] @@
# Ex: Amerada
_companyPhrase [layer=(_Caps )] <- Amerada [s] @@
# Ex: Ameren
_companyPhrase [layer=(_Caps )] <- Ameren [s] @@
# Ex: America
_companyPhrase [layer=(_Caps )] <- America [s] @@
# Ex: American
_companyPhrase [layer=(_Caps )] <- American [s] @@
# Ex: AmeriSource
_companyPhrase [layer=(_Caps )] <- AmeriSource [s] @@
# Ex: Ameritech
_companyPhrase [layer=(_Caps )] <- Ameritech [s] @@
# Ex: AMEX
_companyPhrase [layer=(_Caps )] <- AMEX [s] @@
# Ex: Amoco
_companyPhrase [layer=(_Caps )] <- Amoco [s] @@
# Ex: AMP
_companyPhrase [layer=(_Caps )] <- AMP [s] @@
# Ex: AMR
_companyPhrase [layer=(_Caps )] <- AMR [s] @@
@PRE
<1,1> cap();
<3,3> cap();
@RULES
# Ex: Anheuser-Busch
_companyPhrase [layer=(_Caps )] <- Anheuser [s] \- [s] Busch [s] @@
@PRE
<1,1> cap();
@RULES
# Ex: Anixter
_companyPhrase [layer=(_Caps )] <- Anixter [s] @@
# Ex: Anthem
_companyPhrase [layer=(_Caps )] <- Anthem [s] @@
# Ex: AOL
_companyPhrase [layer=(_Caps )] <- AOL [s] @@
# Ex: Aon
_companyPhrase [layer=(_Caps )] <- Aon [s] @@
# Ex: Apple
_companyPhrase [layer=(_Caps )] <- Apple [s] @@
# Ex: Applications
_companyPhrase [layer=(_Caps )] <- Applications [s] @@
# Ex: Applied
_companyPhrase [layer=(_Caps )] <- Applied [s] @@
# Ex: Aramark
_companyPhrase [layer=(_Caps )] <- Aramark [s] @@
# Ex: Arbed
_companyPhrase [layer=(_Caps )] <- Arbed [s] @@
# Ex: Archer
_companyPhrase [layer=(_Caps )] <- Archer [s] @@
# Ex: ARCO
_companyPhrase [layer=(_Caps )] <- ARCO [s] @@
# Ex: Arrow
_companyPhrase [layer=(_Caps )] <- Arrow [s] @@
# Ex: Asahi
_companyPhrase [layer=(_Caps )] <- Asahi [s] @@
# Ex: ASDA
_companyPhrase [layer=(_Caps )] <- ASDA [s] @@
# Ex: Astra
_companyPhrase [layer=(_Caps )] <- Astra [s] @@
@PRE
<1,1> cap();
<3,3> cap();
@RULES
# Ex: AT&T
_companyPhrase [layer=(_Caps )] <- AT [s] \& [s] T [s] @@
@PRE
<1,1> cap();
@RULES
# Ex: Atlantic
_companyPhrase [layer=(_Caps )] <- Atlantic [s] @@
# Ex: Autoliv
_companyPhrase [layer=(_Caps )] <- Autoliv [s] @@
# Ex: AutoNation
_companyPhrase [layer=(_Caps )] <- AutoNation [s] @@
# Ex: AutoZone
_companyPhrase [layer=(_Caps )] <- AutoZone [s] @@
# Ex: Avery
_companyPhrase [layer=(_Caps )] <- Avery [s] @@
# Ex: Avista
_companyPhrase [layer=(_Caps )] <- Avista [s] @@
# Ex: Avnet
_companyPhrase [layer=(_Caps )] <- Avnet [s] @@
# Ex: Avon
_companyPhrase [layer=(_Caps )] <- Avon [s] @@
# Ex: Baker
_companyPhrase [layer=(_Caps )] <- Baker [s] @@
# Ex: Bakeries
_companyPhrase [layer=(_Caps )] <- Bakeries [s] @@
# Ex: Ball
_companyPhrase [layer=(_Caps )] <- Ball [s] @@
# Ex: Banc
_companyPhrase [layer=(_Caps )] <- Banc [s] @@
# Ex: Banca
_companyPhrase [layer=(_Caps )] <- Banca [s] @@
# Ex: Bancorp
_companyPhrase [layer=(_Caps )] <- Bancorp [s] @@
# Ex: BankBoston
_companyPhrase [layer=(_Caps )] <- BankBoston [s] @@
# Ex: Bankers
_companyPhrase [layer=(_Caps )] <- Bankers [s] @@
# Ex: Barnes
_companyPhrase [layer=(_Caps )] <- Barnes [s] @@
# Ex: Baxter
_companyPhrase [layer=(_Caps )] <- Baxter [s] @@
@PRE
<1,1> cap();
<3,3> cap();
@RULES
# Ex: BB&T
_companyPhrase [layer=(_Caps )] <- BB [s] \& [s] T [s] @@
@PRE
<1,1> cap();
@RULES
# Ex: BBN
_companyPhrase [layer=(_Caps )] <- BBN [s] @@
# Ex: Bear
_companyPhrase [layer=(_Caps )] <- Bear [s] @@
# Ex: Becton
_companyPhrase [layer=(_Caps )] <- Becton [s] @@
# Ex: Bell
_companyPhrase [layer=(_Caps )] <- Bell [s] @@
# Ex: BellSouth
_companyPhrase [layer=(_Caps )] <- BellSouth [s] @@
# Ex: Bergen
_companyPhrase [layer=(_Caps )] <- Bergen [s] @@
# Ex: Berkshire
_companyPhrase [layer=(_Caps )] <- Berkshire [s] @@
# Ex: Best
_companyPhrase [layer=(_Caps )] <- Best [s] @@
# Ex: Bestfoods
_companyPhrase [layer=(_Caps )] <- Bestfoods [s] @@
# Ex: Bethlehem
_companyPhrase [layer=(_Caps )] <- Bethlehem [s] @@
# Ex: BF
_companyPhrase [layer=(_Caps )] <- BF [s] @@
# Ex: Bindley
_companyPhrase [layer=(_Caps )] <- Bindley [s] @@
# Ex: BJ's
_companyPhrase [layer=(_Caps )] <- BJ [s] \' [s] s [s] @@
# Ex: Black
_companyPhrase [layer=(_Caps )] <- Black [s] @@
# Ex: Boeing
_companyPhrase [layer=(_Caps )] <- Boeing [s] @@
# Ex: BofA
_companyPhrase [layer=(_Caps )] <- BofA [s] @@
# Ex: Boise
_companyPhrase [layer=(_Caps )] <- Boise [s] @@
# Ex: Bowes
_companyPhrase [layer=(_Caps )] <- Bowes [s] @@
# Ex: Brand
_companyPhrase [layer=(_Caps )] <- Brand [s] @@
# Ex: Brands
_companyPhrase [layer=(_Caps )] <- Brands [s] @@
@PRE
<1,1> cap();
<3,3> cap();
@RULES
# Ex: Bristol-Myers
_companyPhrase [layer=(_Caps )] <- Bristol [s] \- [s] Myers [s] @@
@PRE
<1,1> cap();
@RULES
# Ex: British
_companyPhrase [layer=(_Caps )] <- British [s] @@
# Ex: Brotherhood
_companyPhrase [layer=(_Caps )] <- Brotherhood [s] @@
# Ex: Brothers
_companyPhrase [layer=(_Caps )] <- Brothers [s] @@
@PRE
<1,1> cap();
<3,3> cap();
@RULES
# Ex: Browning-Ferris
_companyPhrase [layer=(_Caps )] <- Browning [s] \- [s] Ferris [s] @@
@PRE
<1,1> cap();
@RULES
# Ex: Brunswig
_companyPhrase [layer=(_Caps )] <- Brunswig [s] @@
# Ex: Bureau
_companyPhrase [layer=(_Caps )] <- Bureau [s] @@
# Ex: Burlington
_companyPhrase [layer=(_Caps )] <- Burlington [s] @@
# Ex: Business
_companyPhrase [layer=(_Caps )] <- Business [s] @@
# Ex: Buy
_companyPhrase [layer=(_Caps )] <- Buy [s] @@
# Ex: Cablevision
_companyPhrase [layer=(_Caps )] <- Cablevision [s] @@
# Ex: CAI
_companyPhrase [layer=(_Caps )] <- CAI [s] @@
# Ex: Camp
_companyPhrase [layer=(_Caps )] <- Camp [s] @@
# Ex: Campbell
_companyPhrase [layer=(_Caps )] <- Campbell [s] @@
# Ex: Carbide
_companyPhrase [layer=(_Caps )] <- Carbide [s] @@
# Ex: Cardinal
_companyPhrase [layer=(_Caps )] <- Cardinal [s] @@
# Ex: Carolina
_companyPhrase [layer=(_Caps )] <- Carolina [s] @@
# Ex: Cascade
_companyPhrase [layer=(_Caps )] <- Cascade [s] @@
# Ex: Case
_companyPhrase [layer=(_Caps )] <- Case [s] @@
# Ex: Caterpillar
_companyPhrase [layer=(_Caps )] <- Caterpillar [s] @@
# Ex: Cathay
_companyPhrase [layer=(_Caps )] <- Cathay [s] @@
# Ex: CBS
_companyPhrase [layer=(_Caps )] <- CBS [s] @@
# Ex: Cendant
_companyPhrase [layer=(_Caps )] <- Cendant [s] @@
# Ex: Centex
_companyPhrase [layer=(_Caps )] <- Centex [s] @@
# Ex: Central
_companyPhrase [layer=(_Caps )] <- Central [s] @@
# Ex: Centrica
_companyPhrase [layer=(_Caps )] <- Centrica [s] @@
# Ex: Century
_companyPhrase [layer=(_Caps )] <- Century [s] @@
# Ex: Champion
_companyPhrase [layer=(_Caps )] <- Champion [s] @@
# Ex: Charles
_companyPhrase [layer=(_Caps )] <- Charles [s] @@
# Ex: Chase
_companyPhrase [layer=(_Caps )] <- Chase [s] @@
# Ex: Chemical
_companyPhrase [layer=(_Caps )] <- Chemical [s] @@
# Ex: Chemicals
_companyPhrase [layer=(_Caps )] <- Chemicals [s] @@
# Ex: Chevron
_companyPhrase [layer=(_Caps )] <- Chevron [s] @@
# Ex: Chinese
_companyPhrase [layer=(_Caps )] <- Chinese [s] @@
# Ex: Chiyoda
_companyPhrase [layer=(_Caps )] <- Chiyoda [s] @@
# Ex: Chrysler
_companyPhrase [layer=(_Caps )] <- Chrysler [s] @@
# Ex: CHS
_companyPhrase [layer=(_Caps )] <- CHS [s] @@
# Ex: Chubb
_companyPhrase [layer=(_Caps )] <- Chubb [s] @@
# Ex: Cigna
_companyPhrase [layer=(_Caps )] <- Cigna [s] @@
# Ex: Cinergy
_companyPhrase [layer=(_Caps )] <- Cinergy [s] @@
# Ex: Circuit
_companyPhrase [layer=(_Caps )] <- Circuit [s] @@
# Ex: Cisco
_companyPhrase [layer=(_Caps )] <- Cisco [s] @@
# Ex: Citicorp
_companyPhrase [layer=(_Caps )] <- Citicorp [s] @@
# Ex: Citigroup
_companyPhrase [layer=(_Caps )] <- Citigroup [s] @@
# Ex: City
_companyPhrase [layer=(_Caps )] <- City [s] @@
# Ex: Clark
_companyPhrase [layer=(_Caps )] <- Clark [s] @@
# Ex: Club
_companyPhrase [layer=(_Caps )] <- Club [s] @@
# Ex: CMS
_companyPhrase [layer=(_Caps )] <- CMS [s] @@
# Ex: CNF
_companyPhrase [layer=(_Caps )] <- CNF [s] @@
# Ex: Coastal
_companyPhrase [layer=(_Caps )] <- Coastal [s] @@
@PRE
<1,1> cap();
<3,3> cap();
@RULES
# Ex: Coca-Cola
_companyPhrase [layer=(_Caps )] <- Coca [s] \- [s] Cola [s] @@
@PRE
<1,1> cap();
@RULES
# Ex: COFCO
_companyPhrase [layer=(_Caps )] <- COFCO [s] @@
@PRE
<1,1> cap();
<3,3> cap();
@RULES
# Ex: Colgate-Palmolive
_companyPhrase [layer=(_Caps )] <- Colgate [s] \- [s] Palmolive [s] @@
@PRE
<1,1> cap();
@RULES
# Ex: Columbia
_companyPhrase [layer=(_Caps )] <- Columbia [s] @@
@PRE
<1,1> cap();
<3,3> cap();
@RULES
# Ex: Columbia/HCA
_companyPhrase [layer=(_Caps )] <- Columbia [s] \/ [s] HCA [s] @@
@PRE
<1,1> cap();
@RULES
# Ex: Comcast
_companyPhrase [layer=(_Caps )] <- Comcast [s] @@
# Ex: Comdisco
_companyPhrase [layer=(_Caps )] <- Comdisco [s] @@
# Ex: Comerica
_companyPhrase [layer=(_Caps )] <- Comerica [s] @@
# Ex: Commerciale
_companyPhrase [layer=(_Caps )] <- Commerciale [s] @@
# Ex: Communications
_companyPhrase [layer=(_Caps )] <- Communications [s] @@
# Ex: Compaq
_companyPhrase [layer=(_Caps )] <- Compaq [s] @@
# Ex: CompUSA
_companyPhrase [layer=(_Caps )] <- CompUSA [s] @@
# Ex: Computer
_companyPhrase [layer=(_Caps )] <- Computer [s] @@
# Ex: ConAgra
_companyPhrase [layer=(_Caps )] <- ConAgra [s] @@
# Ex: Conectiv
_companyPhrase [layer=(_Caps )] <- Conectiv [s] @@
# Ex: Conseco
_companyPhrase [layer=(_Caps )] <- Conseco [s] @@
# Ex: Consolidated
_companyPhrase [layer=(_Caps )] <- Consolidated [s] @@
# Ex: Constellation
_companyPhrase [layer=(_Caps )] <- Constellation [s] @@
# Ex: Container
_companyPhrase [layer=(_Caps )] <- Container [s] @@
# Ex: Continental
_companyPhrase [layer=(_Caps )] <- Continental [s] @@
# Ex: Controls
_companyPhrase [layer=(_Caps )] <- Controls [s] @@
# Ex: Cooper
_companyPhrase [layer=(_Caps )] <- Cooper [s] @@
# Ex: Cork
_companyPhrase [layer=(_Caps )] <- Cork [s] @@
# Ex: Corp
_companyPhrase [layer=(_Caps )] <- Corp [s] @@
# Ex: Corporate
_companyPhrase [layer=(_Caps )] <- Corporate [s] @@
# Ex: Costco
_companyPhrase [layer=(_Caps )] <- Costco [s] @@
# Ex: Crown
_companyPhrase [layer=(_Caps )] <- Crown [s] @@
# Ex: CSX
_companyPhrase [layer=(_Caps )] <- CSX [s] @@
# Ex: Cummins
_companyPhrase [layer=(_Caps )] <- Cummins [s] @@
# Ex: Dai
_companyPhrase [layer=(_Caps )] <- Dai [s] @@
# Ex: Daido
_companyPhrase [layer=(_Caps )] <- Daido [s] @@
@PRE
<1,1> cap();
<3,3> cap();
@RULES
# Ex: Daimler-Chrysler
_companyPhrase [layer=(_Caps )] <- Daimler [s] \- [s] Chrysler [s] @@
@PRE
<1,1> cap();
@RULES
# Ex: Dana
_companyPhrase [layer=(_Caps )] <- Dana [s] @@
# Ex: Danaher
_companyPhrase [layer=(_Caps )] <- Danaher [s] @@
# Ex: Daniels
_companyPhrase [layer=(_Caps )] <- Daniels [s] @@
# Ex: Darden
_companyPhrase [layer=(_Caps )] <- Darden [s] @@
# Ex: Data
_companyPhrase [layer=(_Caps )] <- Data [s] @@
# Ex: Dayton
_companyPhrase [layer=(_Caps )] <- Dayton [s] @@
# Ex: DDI
_companyPhrase [layer=(_Caps )] <- DDI [s] @@
# Ex: Dean
_companyPhrase [layer=(_Caps )] <- Dean [s] @@
# Ex: Decker
_companyPhrase [layer=(_Caps )] <- Decker [s] @@
# Ex: Deere
_companyPhrase [layer=(_Caps )] <- Deere [s] @@
# Ex: Dell
_companyPhrase [layer=(_Caps )] <- Dell [s] @@
# Ex: Delta
_companyPhrase [layer=(_Caps )] <- Delta [s] @@
# Ex: Dennison
_companyPhrase [layer=(_Caps )] <- Dennison [s] @@
# Ex: Dentsu
_companyPhrase [layer=(_Caps )] <- Dentsu [s] @@
# Ex: Department
_companyPhrase [layer=(_Caps )] <- Department [s] @@
# Ex: Depot
_companyPhrase [layer=(_Caps )] <- Depot [s] @@
# Ex: Deutsche
_companyPhrase [layer=(_Caps )] <- Deutsche [s] @@
# Ex: Diamond
_companyPhrase [layer=(_Caps )] <- Diamond [s] @@
# Ex: Dickinson
_companyPhrase [layer=(_Caps )] <- Dickinson [s] @@
# Ex: Digital
_companyPhrase [layer=(_Caps )] <- Digital [s] @@
# Ex: Dillard's
_companyPhrase [layer=(_Caps )] <- Dillard [s] \' [s] s [s] @@
# Ex: Disney
_companyPhrase [layer=(_Caps )] <- Disney [s] @@
# Ex: Dodge
_companyPhrase [layer=(_Caps )] <- Dodge [s] @@
# Ex: Dole
_companyPhrase [layer=(_Caps )] <- Dole [s] @@
# Ex: Dollar
_companyPhrase [layer=(_Caps )] <- Dollar [s] @@
# Ex: Dominion
_companyPhrase [layer=(_Caps )] <- Dominion [s] @@
# Ex: Donnelley
_companyPhrase [layer=(_Caps )] <- Donnelley [s] @@
# Ex: Dow
_companyPhrase [layer=(_Caps )] <- Dow [s] @@
# Ex: Drug
_companyPhrase [layer=(_Caps )] <- Drug [s] @@
# Ex: DTE
_companyPhrase [layer=(_Caps )] <- DTE [s] @@
# Ex: Duke
_companyPhrase [layer=(_Caps )] <- Duke [s] @@
# Ex: DuPont
_companyPhrase [layer=(_Caps )] <- DuPont [s] @@
# Ex: Dynamics
_companyPhrase [layer=(_Caps )] <- Dynamics [s] @@
# Ex: Dynegy
_companyPhrase [layer=(_Caps )] <- Dynegy [s] @@
# Ex: Dynergy
_companyPhrase [layer=(_Caps )] <- Dynergy [s] @@
# Ex: Eastman
_companyPhrase [layer=(_Caps )] <- Eastman [s] @@
# Ex: Eaton
_companyPhrase [layer=(_Caps )] <- Eaton [s] @@
# Ex: Edeka
_companyPhrase [layer=(_Caps )] <- Edeka [s] @@
# Ex: Edison
_companyPhrase [layer=(_Caps )] <- Edison [s] @@
# Ex: EDS
_companyPhrase [layer=(_Caps )] <- EDS [s] @@
# Ex: Electric
_companyPhrase [layer=(_Caps )] <- Electric [s] @@
# Ex: Electron
_companyPhrase [layer=(_Caps )] <- Electron [s] @@
# Ex: Electronic
_companyPhrase [layer=(_Caps )] <- Electronic [s] @@
# Ex: Electronics
_companyPhrase [layer=(_Caps )] <- Electronics [s] @@
# Ex: Eli
_companyPhrase [layer=(_Caps )] <- Eli [s] @@
# Ex: EMC
_companyPhrase [layer=(_Caps )] <- EMC [s] @@
# Ex: Emerson
_companyPhrase [layer=(_Caps )] <- Emerson [s] @@
# Ex: Energies
_companyPhrase [layer=(_Caps )] <- Energies [s] @@
# Ex: Energy
_companyPhrase [layer=(_Caps )] <- Energy [s] @@
# Ex: Engelhard
_companyPhrase [layer=(_Caps )] <- Engelhard [s] @@
# Ex: Engine
_companyPhrase [layer=(_Caps )] <- Engine [s] @@
# Ex: Enron
_companyPhrase [layer=(_Caps )] <- Enron [s] @@
# Ex: Enso
_companyPhrase [layer=(_Caps )] <- Enso [s] @@
# Ex: Entergy
_companyPhrase [layer=(_Caps )] <- Entergy [s] @@
# Ex: Enterprise
_companyPhrase [layer=(_Caps )] <- Enterprise [s] @@
# Ex: Estee
_companyPhrase [layer=(_Caps )] <- Estee [s] @@
# Ex: Evans
_companyPhrase [layer=(_Caps )] <- Evans [s] @@
# Ex: Express
_companyPhrase [layer=(_Caps )] <- Express [s] @@
# Ex: Exxon
_companyPhrase [layer=(_Caps )] <- Exxon [s] @@
# Ex: Family
_companyPhrase [layer=(_Caps )] <- Family [s] @@
# Ex: Fannie
_companyPhrase [layer=(_Caps )] <- Fannie [s] @@
# Ex: Fargo
_companyPhrase [layer=(_Caps )] <- Fargo [s] @@
# Ex: Farm
_companyPhrase [layer=(_Caps )] <- Farm [s] @@
# Ex: Farmland
_companyPhrase [layer=(_Caps )] <- Farmland [s] @@
# Ex: FDX
_companyPhrase [layer=(_Caps )] <- FDX [s] @@
# Ex: Federal
_companyPhrase [layer=(_Caps )] <- Federal [s] @@
@PRE
<1,1> cap();
<3,3> cap();
@RULES
# Ex: Federal-Mogul
_companyPhrase [layer=(_Caps )] <- Federal [s] \- [s] Mogul [s] @@
@PRE
<1,1> cap();
@RULES
# Ex: Federated
_companyPhrase [layer=(_Caps )] <- Federated [s] @@
# Ex: Film
_companyPhrase [layer=(_Caps )] <- Film [s] @@
# Ex: Filter
_companyPhrase [layer=(_Caps )] <- Filter [s] @@
# Ex: Financial
_companyPhrase [layer=(_Caps )] <- Financial [s] @@
# Ex: Finch
_companyPhrase [layer=(_Caps )] <- Finch [s] @@
# Ex: Fire
_companyPhrase [layer=(_Caps )] <- Fire [s] @@
# Ex: First
_companyPhrase [layer=(_Caps )] <- First [s] @@
# Ex: Firstar
_companyPhrase [layer=(_Caps )] <- Firstar [s] @@
# Ex: FirstEnergy
_companyPhrase [layer=(_Caps )] <- FirstEnergy [s] @@
# Ex: Fleet
_companyPhrase [layer=(_Caps )] <- Fleet [s] @@
# Ex: Fleetwood
_companyPhrase [layer=(_Caps )] <- Fleetwood [s] @@
# Ex: Fleming
_companyPhrase [layer=(_Caps )] <- Fleming [s] @@
# Ex: Florida
_companyPhrase [layer=(_Caps )] <- Florida [s] @@
# Ex: Flowers
_companyPhrase [layer=(_Caps )] <- Flowers [s] @@
# Ex: Fluor
_companyPhrase [layer=(_Caps )] <- Fluor [s] @@
# Ex: FMC
_companyPhrase [layer=(_Caps )] <- FMC [s] @@
# Ex: Food
_companyPhrase [layer=(_Caps )] <- Food [s] @@
# Ex: Foods
_companyPhrase [layer=(_Caps )] <- Foods [s] @@
# Ex: Foodservice
_companyPhrase [layer=(_Caps )] <- Foodservice [s] @@
# Ex: Ford
_companyPhrase [layer=(_Caps )] <- Ford [s] @@
# Ex: Fort
_companyPhrase [layer=(_Caps )] <- Fort [s] @@
# Ex: Fortum
_companyPhrase [layer=(_Caps )] <- Fortum [s] @@
# Ex: Fortune
_companyPhrase [layer=(_Caps )] <- Fortune [s] @@
# Ex: Foster
_companyPhrase [layer=(_Caps )] <- Foster [s] @@
# Ex: Foundation
_companyPhrase [layer=(_Caps )] <- Foundation [s] @@
# Ex: FPL
_companyPhrase [layer=(_Caps )] <- FPL [s] @@
# Ex: Fred
_companyPhrase [layer=(_Caps )] <- Fred [s] @@
# Ex: Freddie
_companyPhrase [layer=(_Caps )] <- Freddie [s] @@
# Ex: Freight
_companyPhrase [layer=(_Caps )] <- Freight [s] @@
# Ex: Fuji
_companyPhrase [layer=(_Caps )] <- Fuji [s] @@
# Ex: Fund
_companyPhrase [layer=(_Caps )] <- Fund [s] @@
# Ex: Gamble
_companyPhrase [layer=(_Caps )] <- Gamble [s] @@
# Ex: Gannett
_companyPhrase [layer=(_Caps )] <- Gannett [s] @@
# Ex: Gap
_companyPhrase [layer=(_Caps )] <- Gap [s] @@
# Ex: Gas
_companyPhrase [layer=(_Caps )] <- Gas [s] @@
# Ex: Gateway
_companyPhrase [layer=(_Caps )] <- Gateway [s] @@
# Ex: Gaz
_companyPhrase [layer=(_Caps )] <- Gaz [s] @@
# Ex: GE
_companyPhrase [layer=(_Caps )] <- GE [s] @@
# Ex: GenAmerica
_companyPhrase [layer=(_Caps )] <- GenAmerica [s] @@
# Ex: General
_companyPhrase [layer=(_Caps )] <- General [s] @@
# Ex: Genossenschaftsbank
_companyPhrase [layer=(_Caps )] <- Genossenschaftsbank [s] @@
# Ex: Genuine
_companyPhrase [layer=(_Caps )] <- Genuine [s] @@
# Ex: George
_companyPhrase [layer=(_Caps )] <- George [s] @@
@PRE
<1,1> cap();
<3,3> cap();
@RULES
# Ex: Georgia-Pacific
_companyPhrase [layer=(_Caps )] <- Georgia [s] \- [s] Pacific [s] @@
@PRE
<1,1> cap();
@RULES
# Ex: Giant
_companyPhrase [layer=(_Caps )] <- Giant [s] @@
# Ex: Glass
_companyPhrase [layer=(_Caps )] <- Glass [s] @@
# Ex: Global
_companyPhrase [layer=(_Caps )] <- Global [s] @@
# Ex: GM
_companyPhrase [layer=(_Caps )] <- GM [s] @@
# Ex: Golden
_companyPhrase [layer=(_Caps )] <- Golden [s] @@
# Ex: Goodrich
_companyPhrase [layer=(_Caps )] <- Goodrich [s] @@
# Ex: Goodyear
_companyPhrase [layer=(_Caps )] <- Goodyear [s] @@
# Ex: GPU
_companyPhrase [layer=(_Caps )] <- GPU [s] @@
# Ex: Grainger
_companyPhrase [layer=(_Caps )] <- Grainger [s] @@
# Ex: Graybar
_companyPhrase [layer=(_Caps )] <- Graybar [s] @@
# Ex: Great
_companyPhrase [layer=(_Caps )] <- Great [s] @@
# Ex: Group
_companyPhrase [layer=(_Caps )] <- Group [s] @@
# Ex: Groupe
_companyPhrase [layer=(_Caps )] <- Groupe [s] @@
# Ex: Grumman
_companyPhrase [layer=(_Caps )] <- Grumman [s] @@
# Ex: GTE
_companyPhrase [layer=(_Caps )] <- GTE [s] @@
# Ex: Guardian
_companyPhrase [layer=(_Caps )] <- Guardian [s] @@
# Ex: Haas
_companyPhrase [layer=(_Caps )] <- Haas [s] @@
# Ex: Halliburton
_companyPhrase [layer=(_Caps )] <- Halliburton [s] @@
# Ex: Hancock
_companyPhrase [layer=(_Caps )] <- Hancock [s] @@
# Ex: Handels
_companyPhrase [layer=(_Caps )] <- Handels [s] @@
# Ex: Hannaford
_companyPhrase [layer=(_Caps )] <- Hannaford [s] @@
# Ex: Hannifin
_companyPhrase [layer=(_Caps )] <- Hannifin [s] @@
# Ex: Harcourt
_companyPhrase [layer=(_Caps )] <- Harcourt [s] @@
# Ex: Hardware
_companyPhrase [layer=(_Caps )] <- Hardware [s] @@
# Ex: Harris
_companyPhrase [layer=(_Caps )] <- Harris [s] @@
# Ex: Hartford
_companyPhrase [layer=(_Caps )] <- Hartford [s] @@
# Ex: Hasbro
_companyPhrase [layer=(_Caps )] <- Hasbro [s] @@
# Ex: Hathaway
_companyPhrase [layer=(_Caps )] <- Hathaway [s] @@
# Ex: HBOC
_companyPhrase [layer=(_Caps )] <- HBOC [s] @@
# Ex: Health
_companyPhrase [layer=(_Caps )] <- Health [s] @@
# Ex: HealthCare
_companyPhrase [layer=(_Caps )] <- HealthCare [s] @@
# Ex: Healthcare
_companyPhrase [layer=(_Caps )] <- Healthcare [s] @@
# Ex: Healthsouth
_companyPhrase [layer=(_Caps )] <- Healthsouth [s] @@
# Ex: Hechinger
_companyPhrase [layer=(_Caps )] <- Hechinger [s] @@
# Ex: Heinz
_companyPhrase [layer=(_Caps )] <- Heinz [s] @@
# Ex: Henkel
_companyPhrase [layer=(_Caps )] <- Henkel [s] @@
# Ex: Hershey
_companyPhrase [layer=(_Caps )] <- Hershey [s] @@
# Ex: Hess
_companyPhrase [layer=(_Caps )] <- Hess [s] @@
@PRE
<1,1> cap();
<3,3> cap();
@RULES
# Ex: Hewlett-Packard
_companyPhrase [layer=(_Caps )] <- Hewlett [s] \- [s] Packard [s] @@
@PRE
<1,1> cap();
@RULES
# Ex: Hilton
_companyPhrase [layer=(_Caps )] <- Hilton [s] @@
# Ex: Holding
_companyPhrase [layer=(_Caps )] <- Holding [s] @@
# Ex: Holdings
_companyPhrase [layer=(_Caps )] <- Holdings [s] @@
# Ex: Home
_companyPhrase [layer=(_Caps )] <- Home [s] @@
# Ex: Hormel
_companyPhrase [layer=(_Caps )] <- Hormel [s] @@
# Ex: Host
_companyPhrase [layer=(_Caps )] <- Host [s] @@
# Ex: Hotels
_companyPhrase [layer=(_Caps )] <- Hotels [s] @@
# Ex: House
_companyPhrase [layer=(_Caps )] <- House [s] @@
# Ex: Household
_companyPhrase [layer=(_Caps )] <- Household [s] @@
# Ex: Houston
_companyPhrase [layer=(_Caps )] <- Houston [s] @@
# Ex: Hudson
_companyPhrase [layer=(_Caps )] <- Hudson [s] @@
# Ex: Hughes
_companyPhrase [layer=(_Caps )] <- Hughes [s] @@
# Ex: Humana
_companyPhrase [layer=(_Caps )] <- Humana [s] @@
# Ex: IBP
_companyPhrase [layer=(_Caps )] <- IBP [s] @@
# Ex: Idemitsu
_companyPhrase [layer=(_Caps )] <- Idemitsu [s] @@
# Ex: Ikon
_companyPhrase [layer=(_Caps )] <- Ikon [s] @@
# Ex: Illinois
_companyPhrase [layer=(_Caps )] <- Illinois [s] @@
# Ex: IMC
_companyPhrase [layer=(_Caps )] <- IMC [s] @@
# Ex: InaCom
_companyPhrase [layer=(_Caps )] <- InaCom [s] @@
# Ex: Industries
_companyPhrase [layer=(_Caps )] <- Industries [s] @@
@PRE
<1,1> cap();
<3,3> cap();
@RULES
# Ex: Ingersoll-Rand
_companyPhrase [layer=(_Caps )] <- Ingersoll [s] \- [s] Rand [s] @@
@PRE
<1,1> cap();
@RULES
# Ex: Ingram
_companyPhrase [layer=(_Caps )] <- Ingram [s] @@
# Ex: Instruments
_companyPhrase [layer=(_Caps )] <- Instruments [s] @@
# Ex: Insurance
_companyPhrase [layer=(_Caps )] <- Insurance [s] @@
# Ex: Integrated
_companyPhrase [layer=(_Caps )] <- Integrated [s] @@
# Ex: International
_companyPhrase [layer=(_Caps )] <- International [s] @@
# Ex: Interpublic
_companyPhrase [layer=(_Caps )] <- Interpublic [s] @@
# Ex: Interstate
_companyPhrase [layer=(_Caps )] <- Interstate [s] @@
# Ex: Iron
_companyPhrase [layer=(_Caps )] <- Iron [s] @@
# Ex: Italiana
_companyPhrase [layer=(_Caps )] <- Italiana [s] @@
# Ex: ITT
_companyPhrase [layer=(_Caps )] <- ITT [s] @@
# Ex: Jardine
_companyPhrase [layer=(_Caps )] <- Jardine [s] @@
# Ex: Johnson
_companyPhrase [layer=(_Caps )] <- Johnson [s] @@
# Ex: Karstadt
_companyPhrase [layer=(_Caps )] <- Karstadt [s] @@
# Ex: Kawasho
_companyPhrase [layer=(_Caps )] <- Kawasho [s] @@
# Ex: Kellogg
_companyPhrase [layer=(_Caps )] <- Kellogg [s] @@
# Ex: KeyCorp
_companyPhrase [layer=(_Caps )] <- KeyCorp [s] @@
# Ex: Kiewit
_companyPhrase [layer=(_Caps )] <- Kiewit [s] @@
@PRE
<1,1> cap();
<3,3> cap();
@RULES
# Ex: Kimberly-Clark
_companyPhrase [layer=(_Caps )] <- Kimberly [s] \- [s] Clark [s] @@
@PRE
<1,1> cap();
@RULES
# Ex: Kingfisher
_companyPhrase [layer=(_Caps )] <- Kingfisher [s] @@
# Ex: Kmart
_companyPhrase [layer=(_Caps )] <- Kmart [s] @@
@PRE
<1,1> cap();
<3,3> cap();
@RULES
# Ex: Knight-Ridder
_companyPhrase [layer=(_Caps )] <- Knight [s] \- [s] Ridder [s] @@
@PRE
<1,1> cap();
@RULES
# Ex: Kobe
_companyPhrase [layer=(_Caps )] <- Kobe [s] @@
# Ex: Kodak
_companyPhrase [layer=(_Caps )] <- Kodak [s] @@
# Ex: Kohl's
_companyPhrase [layer=(_Caps )] <- Kohl [s] \' [s] s [s] @@
# Ex: Kosan
_companyPhrase [layer=(_Caps )] <- Kosan [s] @@
# Ex: Kreditanstalt
_companyPhrase [layer=(_Caps )] <- Kreditanstalt [s] @@
# Ex: Kroger
_companyPhrase [layer=(_Caps )] <- Kroger [s] @@
# Ex: Kyoei
_companyPhrase [layer=(_Caps )] <- Kyoei [s] @@
# Ex: Kyushu
_companyPhrase [layer=(_Caps )] <- Kyushu [s] @@
# Ex: Laboratories
_companyPhrase [layer=(_Caps )] <- Laboratories [s] @@
# Ex: Lafarge
_companyPhrase [layer=(_Caps )] <- Lafarge [s] @@
# Ex: Lagardere
_companyPhrase [layer=(_Caps )] <- Lagardere [s] @@
# Ex: Landesbank
_companyPhrase [layer=(_Caps )] <- Landesbank [s] @@
# Ex: Lauder
_companyPhrase [layer=(_Caps )] <- Lauder [s] @@
# Ex: Lear
_companyPhrase [layer=(_Caps )] <- Lear [s] @@
# Ex: Legal
_companyPhrase [layer=(_Caps )] <- Legal [s] @@
# Ex: Leggett
_companyPhrase [layer=(_Caps )] <- Leggett [s] @@
# Ex: Lehman
_companyPhrase [layer=(_Caps )] <- Lehman [s] @@
# Ex: Lexmark
_companyPhrase [layer=(_Caps )] <- Lexmark [s] @@
# Ex: LG
_companyPhrase [layer=(_Caps )] <- LG [s] @@
@PRE
<1,1> cap();
<3,3> cap();
@RULES
# Ex: LG&E
_companyPhrase [layer=(_Caps )] <- LG [s] \& [s] E [s] @@
@PRE
<1,1> cap();
@RULES
# Ex: Liberty
_companyPhrase [layer=(_Caps )] <- Liberty [s] @@
# Ex: Life
_companyPhrase [layer=(_Caps )] <- Life [s] @@
# Ex: Light
_companyPhrase [layer=(_Caps )] <- Light [s] @@
# Ex: Lilly
_companyPhrase [layer=(_Caps )] <- Lilly [s] @@
# Ex: Limited
_companyPhrase [layer=(_Caps )] <- Limited [s] @@
# Ex: Lincoln
_companyPhrase [layer=(_Caps )] <- Lincoln [s] @@
# Ex: Lines
_companyPhrase [layer=(_Caps )] <- Lines [s] @@
# Ex: Litton
_companyPhrase [layer=(_Caps )] <- Litton [s] @@
# Ex: Loan
_companyPhrase [layer=(_Caps )] <- Loan [s] @@
# Ex: Lockheed
_companyPhrase [layer=(_Caps )] <- Lockheed [s] @@
# Ex: Loews
_companyPhrase [layer=(_Caps )] <- Loews [s] @@
# Ex: Longs
_companyPhrase [layer=(_Caps )] <- Longs [s] @@
# Ex: Lowe's
_companyPhrase [layer=(_Caps )] <- Lowe [s] \' [s] s [s] @@
# Ex: LTV
_companyPhrase [layer=(_Caps )] <- LTV [s] @@
# Ex: Lucent
_companyPhrase [layer=(_Caps )] <- Lucent [s] @@
# Ex: Lutheran
_companyPhrase [layer=(_Caps )] <- Lutheran [s] @@
# Ex: Lutherans
_companyPhrase [layer=(_Caps )] <- Lutherans [s] @@
# Ex: Lynch
_companyPhrase [layer=(_Caps )] <- Lynch [s] @@
# Ex: Mac
_companyPhrase [layer=(_Caps )] <- Mac [s] @@
# Ex: Machines
_companyPhrase [layer=(_Caps )] <- Machines [s] @@
# Ex: Mae
_companyPhrase [layer=(_Caps )] <- Mae [s] @@
# Ex: Management
_companyPhrase [layer=(_Caps )] <- Management [s] @@
# Ex: Manhattan
_companyPhrase [layer=(_Caps )] <- Manhattan [s] @@
# Ex: Manpower
_companyPhrase [layer=(_Caps )] <- Manpower [s] @@
# Ex: Manufacturing
_companyPhrase [layer=(_Caps )] <- Manufacturing [s] @@
# Ex: Marine
_companyPhrase [layer=(_Caps )] <- Marine [s] @@
# Ex: Markets
_companyPhrase [layer=(_Caps )] <- Markets [s] @@
# Ex: MarketSpan
_companyPhrase [layer=(_Caps )] <- MarketSpan [s] @@
# Ex: Marriott
_companyPhrase [layer=(_Caps )] <- Marriott [s] @@
# Ex: Marsh
_companyPhrase [layer=(_Caps )] <- Marsh [s] @@
# Ex: Martin
_companyPhrase [layer=(_Caps )] <- Martin [s] @@
# Ex: Masco
_companyPhrase [layer=(_Caps )] <- Masco [s] @@
# Ex: Materials
_companyPhrase [layer=(_Caps )] <- Materials [s] @@
# Ex: Matheson
_companyPhrase [layer=(_Caps )] <- Matheson [s] @@
# Ex: Mattel
_companyPhrase [layer=(_Caps )] <- Mattel [s] @@
# Ex: May
_companyPhrase [layer=(_Caps )] <- May [s] @@
# Ex: Maytag
_companyPhrase [layer=(_Caps )] <- Maytag [s] @@
# Ex: MBNA
_companyPhrase [layer=(_Caps )] <- MBNA [s] @@
# Ex: McDonald's
_companyPhrase [layer=(_Caps )] <- McDonald [s] \' [s] s [s] @@
@PRE
<1,1> cap();
<3,3> cap();
@RULES
# Ex: McGraw-Hill
_companyPhrase [layer=(_Caps )] <- McGraw [s] \- [s] Hill [s] @@
@PRE
<1,1> cap();
@RULES
# Ex: MCI
_companyPhrase [layer=(_Caps )] <- MCI [s] @@
# Ex: McKesson
_companyPhrase [layer=(_Caps )] <- McKesson [s] @@
# Ex: McLennan
_companyPhrase [layer=(_Caps )] <- McLennan [s] @@
# Ex: Mead
_companyPhrase [layer=(_Caps )] <- Mead [s] @@
# Ex: MedPartners
_companyPhrase [layer=(_Caps )] <- MedPartners [s] @@
# Ex: Mellon
_companyPhrase [layer=(_Caps )] <- Mellon [s] @@
# Ex: Mercantile
_companyPhrase [layer=(_Caps )] <- Mercantile [s] @@
# Ex: Merchandise
_companyPhrase [layer=(_Caps )] <- Merchandise [s] @@
# Ex: Merck
_companyPhrase [layer=(_Caps )] <- Merck [s] @@
# Ex: Merisel
_companyPhrase [layer=(_Caps )] <- Merisel [s] @@
# Ex: Meritor
_companyPhrase [layer=(_Caps )] <- Meritor [s] @@
# Ex: Merrill
_companyPhrase [layer=(_Caps )] <- Merrill [s] @@
# Ex: Metallgesellschaft
_companyPhrase [layer=(_Caps )] <- Metallgesellschaft [s] @@
# Ex: Metals
_companyPhrase [layer=(_Caps )] <- Metals [s] @@
# Ex: Metropolitan
_companyPhrase [layer=(_Caps )] <- Metropolitan [s] @@
# Ex: Meyer
_companyPhrase [layer=(_Caps )] <- Meyer [s] @@
# Ex: Micro
_companyPhrase [layer=(_Caps )] <- Micro [s] @@
# Ex: MicroAge
_companyPhrase [layer=(_Caps )] <- MicroAge [s] @@
# Ex: Micron
_companyPhrase [layer=(_Caps )] <- Micron [s] @@
# Ex: Microsoft
_companyPhrase [layer=(_Caps )] <- Microsoft [s] @@
# Ex: Microsystems
_companyPhrase [layer=(_Caps )] <- Microsystems [s] @@
# Ex: Midland
_companyPhrase [layer=(_Caps )] <- Midland [s] @@
# Ex: Migros
_companyPhrase [layer=(_Caps )] <- Migros [s] @@
# Ex: Milk
_companyPhrase [layer=(_Caps )] <- Milk [s] @@
# Ex: Mills
_companyPhrase [layer=(_Caps )] <- Mills [s] @@
# Ex: Mining
_companyPhrase [layer=(_Caps )] <- Mining [s] @@
# Ex: Minnesota
_companyPhrase [layer=(_Caps )] <- Minnesota [s] @@
# Ex: Minor
_companyPhrase [layer=(_Caps )] <- Minor [s] @@
# Ex: Mirror
_companyPhrase [layer=(_Caps )] <- Mirror [s] @@
# Ex: Mobil
_companyPhrase [layer=(_Caps )] <- Mobil [s] @@
# Ex: Mohawk
_companyPhrase [layer=(_Caps )] <- Mohawk [s] @@
# Ex: Monsanto
_companyPhrase [layer=(_Caps )] <- Monsanto [s] @@
# Ex: Montreal
_companyPhrase [layer=(_Caps )] <- Montreal [s] @@
# Ex: Morgan
_companyPhrase [layer=(_Caps )] <- Morgan [s] @@
# Ex: Morris
_companyPhrase [layer=(_Caps )] <- Morris [s] @@
# Ex: Mortgage
_companyPhrase [layer=(_Caps )] <- Mortgage [s] @@
# Ex: Motor
_companyPhrase [layer=(_Caps )] <- Motor [s] @@
# Ex: Motors
_companyPhrase [layer=(_Caps )] <- Motors [s] @@
# Ex: Mutual
_companyPhrase [layer=(_Caps )] <- Mutual [s] @@
# Ex: Nabisco
_companyPhrase [layer=(_Caps )] <- Nabisco [s] @@
# Ex: Nash
_companyPhrase [layer=(_Caps )] <- Nash [s] @@
# Ex: National
_companyPhrase [layer=(_Caps )] <- National [s] @@
# Ex: NationsBank
_companyPhrase [layer=(_Caps )] <- NationsBank [s] @@
# Ex: Nationwide
_companyPhrase [layer=(_Caps )] <- Nationwide [s] @@
# Ex: Natural
_companyPhrase [layer=(_Caps )] <- Natural [s] @@
# Ex: Navistar
_companyPhrase [layer=(_Caps )] <- Navistar [s] @@
# Ex: NBC
_companyPhrase [layer=(_Caps )] <- NBC [s] @@
# Ex: Nebco
_companyPhrase [layer=(_Caps )] <- Nebco [s] @@
# Ex: Networks
_companyPhrase [layer=(_Caps )] <- Networks [s] @@
# Ex: New
_companyPhrase [layer=(_Caps )] <- New [s] @@
# Ex: Newell
_companyPhrase [layer=(_Caps )] <- Newell [s] @@
# Ex: Niagara
_companyPhrase [layer=(_Caps )] <- Niagara [s] @@
# Ex: Nike
_companyPhrase [layer=(_Caps )] <- Nike [s] @@
# Ex: Nippon
_companyPhrase [layer=(_Caps )] <- Nippon [s] @@
# Ex: Nipsco
_companyPhrase [layer=(_Caps )] <- Nipsco [s] @@
# Ex: Nissan
_companyPhrase [layer=(_Caps )] <- Nissan [s] @@
# Ex: Noble
_companyPhrase [layer=(_Caps )] <- Noble [s] @@
# Ex: Norddeutsche
_companyPhrase [layer=(_Caps )] <- Norddeutsche [s] @@
# Ex: Nordstrom
_companyPhrase [layer=(_Caps )] <- Nordstrom [s] @@
# Ex: Norinchukin
_companyPhrase [layer=(_Caps )] <- Norinchukin [s] @@
# Ex: Northrop
_companyPhrase [layer=(_Caps )] <- Northrop [s] @@
# Ex: Nova
_companyPhrase [layer=(_Caps )] <- Nova [s] @@
# Ex: Nucor
_companyPhrase [layer=(_Caps )] <- Nucor [s] @@
# Ex: Oats
_companyPhrase [layer=(_Caps )] <- Oats [s] @@
# Ex: Obayashi
_companyPhrase [layer=(_Caps )] <- Obayashi [s] @@
# Ex: Occidental
_companyPhrase [layer=(_Caps )] <- Occidental [s] @@
# Ex: Office
_companyPhrase [layer=(_Caps )] <- Office [s] @@
# Ex: OfficeMax
_companyPhrase [layer=(_Caps )] <- OfficeMax [s] @@
# Ex: Oji
_companyPhrase [layer=(_Caps )] <- Oji [s] @@
# Ex: Olsten
_companyPhrase [layer=(_Caps )] <- Olsten [s] @@
# Ex: Omnicom
_companyPhrase [layer=(_Caps )] <- Omnicom [s] @@
# Ex: One
_companyPhrase [layer=(_Caps )] <- One [s] @@
# Ex: OnLine
_companyPhrase [layer=(_Caps )] <- OnLine [s] @@
# Ex: Oriental
_companyPhrase [layer=(_Caps )] <- Oriental [s] @@
# Ex: Otto
_companyPhrase [layer=(_Caps )] <- Otto [s] @@
# Ex: Owens
_companyPhrase [layer=(_Caps )] <- Owens [s] @@
@PRE
<1,1> cap();
<3,3> cap();
@RULES
# Ex: Owens-Corning
_companyPhrase [layer=(_Caps )] <- Owens [s] \- [s] Corning [s] @@
# Ex: Owens-Illinois
_companyPhrase [layer=(_Caps )] <- Owens [s] \- [s] Illinois [s] @@
@PRE
<1,1> cap();
@RULES
# Ex: Oxford
_companyPhrase [layer=(_Caps )] <- Oxford [s] @@
# Ex: Paccar
_companyPhrase [layer=(_Caps )] <- Paccar [s] @@
# Ex: Pacific
_companyPhrase [layer=(_Caps )] <- Pacific [s] @@
# Ex: PacifiCare
_companyPhrase [layer=(_Caps )] <- PacifiCare [s] @@
# Ex: PacifiCorp
_companyPhrase [layer=(_Caps )] <- PacifiCorp [s] @@
# Ex: Paine
_companyPhrase [layer=(_Caps )] <- Paine [s] @@
# Ex: Paper
_companyPhrase [layer=(_Caps )] <- Paper [s] @@
# Ex: Parcel
_companyPhrase [layer=(_Caps )] <- Parcel [s] @@
# Ex: Parker
_companyPhrase [layer=(_Caps )] <- Parker [s] @@
# Ex: Parts
_companyPhrase [layer=(_Caps )] <- Parts [s] @@
# Ex: Pechiney
_companyPhrase [layer=(_Caps )] <- Pechiney [s] @@
# Ex: PECO
_companyPhrase [layer=(_Caps )] <- PECO [s] @@
# Ex: Peninsular
_companyPhrase [layer=(_Caps )] <- Peninsular [s] @@
# Ex: Penney
_companyPhrase [layer=(_Caps )] <- Penney [s] @@
# Ex: PepsiCo
_companyPhrase [layer=(_Caps )] <- PepsiCo [s] @@
# Ex: PetroFina
_companyPhrase [layer=(_Caps )] <- PetroFina [s] @@
# Ex: Petroleum
_companyPhrase [layer=(_Caps )] <- Petroleum [s] @@
# Ex: Petronas
_companyPhrase [layer=(_Caps )] <- Petronas [s] @@
# Ex: Pfizer
_companyPhrase [layer=(_Caps )] <- Pfizer [s] @@
@PRE
<1,1> cap();
<3,3> cap();
@RULES
# Ex: PG&E
_companyPhrase [layer=(_Caps )] <- PG [s] \& [s] E [s] @@
@PRE
<1,1> cap();
@RULES
# Ex: Pharmacia
_companyPhrase [layer=(_Caps )] <- Pharmacia [s] @@
# Ex: Phelps
_companyPhrase [layer=(_Caps )] <- Phelps [s] @@
# Ex: Phillips
_companyPhrase [layer=(_Caps )] <- Phillips [s] @@
# Ex: Phoenix
_companyPhrase [layer=(_Caps )] <- Phoenix [s] @@
# Ex: Photo
_companyPhrase [layer=(_Caps )] <- Photo [s] @@
# Ex: Pitney
_companyPhrase [layer=(_Caps )] <- Pitney [s] @@
# Ex: Pittston
_companyPhrase [layer=(_Caps )] <- Pittston [s] @@
# Ex: Platt
_companyPhrase [layer=(_Caps )] <- Platt [s] @@
# Ex: PNC
_companyPhrase [layer=(_Caps )] <- PNC [s] @@
# Ex: Pohang
_companyPhrase [layer=(_Caps )] <- Pohang [s] @@
# Ex: Post
_companyPhrase [layer=(_Caps )] <- Post [s] @@
# Ex: Postal
_companyPhrase [layer=(_Caps )] <- Postal [s] @@
# Ex: Power
_companyPhrase [layer=(_Caps )] <- Power [s] @@
@PRE
<1,1> cap();
<3,3> cap();
@RULES
# Ex: PP&L
_companyPhrase [layer=(_Caps )] <- PP [s] \& [s] L [s] @@
@PRE
<1,1> cap();
@RULES
# Ex: PPG
_companyPhrase [layer=(_Caps )] <- PPG [s] @@
# Ex: Praxair
_companyPhrase [layer=(_Caps )] <- Praxair [s] @@
# Ex: Principal
_companyPhrase [layer=(_Caps )] <- Principal [s] @@
# Ex: Printing
_companyPhrase [layer=(_Caps )] <- Printing [s] @@
# Ex: Processing
_companyPhrase [layer=(_Caps )] <- Processing [s] @@
# Ex: Procter
_companyPhrase [layer=(_Caps )] <- Procter [s] @@
# Ex: Proctor
_companyPhrase [layer=(_Caps )] <- Proctor [s] @@
# Ex: Products
_companyPhrase [layer=(_Caps )] <- Products [s] @@
# Ex: Progress
_companyPhrase [layer=(_Caps )] <- Progress [s] @@
# Ex: Progressive
_companyPhrase [layer=(_Caps )] <- Progressive [s] @@
# Ex: Provident
_companyPhrase [layer=(_Caps )] <- Provident [s] @@
# Ex: Prudential
_companyPhrase [layer=(_Caps )] <- Prudential [s] @@
# Ex: Public
_companyPhrase [layer=(_Caps )] <- Public [s] @@
# Ex: Publix
_companyPhrase [layer=(_Caps )] <- Publix [s] @@
# Ex: Purina
_companyPhrase [layer=(_Caps )] <- Purina [s] @@
# Ex: Quaker
_companyPhrase [layer=(_Caps )] <- Quaker [s] @@
# Ex: Qualcomm
_companyPhrase [layer=(_Caps )] <- Qualcomm [s] @@
# Ex: Quantum
_companyPhrase [layer=(_Caps )] <- Quantum [s] @@
@PRE
<1,1> cap();
<3,3> cap();
@RULES
# Ex: R.R.
_companyPhrase [layer=(_Caps )] <- R [s] \. [s] R [s] \. [s] @@
@PRE
<1,1> cap();
@RULES
# Ex: Railway
_companyPhrase [layer=(_Caps )] <- Railway [s] @@
# Ex: Ralston
_companyPhrase [layer=(_Caps )] <- Ralston [s] @@
# Ex: Raytheon
_companyPhrase [layer=(_Caps )] <- Raytheon [s] @@
# Ex: Reebok
_companyPhrase [layer=(_Caps )] <- Reebok [s] @@
# Ex: Regions
_companyPhrase [layer=(_Caps )] <- Regions [s] @@
# Ex: Reliance
_companyPhrase [layer=(_Caps )] <- Reliance [s] @@
# Ex: Reliant
_companyPhrase [layer=(_Caps )] <- Reliant [s] @@
# Ex: Republic
_companyPhrase [layer=(_Caps )] <- Republic [s] @@
# Ex: Resorts
_companyPhrase [layer=(_Caps )] <- Resorts [s] @@
# Ex: Resources
_companyPhrase [layer=(_Caps )] <- Resources [s] @@
# Ex: Restaurants
_companyPhrase [layer=(_Caps )] <- Restaurants [s] @@
# Ex: Reynolds
_companyPhrase [layer=(_Caps )] <- Reynolds [s] @@
# Ex: Richfield
_companyPhrase [layer=(_Caps )] <- Richfield [s] @@
# Ex: Richfood
_companyPhrase [layer=(_Caps )] <- Richfood [s] @@
# Ex: Ricoh
_companyPhrase [layer=(_Caps )] <- Ricoh [s] @@
# Ex: Rite
_companyPhrase [layer=(_Caps )] <- Rite [s] @@
# Ex: RJR
_companyPhrase [layer=(_Caps )] <- RJR [s] @@
# Ex: Rockwell
_companyPhrase [layer=(_Caps )] <- Rockwell [s] @@
# Ex: Roebuck
_companyPhrase [layer=(_Caps )] <- Roebuck [s] @@
# Ex: Rohm
_companyPhrase [layer=(_Caps )] <- Rohm [s] @@
# Ex: Royal
_companyPhrase [layer=(_Caps )] <- Royal [s] @@
# Ex: RR
_companyPhrase [layer=(_Caps )] <- RR [s] @@
# Ex: Rubber
_companyPhrase [layer=(_Caps )] <- Rubber [s] @@
# Ex: Ryder
_companyPhrase [layer=(_Caps )] <- Ryder [s] @@
# Ex: Ryerson
_companyPhrase [layer=(_Caps )] <- Ryerson [s] @@
# Ex: Safeco
_companyPhrase [layer=(_Caps )] <- Safeco [s] @@
# Ex: Safeway
_companyPhrase [layer=(_Caps )] <- Safeway [s] @@
# Ex: SAI
_companyPhrase [layer=(_Caps )] <- SAI [s] @@
# Ex: Saks
_companyPhrase [layer=(_Caps )] <- Saks [s] @@
# Ex: Santa
_companyPhrase [layer=(_Caps )] <- Santa [s] @@
# Ex: Sara
_companyPhrase [layer=(_Caps )] <- Sara [s] @@
# Ex: SBC
_companyPhrase [layer=(_Caps )] <- SBC [s] @@
@PRE
<1,1> cap();
<3,3> cap();
@RULES
# Ex: Schering-Plough
_companyPhrase [layer=(_Caps )] <- Schering [s] \- [s] Plough [s] @@
@PRE
<1,1> cap();
@RULES
# Ex: Schlumberger
_companyPhrase [layer=(_Caps )] <- Schlumberger [s] @@
# Ex: Schwab
_companyPhrase [layer=(_Caps )] <- Schwab [s] @@
# Ex: SCI
_companyPhrase [layer=(_Caps )] <- SCI [s] @@
# Ex: Science
_companyPhrase [layer=(_Caps )] <- Science [s] @@
# Ex: Sciences
_companyPhrase [layer=(_Caps )] <- Sciences [s] @@
# Ex: Scotia
_companyPhrase [layer=(_Caps )] <- Scotia [s] @@
# Ex: Scottish
_companyPhrase [layer=(_Caps )] <- Scottish [s] @@
# Ex: Seagate
_companyPhrase [layer=(_Caps )] <- Seagate [s] @@
# Ex: Seagram
_companyPhrase [layer=(_Caps )] <- Seagram [s] @@
# Ex: Seal
_companyPhrase [layer=(_Caps )] <- Seal [s] @@
# Ex: Sears
_companyPhrase [layer=(_Caps )] <- Sears [s] @@
# Ex: Sekisui
_companyPhrase [layer=(_Caps )] <- Sekisui [s] @@
# Ex: Sempra
_companyPhrase [layer=(_Caps )] <- Sempra [s] @@
# Ex: SEPI
_companyPhrase [layer=(_Caps )] <- SEPI [s] @@
# Ex: Service
_companyPhrase [layer=(_Caps )] <- Service [s] @@
# Ex: ServiceMaster
_companyPhrase [layer=(_Caps )] <- ServiceMaster [s] @@
# Ex: Services
_companyPhrase [layer=(_Caps )] <- Services [s] @@
# Ex: Shamrock
_companyPhrase [layer=(_Caps )] <- Shamrock [s] @@
# Ex: Shaw
_companyPhrase [layer=(_Caps )] <- Shaw [s] @@
@PRE
<1,1> cap();
<3,3> cap();
@RULES
# Ex: Sherwin-Williams
_companyPhrase [layer=(_Caps )] <- Sherwin [s] \- [s] Williams [s] @@
@PRE
<1,1> cap();
@RULES
# Ex: Shimizu
_companyPhrase [layer=(_Caps )] <- Shimizu [s] @@
# Ex: Shopko
_companyPhrase [layer=(_Caps )] <- Shopko [s] @@
# Ex: SLM
_companyPhrase [layer=(_Caps )] <- SLM [s] @@
# Ex: Smithfield
_companyPhrase [layer=(_Caps )] <- Smithfield [s] @@
@PRE
<1,1> cap();
<3,3> cap();
@RULES
# Ex: Smurfit-Stone
_companyPhrase [layer=(_Caps )] <- Smurfit [s] \- [s] Stone [s] @@
@PRE
<1,1> cap();
@RULES
# Ex: Snow
_companyPhrase [layer=(_Caps )] <- Snow [s] @@
# Ex: Sodexho
_companyPhrase [layer=(_Caps )] <- Sodexho [s] @@
# Ex: Solectron
_companyPhrase [layer=(_Caps )] <- Solectron [s] @@
# Ex: Solutions
_companyPhrase [layer=(_Caps )] <- Solutions [s] @@
# Ex: Sonat
_companyPhrase [layer=(_Caps )] <- Sonat [s] @@
# Ex: SouthTrust
_companyPhrase [layer=(_Caps )] <- SouthTrust [s] @@
# Ex: SPAR
_companyPhrase [layer=(_Caps )] <- SPAR [s] @@
# Ex: Sprint
_companyPhrase [layer=(_Caps )] <- Sprint [s] @@
# Ex: Squibb
_companyPhrase [layer=(_Caps )] <- Squibb [s] @@
# Ex: Standard
_companyPhrase [layer=(_Caps )] <- Standard [s] @@
# Ex: Stanley
_companyPhrase [layer=(_Caps )] <- Stanley [s] @@
# Ex: Staples
_companyPhrase [layer=(_Caps )] <- Staples [s] @@
# Ex: Starwood
_companyPhrase [layer=(_Caps )] <- Starwood [s] @@
# Ex: State
_companyPhrase [layer=(_Caps )] <- State [s] @@
# Ex: States
_companyPhrase [layer=(_Caps )] <- States [s] @@
# Ex: Stationers
_companyPhrase [layer=(_Caps )] <- Stationers [s] @@
# Ex: Steam
_companyPhrase [layer=(_Caps )] <- Steam [s] @@
# Ex: Stearns
_companyPhrase [layer=(_Caps )] <- Stearns [s] @@
# Ex: Steel
_companyPhrase [layer=(_Caps )] <- Steel [s] @@
# Ex: Stora
_companyPhrase [layer=(_Caps )] <- Stora [s] @@
# Ex: Stores
_companyPhrase [layer=(_Caps )] <- Stores [s] @@
# Ex: Street
_companyPhrase [layer=(_Caps )] <- Street [s] @@
# Ex: Suiza
_companyPhrase [layer=(_Caps )] <- Suiza [s] @@
# Ex: Sumitomo
_companyPhrase [layer=(_Caps )] <- Sumitomo [s] @@
# Ex: Sun
_companyPhrase [layer=(_Caps )] <- Sun [s] @@
# Ex: Sunoco
_companyPhrase [layer=(_Caps )] <- Sunoco [s] @@
# Ex: SunTrust
_companyPhrase [layer=(_Caps )] <- SunTrust [s] @@
# Ex: Super
_companyPhrase [layer=(_Caps )] <- Super [s] @@
# Ex: Supermarkets
_companyPhrase [layer=(_Caps )] <- Supermarkets [s] @@
# Ex: Supervalu
_companyPhrase [layer=(_Caps )] <- Supervalu [s] @@
# Ex: Sysco
_companyPhrase [layer=(_Caps )] <- Sysco [s] @@
# Ex: System
_companyPhrase [layer=(_Caps )] <- System [s] @@
# Ex: Systems
_companyPhrase [layer=(_Caps )] <- Systems [s] @@
# Ex: Takashimaya
_companyPhrase [layer=(_Caps )] <- Takashimaya [s] @@
# Ex: Takenaka
_companyPhrase [layer=(_Caps )] <- Takenaka [s] @@
# Ex: Tandy
_companyPhrase [layer=(_Caps )] <- Tandy [s] @@
# Ex: Tea
_companyPhrase [layer=(_Caps )] <- Tea [s] @@
# Ex: Tech
_companyPhrase [layer=(_Caps )] <- Tech [s] @@
# Ex: Technologies
_companyPhrase [layer=(_Caps )] <- Technologies [s] @@
# Ex: Technology
_companyPhrase [layer=(_Caps )] <- Technology [s] @@
@PRE
<1,1> cap();
<3,3> cap();
@RULES
# Ex: Tele-Communications
_companyPhrase [layer=(_Caps )] <- Tele [s] \- [s] Communications [s] @@
@PRE
<1,1> cap();
@RULES
# Ex: Teledyne
_companyPhrase [layer=(_Caps )] <- Teledyne [s] @@
# Ex: Telstra
_companyPhrase [layer=(_Caps )] <- Telstra [s] @@
@PRE
<1,1> cap();
<3,3> cap();
@RULES
# Ex: Temple-Inland
_companyPhrase [layer=(_Caps )] <- Temple [s] \- [s] Inland [s] @@
@PRE
<1,1> cap();
@RULES
# Ex: Tenet
_companyPhrase [layer=(_Caps )] <- Tenet [s] @@
# Ex: Tenneco
_companyPhrase [layer=(_Caps )] <- Tenneco [s] @@
# Ex: Texaco
_companyPhrase [layer=(_Caps )] <- Texaco [s] @@
# Ex: Texas
_companyPhrase [layer=(_Caps )] <- Texas [s] @@
# Ex: Textron
_companyPhrase [layer=(_Caps )] <- Textron [s] @@
# Ex: Thermo
_companyPhrase [layer=(_Caps )] <- Thermo [s] @@
# Ex: TI
_companyPhrase [layer=(_Caps )] <- TI [s] @@
@PRE
<1,1> cap();
<3,3> cap();
@RULES
# Ex: TIAA-CREF
_companyPhrase [layer=(_Caps )] <- TIAA [s] \- [s] CREF [s] @@
@PRE
<1,1> cap();
@RULES
# Ex: Time
_companyPhrase [layer=(_Caps )] <- Time [s] @@
@PRE
<1,1> cap();
<3,3> cap();
@RULES
# Ex: Time-Warner
_companyPhrase [layer=(_Caps )] <- Time [s] \- [s] Warner [s] @@
@PRE
<1,1> cap();
@RULES
# Ex: Times
_companyPhrase [layer=(_Caps )] <- Times [s] @@
# Ex: Tire
_companyPhrase [layer=(_Caps )] <- Tire [s] @@
# Ex: TJX
_companyPhrase [layer=(_Caps )] <- TJX [s] @@
# Ex: Tohoku
_companyPhrase [layer=(_Caps )] <- Tohoku [s] @@
# Ex: Tokai
_companyPhrase [layer=(_Caps )] <- Tokai [s] @@
# Ex: Tool
_companyPhrase [layer=(_Caps )] <- Tool [s] @@
# Ex: Toronto
_companyPhrase [layer=(_Caps )] <- Toronto [s] @@
# Ex: Tosco
_companyPhrase [layer=(_Caps )] <- Tosco [s] @@
# Ex: Toys
_companyPhrase [layer=(_Caps )] <- Toys [s] @@
# Ex: Trans
_companyPhrase [layer=(_Caps )] <- Trans [s] @@
# Ex: Transamerica
_companyPhrase [layer=(_Caps )] <- Transamerica [s] @@
# Ex: Transportation
_companyPhrase [layer=(_Caps )] <- Transportation [s] @@
# Ex: Travel
_companyPhrase [layer=(_Caps )] <- Travel [s] @@
# Ex: Travelers
_companyPhrase [layer=(_Caps )] <- Travelers [s] @@
# Ex: Tribune
_companyPhrase [layer=(_Caps )] <- Tribune [s] @@
# Ex: Tricon
_companyPhrase [layer=(_Caps )] <- Tricon [s] @@
# Ex: TruServ
_companyPhrase [layer=(_Caps )] <- TruServ [s] @@
# Ex: Trust
_companyPhrase [layer=(_Caps )] <- Trust [s] @@
# Ex: TRW
_companyPhrase [layer=(_Caps )] <- TRW [s] @@
# Ex: Tull
_companyPhrase [layer=(_Caps )] <- Tull [s] @@
# Ex: Turner
_companyPhrase [layer=(_Caps )] <- Turner [s] @@
# Ex: TWA
_companyPhrase [layer=(_Caps )] <- TWA [s] @@
# Ex: Tyco
_companyPhrase [layer=(_Caps )] <- Tyco [s] @@
# Ex: Tyson
_companyPhrase [layer=(_Caps )] <- Tyson [s] @@
# Ex: UAL
_companyPhrase [layer=(_Caps )] <- UAL [s] @@
# Ex: Ultramar
_companyPhrase [layer=(_Caps )] <- Ultramar [s] @@
# Ex: Unicom
_companyPhrase [layer=(_Caps )] <- Unicom [s] @@
# Ex: Union
_companyPhrase [layer=(_Caps )] <- Union [s] @@
# Ex: Unisource
_companyPhrase [layer=(_Caps )] <- Unisource [s] @@
# Ex: Unisys
_companyPhrase [layer=(_Caps )] <- Unisys [s] @@
# Ex: United
_companyPhrase [layer=(_Caps )] <- United [s] @@
# Ex: Universal
_companyPhrase [layer=(_Caps )] <- Universal [s] @@
# Ex: Unocal
_companyPhrase [layer=(_Caps )] <- Unocal [s] @@
# Ex: Unum
_companyPhrase [layer=(_Caps )] <- Unum [s] @@
# Ex: Upjohn
_companyPhrase [layer=(_Caps )] <- Upjohn [s] @@
@PRE
<1,1> cap();
<3,3> cap();
@RULES
# Ex: UPM-Kymmene
_companyPhrase [layer=(_Caps )] <- UPM [s] \- [s] Kymmene [s] @@
@PRE
<1,1> cap();
@RULES
# Ex: UPS
_companyPhrase [layer=(_Caps )] <- UPS [s] @@
# Ex: USG
_companyPhrase [layer=(_Caps )] <- USG [s] @@
# Ex: Usinor
_companyPhrase [layer=(_Caps )] <- Usinor [s] @@
# Ex: USX
_companyPhrase [layer=(_Caps )] <- USX [s] @@
# Ex: UtiliCorp
_companyPhrase [layer=(_Caps )] <- UtiliCorp [s] @@
# Ex: Utilities
_companyPhrase [layer=(_Caps )] <- Utilities [s] @@
# Ex: Valero
_companyPhrase [layer=(_Caps )] <- Valero [s] @@
# Ex: Venator
_companyPhrase [layer=(_Caps )] <- Venator [s] @@
# Ex: Vencor
_companyPhrase [layer=(_Caps )] <- Vencor [s] @@
# Ex: Versand
_companyPhrase [layer=(_Caps )] <- Versand [s] @@
# Ex: VF
_companyPhrase [layer=(_Caps )] <- VF [s] @@
# Ex: Viacom
_companyPhrase [layer=(_Caps )] <- Viacom [s] @@
# Ex: Wachovia
_companyPhrase [layer=(_Caps )] <- Wachovia [s] @@
@PRE
<1,1> cap();
<3,3> cap();
@RULES
# Ex: Wal-Mart
_companyPhrase [layer=(_Caps )] <- Wal [s] \- [s] Mart [s] @@
@PRE
<1,1> cap();
@RULES
# Ex: Walgreen
_companyPhrase [layer=(_Caps )] <- Walgreen [s] @@
# Ex: Walt
_companyPhrase [layer=(_Caps )] <- Walt [s] @@
# Ex: Warner
_companyPhrase [layer=(_Caps )] <- Warner [s] @@
@PRE
<1,1> cap();
<3,3> cap();
@RULES
# Ex: Warner-Lambert
_companyPhrase [layer=(_Caps )] <- Warner [s] \- [s] Lambert [s] @@
@PRE
<1,1> cap();
@RULES
# Ex: Washington
_companyPhrase [layer=(_Caps )] <- Washington [s] @@
# Ex: Waste
_companyPhrase [layer=(_Caps )] <- Waste [s] @@
# Ex: Webber
_companyPhrase [layer=(_Caps )] <- Webber [s] @@
# Ex: WellPoint
_companyPhrase [layer=(_Caps )] <- WellPoint [s] @@
# Ex: Wells
_companyPhrase [layer=(_Caps )] <- Wells [s] @@
# Ex: Wesco
_companyPhrase [layer=(_Caps )] <- Wesco [s] @@
# Ex: Weston
_companyPhrase [layer=(_Caps )] <- Weston [s] @@
# Ex: Westvaco
_companyPhrase [layer=(_Caps )] <- Westvaco [s] @@
# Ex: Weyerhaeuser
_companyPhrase [layer=(_Caps )] <- Weyerhaeuser [s] @@
# Ex: Wheeler
_companyPhrase [layer=(_Caps )] <- Wheeler [s] @@
# Ex: Whirlpool
_companyPhrase [layer=(_Caps )] <- Whirlpool [s] @@
# Ex: Wholesale
_companyPhrase [layer=(_Caps )] <- Wholesale [s] @@
# Ex: Widows
_companyPhrase [layer=(_Caps )] <- Widows [s] @@
# Ex: Wiederaufbau
_companyPhrase [layer=(_Caps )] <- Wiederaufbau [s] @@
# Ex: Willamette
_companyPhrase [layer=(_Caps )] <- Willamette [s] @@
# Ex: Williams
_companyPhrase [layer=(_Caps )] <- Williams [s] @@
@PRE
<1,1> cap();
<3,3> cap();
@RULES
# Ex: Winn-Dixie
_companyPhrase [layer=(_Caps )] <- Winn [s] \- [s] Dixie [s] @@
@PRE
<1,1> cap();
@RULES
# Ex: Witter
_companyPhrase [layer=(_Caps )] <- Witter [s] @@
# Ex: Woolworths
_companyPhrase [layer=(_Caps )] <- Woolworths [s] @@
# Ex: Works
_companyPhrase [layer=(_Caps )] <- Works [s] @@
# Ex: World
_companyPhrase [layer=(_Caps )] <- World [s] @@
# Ex: WorldCom
_companyPhrase [layer=(_Caps )] <- WorldCom [s] @@
# Ex: Xerox
_companyPhrase [layer=(_Caps )] <- Xerox [s] @@
# Ex: Yahoo
_companyPhrase [layer=(_Caps )] <- Yahoo [s] @@
# Ex: Yasuda
_companyPhrase [layer=(_Caps )] <- Yasuda [s] @@
# Ex: Yellow
_companyPhrase [layer=(_Caps )] <- Yellow [s] @@
# Ex: York
_companyPhrase [layer=(_Caps )] <- York [s] @@
# Ex: Zeneca
_companyPhrase [layer=(_Caps )] <- Zeneca [s] @@
# Ex: Zentrale
_companyPhrase [layer=(_Caps )] <- Zentrale [s] @@
@PRE
<1,1> cap();
<3,3> cap();
@RULES
# Ex: Employment\_Agency
_companyPhrase [layer=(_Caps )] <- Employment [s] _xWHITE [star s] Agency [s] @@
# Ex: Marine\_Corps
_companyPhrase [layer=(_Caps )] <- Marine [s] _xWHITE [star s] Corps [s] @@
|
# Set the UNSEALED attribute of the numth node to "true" or "false"
@POST
setunsealed(1,"true"); # Allows _sentence nodes to be examined by a subsequent pass that uses @NODES.
@RULES
_xNIL <- _sentence @@ |
@CODE
L("hello") = 0;
@@CODE
@PATH _ROOT _TEXTZONE _sent
@POST
if (N("sem texts") && N("sem vals"))
{
"output.txt" << "TEXT= " << phrasetext() << "\n";
L("ii") = 0;
L("max") = arraylength(N("sem texts"));
L("key") = N("sem texts");
L("val") = N("sem vals");
while (L("ii") < L("max"))
{
"output.txt" << strtoupper(L("key")[L("ii")])
<< "\t"
<< L("val")[L("ii")]
<< "\n"
;
++L("ii");
}
}
@RULES
_xNIL <-
_clause
@@
|
@PATH _ROOT _XMLDecl
@RULES
_Comment <-
_CommentStart
_xWILD [min=0 max=0 fail=("_CommentEnd" "_CommentEnd" "_DoubleHyphen")]
_CommentEnd
@@
_VersionInfo <-
_whiteSpace [opt]
_xWILD [s trig one matches=("version")]
_whiteSpace [opt]
\=
_whiteSpace [opt]
_PubidLiteral
@@
_VersionInfo <-
_whiteSpace [opt]
_xWILD [s trig one matches=("version")]
_whiteSpace [opt]
\=
_whiteSpace [opt]
_SystemLiteral
@@
_EncodingDecl <-
_whiteSpace [opt]
_xWILD [s trig one matches=("encoding")]
_whiteSpace [opt]
\=
_whiteSpace [opt]
_PubidLiteral
@@
_EncodingDecl <-
_whiteSpace [opt]
_xWILD [s trig one matches=("encoding")]
_whiteSpace [opt]
\=
_whiteSpace [opt]
_SystemLiteral
@@
_SDDecl <-
_whiteSpace [opt]
_xWILD [s trig one matches=("standalone")]
_whiteSpace [opt]
\=
_whiteSpace [opt]
_PubidLiteral
@@
_SDDecl <-
_whiteSpace [opt]
_xWILD [s trig one matches=("standalone")]
_whiteSpace [opt]
\=
_whiteSpace [opt]
_SystemLiteral
@@
@POST
noop() ;
@@POST
@RULES
_xNIL <- _whiteSpace
@@
@@RULES
@RULES
@POST
"output.txt" << "Error: extra characters in XML declaration" ;
noop() ;
@@POST
@RULES
_xNIL <- _xALPHA @@
@@RULES
|
@NODES _labelEntry
@POST
AddPhrase(N(2));
"debug.txt" << N("$text", 2) << "\n";
@RULES
_xNIL <-
_xSTART ### (1)
_xWILD [one match=(_xALPHA _xNUM)] ### (2)
@@
|
@NODES _ROOT
# Acronyms/initialisms are all uppercase
@PRE
<1,1> var("upper");
@POST
# Do lookup here.
@RULES
_xNIL <-
_xANY ### (1)
@@
# Abbreviations (Start with cap)
@PRE
<1,1> var("cap");
@POST
# Do lookup here.
@RULES
_xNIL <-
_xANY ### (1)
@@ |
@NODES _ROOT
@RULES
_rest <-
_xWILD [fail=(_td)] ### (1)
@@
|
@CODE
# Find abbrevations in caps
sortchilds(G("caps"));
L("cap") = down(G("caps"));
while (L("cap")) {
L("abr") = GetAbbreviation(conceptname(L("cap")));
if (strval(L("cap"),"type") == "full") {
"abbr.txt" << conceptname(L("cap")) << " => " << L("abr") << "\n";
L("abbr") = down(G("caps"));
while (L("abbr")) {
if (strval(L("abbr"),"type") == "abbrev" && !strval(L("cap"),"full")) {
if (conceptname(L("abbr")) == L("abr")) {
"abbr.txt" << " " << conceptname(L("abbr")) << " => " << conceptname(L("cap")) << "\n";
addconval(L("abbr"),"full",L("cap"));
}
}
L("abbr") = next(L("abbr"));
}
}
L("cap") = next(L("cap"));
}
@@CODE |
@NODES _ROOT
@PRE
<1,1> numrange(1,12);
<3,3> numrange(1,31);
<5,5> numrange(1900,2050);
@POST
S("month") = num(N("$text",1));
S("day") = num(N("$text",3));
S("year") = num(N("$text",5));
single();
@RULES
_date <-
_xNUM ### (1)
_xWILD [match=(\- \/)] ### (2)
_xNUM ### (3)
_xWILD [match=(\- \/)] ### (2)
_xNUM ### (5)
@@
@POST
S("value") = N("$text",2) + N("$text",4) + N("$text",6) + "." + N("$text",8);
single();
@RULES
_money <-
\$ ### (1)
_xNUM ### (2)
\, ### (3)
_xNUM ### (4)
\, ### (5)
_xNUM ### (6)
\. ### (7)
_xNUM ### (8)
@@
@POST
S("value") = N("$text",2) + N("$text",4) + "." + N("$text",6);
single();
@RULES
_money <-
\$ ### (1)
_xNUM ### (2)
\, ### (3)
_xNUM ### (4)
\. ### (5)
_xNUM ### (6)
@@
@POST
S("value") = N("$text",2) + "." + N("$text",4);
single();
@RULES
_money <-
\$ ### (1)
_xNUM ### (2)
\. ### (3)
_xNUM ### (4)
@@
@POST
S("value") = N("$text",1);
single();
@RULES
_money <-
\$ ### (1)
_xNUM ### (2)
@@
@POST
S("numeric") = num(N("numeric",1)) + num(N("numeric",3));
single();
@RULES
_number <-
_number ### (1)
\- ### (2)
_number ### (3)
@@
|
@MULTI _ROOT
@CHECK
if (N(1)) {
fail();
}
if (pnname(X()) == "_item") {
fail();
}
@@CHECK
@POST
singler(4,4);
@@POST
@RULES
_endSent <-
_endSent [opt]
_xWILD [one fails=(_endSent)] ### (1)
_xWILD [one fails=(_endSent)]
_xWILD [one trig match=(\. \?)] ### (2)
_xWILD [one match=(_xWHITE _xEND _xCTRL)] ### (3)
@@ |
@CODE
L("hello") = 0;
@@CODE
@NODES _TEXTZONE
@POST
if (N("sent end",3))
S("sent end") = N("sent end",3);
if (pnname(N(3)) == "_qEOS")
{
setlookahead(3);
singler(1,2);
}
else # _EOS
singler(1,3); # Include the _EOS node.
@RULES
_sent [unsealed] <-
_xWILD [one fail=(_qEOS \" \( \< \[ _EOS)]
_xWILD [star fail=(_qEOS _EOS)]
_xWILD [one match=(_qEOS _EOS)]
_xWILD [star match=( \) \] \> \" \' )]
@@
@POST
noop();
@RULES
_xNIL <- _xWILD [plus match=(
\" \[ \( \< _qEOS \) \] \> _EOS
)] @@
@RULES
_sent [unsealed] <-
_xANY [plus]
@@
|
@CODE
DisplayKB(G("body"),0);
@@CODE |
@DECL
Spaces(L("num"), L("spaces")) {
while (L("i") < L("num")) {
L("str") = L("str") + L("spaces");
L("i")++;
}
return L("str");
}
@@DECL |
# Invoke a recursive rules pass on nodes that matched the current rule element
@RULES
_tag <- \< _xWILD [passes=(tagrules)]
\> @@ |
@CODE
L("hello") = 0;
@@CODE
@NODES _ROOT
# First paragraph.
@PRE
<4,4> varz("PAR");
@POST
singler(3,4);
@RULES
_TEXTZONE [unsealed] <-
_xSTART
_header
_LINE
_LINE [star]
@@
@PRE
<1,1> var("PAR");
<2,2> varz("PAR");
@RULES
_TEXTZONE [unsealed] <-
_LINE
_LINE [star]
@@
# Excise blank lines.
@POST
excise(1,1);
@RULES
_xNIL <-
_xWILD [plus match=(_BLANKLINE _xWHITE)]
@@
|
@CODE
###############################################
# Load KB's, storing references to concepts
# as global variables
###############################################
#Define split to run on here.
G("split") = "rare";
G("mimic_split_codes") = getconcept(findroot(),"mimic_splits");
G("acronyms") = getconcept(findroot(), "acronyms");
L("code_to_euis") = getconcept(findroot(), "code_to_euis");
G("code_to_euis") = getconcept(L("code_to_euis"), G("split"));
L("eui_to_codes") = getconcept(findroot(), "eui_to_codes");
G("eui_to_codes") = getconcept(L("eui_to_codes"), G("split"));
L("P_eui") = getconcept(findroot(), "euiprobs");
G("P_eui") = getconcept(L("P_eui"), G("split"));
G("eui_to_base_term") = getconcept(findroot(), "eui_to_base_term");
G("eui_to_base_term") = getconcept(G("eui_to_base_term"), "euis");
DisplayKB(G("P_eui"), 2);
###############################################
# Create concepts in KB to store prediction
# information
###############################################
# We will use this to store a list of keywords we have found in this discharge summary
G("note_words") = getconcept(findroot(),"note_words");
if (!G("note_words")) {
G("note_words") = makeconcept(findroot(), "note_words");
}
rmchildren(G("note_words"));
# Store our final code predictions
G("pred_codes") = getconcept(findroot(),"pred_codes");
if (!G("pred_codes")) {
G("pred_codes") = makeconcept(findroot(), "pred_codes");
}
rmchildren(G("pred_codes"));
# G("top_preds") = getconcept(G("pred_codes"),"top");
# if (!G("top_preds")) {
# G("top_preds") = makeconcept(G("pred_codes"), "top");
# }
# rmchildren(G("top_preds"));
# G("pred_diagnoses") = getconcept(G("pred_codes"),"pred_diagnoses");
# if (!G("pred_codes")) {
# G("pred_diagnoses") = makeconcept(G("pred_codes"), "pred_diagnoses");
# }
# rmchildren(G("pred_diagnoses"));
@@CODE |
@PATH _ROOT _AttlistDecl
@RULES
_AttType [unsealed] <-
_xWILD [s one matches=("NOTATION")] ### (1)
_whiteSpace [opt] ### (2)
\( [one] ### (3)
_whiteSpace [opt] ### (4)
_xWILD [s one matches=("_xALPHA" "_" ":")] ### (5)
_xWILD [s star matches=("_xALPHA" "_xNUM" "." "-" "_" ":")] ### (6)
_xWHITE [opt] ### (7)
_EnumNameElement [star] ### (8)
\) [one] ### (9)
@@
_AttType [unsealed] <-
\( [one] ### (1)
_whiteSpace [opt] ### (2)
_xWILD [s plus matches=("_xALPHA" "_xNUM" "." "-" "_" ":")] ### (3)
_whiteSpace [opt] ### (4)
_EnumElement [star] ### (5)
\) [one] ### (6)
@@
_AttType [unsealed] <-
\( [one] ### (1)
_whiteSpace [opt] ### (2)
_xWILD [s plus matches=("_xALPHA" "_xNUM" "." "-" "_" ":")] ### (3)
_whiteSpace [opt] ### (4)
_EnumNameElement [star] ### (5)
\) [one] ### (6)
@@
|
@CODE
G("words") = getconcept(findroot(),"words");
@@CODE |
# Too general a rule. #
@NODES _LINE
@RULES
_possessive <-
_xALPHA [s]
\' [s]
s [s]
@@
|
@NODES _LINE
@POST
excise(4,5);
excise(1,2);
@RULES
_xNIL <-
\[ ### (1)
\[ ### (2)
_xWILD [plus fail=(\])] ### (3)
\] ### (4)
\] ### (5)
@@
|
@POST
rfaregions(1)
single()
@RULES
_REGIONS [base] <- _REGION [plus] @@
|
@NODES _paragraph
@POST
splice(1,1);
@RULES
_xNIL <-
_LINE ### (1)
@@
|
# Find the root of the kb
G("the root") = findroot(); |
@CODE
if (!G("pretagged"))
exitpass();
@@CODE
@NODES _ROOT
@RULES
_LINE <-
_xWILD [plus fail=(_BLANKLINE _HRULE)]
@@
|
@NODES _LINE
@PRE
<1,1> cap();
<1,1> length(12);
@RULES
# Ex: Publications
_PublicationsHeaderWord [layer=(_headerWord )] <- _xWILD [min=1 max=1 s match=("Publications")] @@
|
@NODES _TEXTZONE
@POST
splice(1,1);
@RULES
_xNIL <-
_headerZone ### (1)
@@
|
@PATH _ROOT _posZone _defZone _definition _headerZone _LINE _item
@POST
L("con") = makeconcept(X("con",3),"text");
addstrval(L("con"),"defText",N("$text",1));
singler(1,1);
@RULES
_text <-
_xWILD [plus fail=(\; _xEND)] ### (1)
\; ### (2)
@@
|
@PATH _ROOT _LINE
# So putting in the check. If calc hasn't been done yet, do it.
@CHECK
# !N("city conf");
if (N("city conf"))
fail();
@POST
# if (!N("len"))
# print out no length.
# Treating confidences independently, but keep track of
# ambiguity in the phrase.
# Need NLP++ looping to add evidence three times, eg.
if (N("len") == 1)
{
### ASSESS AS CITY NAME.
if (N("cityMods"))
N("city conf") = 0; # Single word like "city".
else if (N("unknowns"))
N("city conf") = 50; # Some single unknown word.
else
N("city conf") = 0;
}
# Clear noncities.
else if # Multi-word but noncity head word, etc..
(N("end companyroot")
|| N("end schoolroot")
|| N("end field")
|| N("end jobtitleroot"))
{
N("city conf") = 0; # 01/03/00 AM.
}
else # If multi-word phrase.
{
### ASSESS AS CITY NAME.
if (N("end citymod"))
N("city conf") = N("city conf") %% 90;
if (N("start citymod"))
N("city conf") = N("city conf") %% 80;
if (N("citymods") - N("start citymod") - N("end citymod"))
N("city conf") = N("city conf") %% 70;
if (N("geos")) # city,state, or country in here.
N("city conf") = 95;
if (N("unknowns") && (N("unknowns") <= 2))
N("city conf") = N("city conf") %% (N("unknowns") * 30);
if (N("fields"))
N("city conf") = N("city conf") %% -90; # Must be real sure.
if (N("puncts"))
N("city conf") = N("city conf") %% -90; # 01/11/00 AM.
# Disallowing this if the caps is too long, etc.
if (N("len") > 2 || N("capofcap") || N("capandcap"))
N("city conf") = 0;
}
# Update overall confidences for this phrase.
if (N("city conf") >= G("threshold"))
++N("ambigs"); # Another possible sense of cap phrase.
if (N("city conf") > N("hi conf")) # New high.
{
N("hi conf") = N("city conf");
N("hi class") = "city"; # Best so far.
}
@RULES
_xNIL <- _Caps @@
|
@NODES _termEntry
@POST
addConceptPhrase(N(1), X("entry"));
@RULES
_xNIL <-
_base ### (1)
@@
|
@CODE
#Rationals/floats
L("x") = 3;
L("y") = 2;
L("x/y") = L("x") * L("y");
"math_output.txt" << "x=" << L("x") << " * y=" << L("y") << " => " << L("x/y") << "\n";
L("x") = 3.0;
L("y") = 2.0;
L("x/y") = L("x") / L("y");
"math_output.txt" << "x=" << L("x") << " / y=" << L("y") << " => " << L("x/y") << "\n";
L("x") = 3;
L("y") = 2;
L("x/y") = flt(L("x")) / flt(L("y"));
"math_output.txt" << "x=" << L("x") << " / y=" << L("y") << " => " << L("x/y") << "\n";
L("x^y") = ("x");
"math_output.txt" << "x" << L("x") << " && y=" << L("y") << " => " << L("x^y") << "\n";
# L("e") = e();
# "math_output.txt" << L("e") << "\n";
# L("x") = 3;
# L("y") = 2;
# L("x^y") = pow(L("x"), L("y"));
# "math_output.txt" << "x=" << L("x") << " ^ y=" << L("y") << " => " << L("x^y") << "\n";
# L("x") = 3;
# L("y") = 0;
# L("x^y") = pow(L("x"), L("y"));
# "math_output.txt" << "x=" << L("x") << " ^ y=" << L("y") << " => " << L("x^y") << "\n";
# L("x") = 2;
# L("y") = -3;
# L("x^y") = pow(L("x"), L("y"));
# "math_output.txt" << "x=" << L("x") << " ^ y=" << L("y") << " => " << L("x^y") << "\n";
# L("x") = -3;
# L("y") = 3;
# L("x^y") = pow(L("x"), L("y"));
# "math_output.txt" << "x=" << L("x") << " ^ y=" << L("y") << " => " << L("x^y") << "\n";
# L("x") = 9;
# L("rtx") = sqrt(L("x"));
# "math_output.txt" << "x=" << L("x") << " => " << L("rtx") << "\n";
# L("x") = 2;
# L("rtx") = sqrt(L("x"));
# "math_output.txt" << "x=" << L("x") << " => " << L("rtx") << "\n";
# L("x") = 2;
# L("exp") = exp(L("x"));
# "math_output.txt" << "x=" << L("x") << " => " << L("exp") << "\n";
# L("x") = 0.
# L("y") = 1.
# L("z") = str(L("x")) + str(L("y"));
# "math_output.txt" << "x=" << L("x") << " + y = " << L("y") << " => " << L("z") << "\n";
# L("kb") = makeconcept(findroot(), "con_1");
# L("con_2") = makeconcept(L("kb"), "con_2");
# L("con_2") = makeconcept(L("kb"), "con_2");
# L("attr") = addattr(L("con_2"), "float");
# replaceval(L("con_2"),"float",3.14);
# DisplayKB(L("kb"), 1);
# L("flt") = 0.
# L("int") = L("flt") *
# L("str") = str(L("int"));
# L("s") = split(L("str"), ".");
# L("s") = num(L("s")[0]);
# # L("converted") = flt(L("str"));
# "math_output.txt" << L("flt") << "\n";
# "math_output.txt" << L("int") << "\n";
# "math_output.txt" << L("s") << "\n";
# # "math_output.txt" << str(L("int")) << "\n";
# # If the attribute has not been created yet, addsval will create it.
# # Sometimes it is convenient to treat a number like a string. In this case, you can perform numeric operations in the number field of this function, but then have the result stored in the KB as a string.
@@CODE |
@NODES _ROOT
@PRE
<1,1> var("word");
<1,1> var("male");
<1,1> varz("female");
@POST
"output.txt" << N("word") << " male\n";
@RULES
_xNIL <-
_LINE ### (1)
@@
|
@PATH _ROOT
@POST
S("x-coordinate") = num(N("$text",2));
S("y-coordinate") = num(N("$text",4));
S("sem") = "location";
single();
@RULES
_coord [layer=_noun] <-
\( [s]
_xNUM [s]
\, [s]
_xNUM [s]
\) [s]
@@
@CHECK
if (N(5) && N("$length",5) != 3)
fail();
if (N("$length",3) != 3)
fail();
@POST
S("val") = num(N("$text",1)) * 1000.0
+ num(N("$text",3));
if (N(5))
S("val") = S("val") * 1000.0
+ num(N("$text",5));
single();
@RULES
_num <-
_xNUM [s]
\, [s]
_xNUM [s]
\, [s opt]
_xNUM [s opt]
@@
@RULES
_num <-
_xWILD [s min=4 match=(_xNUM)]
@@
_num <-
_xNUM [s]
\. [s]
_xNUM [s]
@@
@POST
S("num") = num(N("$text",1));
# Need float for the larger ones. Need MAXINT test...
single();
@RULES
_num <-
_xNUM [s]
th [s]
@@
_noun <-
_xNUM [s]
\' [s]
s [s]
@@
@POST
S("num") = 1;
pncopyvars(1);
single();
@RULES
_num <- one [s] @@
_num <- first [s] @@
_num <- 1 [s] st [s] @@
@POST
S("num") = 2;
pncopyvars(1);
single();
@RULES
_num <- two [s] @@
_num <- second [s] @@
_num <- 2 [s] nd [s] @@
@POST
S("num") = 3;
pncopyvars(1);
single();
@RULES
_num <- three [s] @@
_num <- third [s] @@
_num <- 3 [s] rd [s] @@
@POST
pncopyvars(1);
S("num") = 4;
single();
@RULES
_num <- four [s] @@
_num <- fourth [s] @@
@POST
pncopyvars(1);
S("num") = 5;
single();
@RULES
_num <- five [s] @@
_num <- fifth [s] @@
@POST
pncopyvars(1);
S("num") = 6;
single();
@RULES
_num <- six [s] @@
_num <- sixth [s] @@
@POST
pncopyvars(1);
S("num") = 7;
single();
@RULES
_num <- seven [s] @@
_num <- seventh [s] @@
@POST
pncopyvars(1);
S("num") = 8;
single();
@RULES
_num <- eight [s] @@
_num <- eighth [s] @@
@POST
pncopyvars(1);
S("num") = 9;
single();
@RULES
_num <- nine [s] @@
_num <- ninth [s] @@
@POST
S("num") = 10;
single();
@RULES
_num <- ten [s] @@
_num <- tenth [s] @@
@POST
S("num") = 11;
single();
@RULES
_num <- eleven [s] @@
_num <- eleventh [s] @@
@POST
S("num") = 12;
single();
@RULES
_num <- twelve [s] @@
_num <- twelfth [s] @@
@POST
S("num") = 13;
single();
@RULES
_num <- thirteen [s] @@
_num <- thirteenth [s] @@
@POST
S("num") = 14;
single();
@RULES
_num <- fourteen [s] @@
_num <- fourteenth [s] @@
@POST
S("num") = 15;
single();
@RULES
_num <- fifteen [s] @@
_num <- fifteenth [s] @@
@POST
S("num") = 16;
single();
@RULES
_num <- sixteen [s] @@
_num <- sixteenth [s] @@
@POST
S("num") = 17;
single();
@RULES
_num <- seventeen [s] @@
_num <- seventeenth [s] @@
@POST
S("num") = 18;
single();
@RULES
_num <- eighteen [s] @@
_num <- eighteenth [s] @@
@POST
S("num") = 19;
single();
@RULES
_num <- nineteen [s] @@
_num <- nineteenth [s] @@
@POST
S("num") = 20;
single();
@RULES
_num <- twenty [s] @@
_num <- twentieth [s] @@
@POST
S("num") = 30;
single();
@RULES
_num <- thirty [s] @@
_num <- thirtieth [s] @@
@POST
S("num") = 40;
single();
@RULES
_num <- forty [s] @@
_num <- fortieth [s] @@
@POST
S("num") = 50;
single();
@RULES
_num <- fifty [s] @@
_num <- fiftieth [s] @@
@POST
S("num") = 60;
single();
@RULES
_num <- sixty [s] @@
_num <- sixtieth [s] @@
@POST
S("num") = 70;
single();
@RULES
_num <- seventy [s] @@
_num <- seventieth [s] @@
@POST
S("num") = 80;
single();
@RULES
_num <- eighty [s] @@
_num <- eightieth [s] @@
@POST
S("num") = 90;
single();
@RULES
_num <- ninety [s] @@
_num <- ninetieth [s] @@
@POST
S("num") = 100;
single();
@RULES
_num <- hundred [s] @@
_num <- hundredth [s] @@
@POST
S("num") = 1000;
single();
@RULES
_num <- thousand [s] @@
_num <- thousandth [s] @@
@POST
S("num") = 1000000;
single();
@RULES
_num <- million [s] @@
_num <- millionth [s] @@
@POST
S("num") = 1000000000;
single();
@RULES
_num <- billion [s] @@
_num <- billionth [s] @@
@POST
S("num") = 1000000000000.0;
single();
@RULES
_num <- trillion [s] @@
_num <- trillionth [s] @@
|
@NODES _sentence
@POST
excise(1,1);
noop();
@RULES
_xNIL <-
_xWHITE [s] ### (1)
@@
|
@CODE
DisplayKB(G("numbers"),0);
@@CODE |
###############################################
# FILE: XML tagStructure.pat #
# SUBJ: Put together segments bounded by #
# XML tags #
# AUTH: Paul Deane #
# CREATED: 14/Jan/01
# DATE OF THIS VERSION: 31/Aug/01 #
# Copyright
###############################################
@NODES _ROOT _Element
@CHECK
#XML tags have to match
if (!strequal(N("tagName",1),N("tagName",3))) {
"output.txt" << "XML error: mismatched tags\n";
fail() ;
}
@@CHECK
@POST
#make sure our current tag is registered in our DTD info
S("tagName") = str(N("tagName",1)) ;
G("CurrentChildTag") = lasteltnode(2) ;
G("Continue") = 1 ;
G("PlaceInKB") = findconcept(G("Elements"),S("tagName")) ;
while (G("Continue") != 0 ) {
G("CurrentChildTagName") = pnvar(G("CurrentChildTag"),"tagName") ;
G("nextC") = pnprev(G("CurrentChildTag")) ;
if (G("nextC")==0) {
G("Continue") = 0 ;
}
else if (G("CurrentChildTagName") == 0 ) {
G("CurrentChildTag") = G("nextC") ;
}
else if ( strequal(S("tagName"),G("CurrentChildTagName"))
) {
G("Continue") = 0 ;
}
else {
if (G("CurrentChildTagName") != 0 ) {
G("ChildPlaceInKB") = findconcept(G("PlaceInKB"),G("CurrentChildTagName"));
if (G("ChildPlaceInKB")==0) {
makeconcept(G("PlaceInKB"),G("CurrentChildTagName"));
}
}
G("CurrentChildTag") = G("nextC") ;
}
}
single() ;
@@POST
@RULES
_Element <-
_StartingTag [one] ### (1)
_xWILD [star fails=("_ClosingTag" "_StartingTag")] ### (2)
_ClosingTag [one] ### (3)
@@
@@RULES
|
@NODES _LINE
@POST
excise(1,1);
noop();
@RULES
_xNIL <-
_xWHITE ### (1)
@@
|
@PATH _ROOT _bodyZone _trZone _tdZone
@POST
L("name") = "_" + N("$text",3) + "Close";
group(1,4,L("name"));
@RULES
_xNIL <-
\< ### (1)
\/ ### (2)
strong ### (3)
\> ### (4)
@@
@POST
L("name") = "_" + N("$text",2);
group(1,4,L("name"));
@RULES
_xNIL <-
\< ### (1)
strong ### (2)
_xWILD [fail=(\>)] ### (3)
\> ### (4)
@@
|
@DECL
# Concatenate
# Concatenates two non-empty arrays
#
# Args: Two non-empty arrayd
# Returns: concatenated array
Concatenate(L("arr_1"), L("arr_2")) {
L("new_arr") = L("arr_1");
L("idx") = 0;
while (L("idx") < arraylength(L("arr_2"))) {
L("new_arr")[arraylength(L("new_arr"))] = L("arr_2")[L("idx")];
L("idx")++;
}
return L("new_arr");
}
# Swap
# Swap elements at first and second indices in array
#
# Args:
# L("arr") = Non-empty array
# L("first_idx") = Index of first element to swap
# L("second_idx") = Index of second element to swap
#
# Returns: Array with swapped elements
#
# Note that indices must be < array len
Swap(L("arr"), L("first_idx"), L("second_idx")) {
L("temp") = L("arr")[L("first_idx")];
L("arr")[L("first_idx")] = L("arr")[L("second_idx")];
L("arr")[L("second_idx")] = L("temp");
return L("arr");
}
# Quicksort wrapper to handle indices, since this can be a challenge.
# Use QuickSortPartition for subarray
QuickSort(L("arr")) {
if (arraylength(L("arr")) <= 1) {
return L("arr");
}
L("start") = 0;
L("end") = arraylength(L("arr")) - 1;
return QuickSortPartition(L("arr"), L("start"), L("end"));
}
# QuickSortPartition
# Performs quicksort on array from <low> to <high>
#
# Args:
# L("arr"): Array to sort
# L("low"): Starting index of array
# L("high"): Upper index of array
#
# Returns:
# Sorted array
#
# N.B. low and high must be >=0 and < array len
QuickSortPartition(L("arr"), L("low"), L("high")) {
if (L("low") < L("high")) {
# Get pivot index
L("pivot") = L("arr")[L("high")];
L("i") = L("low") - 1;
L("j") = L("low");
while (L("j") < L("high")) {
if (L("arr")[L("j")] <= L("pivot")) {
L("i")++;
L("arr") = Swap(L("arr"), L("i"), L("j"));
}
L("j")++;
}
L("arr") = Swap(L("arr"), L("i")+1, L("high"));
L("pivot") = L("i") + 1;
# Sort each partition of array recursively
L("arr") = QuickSortPartition(L("arr"), L("low"), L("pivot")-1);
L("arr") = QuickSortPartition(L("arr"), L("pivot")+1, L("high"));
# Return concatenated array
# L("sorted") = L("left_arr");
# L("sorted")[arraylength(L("sorted"))] = L("pivot");
# return ConcatArrays(L("sorted"), L("right_arr"));
}
return L("arr");
}
# Naive tokenization function
GetTokens(L("str")) {
L("new_str");
L("str") = strsubst(L("str"), "n't", " not");
L("str") = strclean(L("str"));
L("i") = 0;
while (L("i") < strlength(L("str"))) {
L("char") = strchar(L("str"), L("i"));
L("char_to_add");
if (strisalpha(L("char")) || L("char") == " ") {
L("char_to_add") = L("char");
}
else {
L("char_to_add") = " ";
}
if (!L("new_str")) {
L("new_str") = L("char_to_add");
}
else{
L("new_str") = L("new_str") + L("char_to_add");
}
L("i")++;
}
L("tokens") = split(L("new_str"), " ");
L("return");
L("j") = 0;
"debug.txt" << arraylength(L("tokens")) << "\n";
"debug.txt" << L("new_str") << "\n";
"debug.txt" << L("str") << "\n";
while (L("j") < arraylength(L("tokens"))) {
L("this_str") = L("tokens")[L("j")];
if (L("this_str")) {
L("this_str") = strclean(L("this_str"));
L("this_str") = strtolower(L("this_str"));
if ((strlength(L("this_str")) > 2) && (spellword(L("this_str")))) {
L("return")[arraylength(L("return"))] = stem(L("this_str"));
}
}
L("j")++;
}
return L("return");
}
# GetUniqueWords
# Args:
# L("str"): Input string to get words from
#
#
# Should take parsetree node as well
# GetUniqueStrWords(L("str")) {
# # Assumes non-tokenized string
# L("str")
# if (L("vocab")) {
# for L("")
# }
# # }
# Binary Search
# Args
# arr: sorted array in which to search
BinarySearchPartition(L("arr"), L("low"), L("high"), L("val")) {
"binary.txt" << "low: " << L("low") << " high: " << L("high") << "\n";
if (L("low") > L("high")) {
return -1;
}
# if (L("low") == L("high")) {
# if (L("arr")[L("low")] == L("val")) {
# return L("low");
# }
# return -1;
# }
L("mid") = (L("high") + L("low")) / 2;
"binary.txt" << "mid: " << L("mid") << "\n";
if (L("arr")[L("mid")] == L("val")) {
return L("mid");
}
else if (L("val") < L("arr")[L("mid")]) {
L("high") = L("mid") - 1;
return BinarySearchPartition(L("arr"), L("low"), L("high"), L("val"));
}
else {
L("low") = L("mid") + 1;
return BinarySearchPartition(L("arr"), L("low"), L("high"), L("val"));
}
}
# Binary Search
# Args
# arr: sorted array to search
# val: value to search for
#
# Returns
# integer: -1 if not in array, otherwise idx in array
BinarySearch(L("arr"), L("val")) {
L("len") = arraylength(L("arr"));
L("low") = 0;
if (L("len") == 1) {
if (L("arr")[L("low")] == L("val")) {
return 0;
}
else {
return -1;
}
}
return BinarySearchPartition(L("arr"), L("low"), L("len")-1, L("val"));
}
FilterDuplicates(L("arr"), L("sorted")) {
L("len") = arraylength(L("arr"));
if (L("len") <= 1) {
return L("arr");
}
L("i") = 0;
if (!L("sorted")) {
L("sorted_arr") = QuickSort(L("arr"));
}
else {
L("sorted_arr") = L("arr");
}
L("set_idx") = 0;
L("set");
while (L("i") < L("len")) {
L("curr_item") = L("sorted_arr")[L("i")];
L("i")++;
while (L("sorted_arr")[L("i")] == L("curr_item")) {
L("i")++;
}
if (!L("set_idx")){
L("set") = L("curr_item");
}
else {
L("set")[L("set_idx")] = L("curr_item");
}
L("set_idx")++;
}
return L("set");
}
@@DECL |
@PATH _ROOT _LINE _item
@POST
excise(1,1);
noop();
@RULES
_xNIL <-
_xWHITE [s] ### (1)
@@
|
@CODE
L("con") = findconcept(down(G("P_eui")), "E0018490");
L("attr") = findattr(L("con"), "codes");
L("vals") = attrvals(L("attr"));
"nums.txt" << getnumval(L("vals")) << "\n";
@@CODE |
@CODE
L("hello") = 0;
@@CODE
@NODES _sent
# np , vg to vg , vg
# John , trying to work... , left the room...
@CHECK
if (N("pattern",2) != "n")
fail();
if (!N("start to-vg",5))
fail();
@POST
L("vg") = N("vg node",7);
if (L("vg"))
fixvg(L("vg"),"active","VBP");
@RULES
_xNIL <-
_xWILD [one match=(_xSTART _qEOS)]
_clause
\, [lookahead]
_clause
_clause
\,
_clause
@@
# List of clauses!
# Basis for parallel construction.
# Verbs should agree in passive/active, etc. whenever possible.
@CHECK
if (!N("vg count",1)) # Verbless.
fail();
@POST
if (N("voice",1) == "active")
{
L("pos") = clausepos(N(1));
# Fill in ambiguous clauses with active voice.
if (!N("voice",3) && N("no subj",3))
{
fixvg(N("vg node",3),"active",L("pos"));
N("voice",3) = "active";
}
if (!N("voice",6) && N("no subj",6))
{
fixvg(N("vg node",6),"active",L("pos"));
N("voice",6) = "active";
}
}
noop();
@RULES
_xNIL <-
_clause
\,
_clause [lookahead]
\, [opt]
_conj
_clause
@@
# clause prep clause conj clause
# Case where first and third clause agree.
@CHECK
if (N("voice",5))
fail();
if (N("voice",1) != "passive")
fail();
if (vgvgagree(N("vg node",3),N("vg node",5)))
fail();
@POST
fixvg(N("vg node",5),"passive","VBN");
N("voice",5) = "passive";
@RULES
_xNIL <-
_clause
_prep [lookahead]
_clause
_conj
_clause
@@
# clause fnword clause
# clause than clause
@CHECK
if (N("last chunk",1) != "j")
fail();
if (N("voice",3))
fail();
if (!N("vg node",3))
fail();
@POST
fixvg(N("vg node",3),"passive","VBN");
N("voice",3) = "passive";
@RULES
_xNIL <-
_clause
than [s lookahead]
_clause
@@
# clause fnword clause.
@CHECK
if (!N("vg count",1)) # Verbless.
fail();
if (!N("voice",1) && !N("voice",3))
fail();
if (N("voice",1) && N("voice",3)
&& N("voice",1) != N("voice",3))
fail();
if (N("pattern",3) == "nv"
|| N("pattern",1) == "nv")
fail(); # Still not sure...
# Check verb tense agreement here...
S("vg1") = N("vg node",1);
S("vg3") = N("vg node",3);
"clause-fn-clause.txt" << pnvar(S("vg1"),"$text") << "\n";
if (!vgvgagree(S("vg1"),S("vg3")))
fail();
"clause-fn-clause.txt" << pnvar(S("vg1"),"$text") << "\n";
@POST
if (N("voice",1))
L("voice") = N("voice",1);
else
{
L("voice") = N("voice",3);
N("voice",1) = L("voice");
}
if (!N("voice",3))
N("voice",3) = L("voice");
fixvg(S("vg3"),L("voice"),clausepos(N(1)));
fixvg(S("vg1"),L("voice"),clausepos(N(3)));
N("sent400 c-and-c",1) = 1;
N("sent400 c-and-c",3) = 1;
@RULES
_xNIL <-
_clause
_xWILD [one lookahead match=(_conj \, _fnword )]
_clause
@@
# clause fnword clause.
@CHECK
if (N("sent400 c-fun-c",1))
fail();
if (N("voice",1))
fail();
if (!N("voice",3))
fail();
if (N("pattern",1) != "nv")
fail();
if (!N("pattern",3))
fail();
S("vg1") = N("vg node",1);
S("vg3") = N("vg node",3);
@POST
L("voice") = N("voice",3);
N("voice",1) = L("voice");
if (strpiece(N("pattern",3),0,0) == "v")
fixvg(S("vg1"),"active","VBD");
else
fixvg(S("vg1"),L("voice"),clausepos(N(3)));
N("sent400 c-fun-c",1) = 1;
@RULES
_xNIL <-
_clause
_xWILD [one lookahead match=(_conj \, _fnword )]
_clause
_xWILD [one match=(_qEOS _xEND)]
@@
# clause , clause
# verbless 2nd...
# apposition...
@CHECK
if (!N("vg count",1)) # Verbless.
fail();
if (N("voice",1)
|| N("vg count",3) > 0)
fail();
@POST
fixvg(N("vg node",1),"active","VBP");
N("voice",1) = "active";
@RULES
_xNIL <-
_clause
\, [lookahead]
_clause
@@
# that clause
# that
#@POST
# noop();
#@RULES
#_xNIL <-
# that [s]
# _clause [lookahead]
# @@
# clause , that
# that
@CHECK
if (N("mypos",3) == "IN")
fail();
@POST
chpos(N(3),"IN"); # that/IN
@RULES
_xNIL <-
_clause
\, [lookahead]
that [s]
@@
# clause , clause , clause
# Want first to be an np. Appositive case.
@CHECK
if (N("vg count",1))
fail(); # Require verbless.
if (N("pattern",1) != "n")
fail(); # Require np.
@POST
L("vg3") = N("vg node",3);
if (L("vg3"))
L("v3") = pnvar(L("vg3"),"first verb");
if (L("v3"))
if (!pnvar(L("v3"),"mypos")) # Unresolved.
{
L("vc3") = vconj(L("v3"));
if (L("vc3") == "-edn")
{
fixvg(L("vg3"),"passive","VBN"); # 01/25/05 AM.
N("voice",3) = "passive";
}
}
L("vg") = N("vg node",5);
fixvg(L("vg"),"active","VBP");
N("voice",5) = "active";
N("sent400 ccc",5) = 1;
@RULES
_xNIL <-
_clause
\, [lookahead]
_clause
\,
_clause
@@
# clause , clause , clause
# Want 1st to end with vg, last to start with vg.
@CHECK
if (N("pattern",1) != "nv")
fail();
if (!N("pattern",5))
fail();
if (strpiece(N("pattern",5),0,0) != "v")
fail(); # Need start with a verb.
if (N("voice",1))
fail();
if (!N("vg node",1))
fail();
@POST
L("vg") = N("vg node",1);
fixvg(L("vg"),"passive","VBN");
N("voice",1) = "passive";
N("id",1) = "sent400 c--c--c";
@RULES
_xNIL <-
_clause
_xWILD [one lookahead match=( \, _dbldash)]
_clause
_xWILD [one match=( \, _dbldash)]
_clause
@@
# clause clause clause
@CHECK
if (N("pattern",2) != "n"
&& !N("ellipted-copula",2) )
fail();
if (N("voice",3))
fail();
if (N("voice",4) != "active")
fail();
S("vg3") = N("vg node",3);
S("v3") = pnvar(S("vg3"),"first verb");
S("vc3") = vconj(S("v3"));
"blimp.txt" << S("vc3") << "\n";
if (S("vc3") != "-edn")
fail();
@POST
if (N("ellipted-copula",2))
{
fixvg(S("vg3"),"active","VBD");
N("voice",3) = "active";
}
else
{
fixvg(S("vg3"),"passive","VBN");
N("voice",3) = "passive";
}
L("vg4") = N("vg node",4);
if (L("vg4"))
fixvg(L("vg4"),"active","VBP");
N("sent400 c-c-c",2) = 1;
@RULES
_xNIL <-
_xSTART
_clause
_clause [lookahead]
_clause
# _xEND
@@
# clause clause
@CHECK
# if (!N("start to-vg",2))
# fail();
if (N("voice",1) && N("voice",2))
fail();
if (!N("voice",1) && !N("voice",2))
fail();
if (!N("vg count",1) || !N("vg count",2))
fail();
@POST
if (N("voice",1) && !N("voice",2))
{
if ((N("pattern",1) == "nvn" || N("pattern",1) == "vn"
|| (N("pattern",1) == "v" && N("last name",1) == "_advl") )
&& (N("pattern",2) == "v" || N("pattern",2) == "vn"
|| N("pattern",2) == "vp" # 05/16/07 AM.
))
{
fixvg(N("vg node",2),"passive","VBN");
N("voice",2) = "passive";
}
else if (N("voice",1) == "active"
&& N("last name",1) == "_advl"
&& N("first name",2) == "_vg")
{
fixvg(N("vg node",2),"passive","VBN");
N("voice",2) = "passive";
}
}
else if (!N("voice",1) && N("voice",2))
{
L("pat1") = N("pattern",1);
L("pat2") = N("pattern",2);
L("vg") = N("vg node",2);
L("v") = pnvar(L("vg"),"first verb");
L("vc") = vconj(L("v"));
if (L("pat1"))
{
if (N("to-vg",2)
|| L("vc") == "-ing")
{
# Tentative....
fixvg(N("vg node",1),"active","VBP");
N("voice",1) = "active";
}
else if (L("pat1") == "nv") # 06/21/06 AM.
{
fixvg(N("vg node",1),"active","VBD");
N("voice",1) = "active";
}
# else if (strendswith(L("pat1"),"v")) #
else if (L("pat1") == "v") # 06/21/06 AM.
{
if (N("ellipted-copula",1))
{
fixvg(N("vg node",1),"active","VBD");
N("voice",1) = "active";
}
else
{
fixvg(N("vg node",1),"passive","VBN");
N("voice",1) = "passive";
}
}
}
if (!N("voice",1) && L("pat2"))
if (strpiece(L("pat2"),0,0) == "v")
{
fixvg(N("vg node",1),"active","VBD");
N("voice",1) = "active";
}
}
N("sent400 c-c",1) = 1;
@RULES
_xNIL <-
_clause
_clause [lookahead]
@@
# Last clause nv.
@CHECK
if (N("voice",1))
fail();
@POST
N("sent400 last-clause",1) = 1;
if (N("pattern",1) == "nv")
{
fixvg(N("vg node",1),"active","VBD");
N("voice",1) = "active";
}
else if (N("pattern",1) == "v")
{
fixvg(N("vg node",1),"passive","VBN");
N("voice",1) = "passive";
}
@RULES
_xNIL <-
_clause
_xEND
@@
# clause conj clause
# "one eating prunes, the other stuffed silly."
@PRE
<1,1> var("ellipted-that-is");
<3,3> vareq("pattern","nv");
<3,3> varz("voice");
@POST
L("vg") = N("vg node",3);
fixvg(L("vg"),"passive","VBN");
N("voice",3) = "passive";
@RULES
_xNIL <-
_clause
_conj
_clause
@@
# ^ clause , clause $
@PRE
<2,2> vareq("voice","active");
<4,4> varz("voice");
<4,4> vareq("pattern","v");
@POST
L("vg") = N("vg node",2);
if (L("vg"))
L("v") = pnvar(L("vg"),"verb node");
if (L("v"))
L("pos") = pnvar(L("v"),"mypos");
L("vg4") = N("vg node",4);
if (N("last name",2) == "_advl"
|| N("last name",4) == "_advl")
{
fixvg(L("vg4"),"passive","VBN");
N("voice",4) = "passive";
}
else
{
fixvg(L("vg4"),"active",L("pos"));
N("voice",4) = "active";
}
@RULES
_xNIL <-
_xSTART
_clause
\,
_clause
_xEND
@@
# clause conj clause
@PRE
<1,1> vareq("voice","active");
<3,3> varz("voice");
<3,3> vareq("pattern","v");
@POST
L("vg") = N("vg node",1);
if (L("vg"))
L("v") = pnvar(L("vg"),"verb node");
if (L("v"))
L("pos") = pnvar(L("v"),"mypos");
L("vg3") = N("vg node",3);
fixvg(L("vg3"),"active",L("pos"));
N("voice",3) = "active";
@RULES
_xNIL <-
_clause
_xWILD [plus lookahead match=(_conj \, )]
_clause
@@
# fnword clause , clause
# ex: when blah , say blah.
@CHECK
S("vg4") = N("vg node",4);
if (!S("vg4"))
fail();
if (vgassigned(S("vg4")))
fail();
if (!vconjq(S("vg4"),"inf"))
fail();
if (!N("pattern",4))
fail();
L("ch") = strpiece(N("pattern",4),0,0);
if (L("ch") != "v")
fail();
@POST
fixvg(S("vg4"),"active","VB"); # Imperative.
@RULES
_xNIL <-
_whword [s]
_clause
\, [opt]
_clause
@@
|
# Rename con's numth child concept to name.
renamechild(L("con"), L("num"), L("name")); |
@CODE
# LINK TO ALL THE SPECIAL VARIABLES: http://visualtext.org/help/NLP_PP_Stuff/Special_Variables.htm
"output.txt" << "$text: " << pnvar(pnroot(),"$text") << "\n";
"output.txt" << "$treetext: " << pnvar(pnroot(),"$treetext") << "\n";
"output.txt" << "\n";
"output.txt" << "$apppath: " << G("$apppath") << "\n";
"output.txt" << "$input: " << G("$input") << "\n";
"output.txt" << "$inputpath: " << G("$inputpath") << "\n";
"output.txt" << "$inputname: " << G("$inputname") << "\n";
"output.txt" << "$inputhead: " << G("$inputhead") << "\n";
"output.txt" << "$inputtail: " << G("$inputtail") << "\n";
@@CODE |
@NODES _ROOT
@POST
excise(1,1);
noop();
@RULES
_xNIL <-
_xWHITE [s] ### (1)
@@
|
@NODES _LINE
@POST
if (X("num")) {
L("code1") = ItemValue(N("$text",2));
L("code2") = ItemValue(N("$text",3));
if (L("code1")) {
X("code1") = L("code1");
}
if (L("code2")) {
X("code2") = L("code2");
}
X("indent") = N("indent",4);
}
@RULES
_xNIL <-
_xSTART ### (1)
_item ### (2)
_item ### (3)
_item ### (4)
@@
|
@NODES _paragraph
@POST
singler(2,2);
@RULES
_endSent <-
_xWILD [s one match=(_xALPHA _xNUM _phrase)] ### (1)
_xWILD [one trig match=(\. \? \!)] ### (2)
_xWILD [one match=(_xWHITE _xALPHA _xNUM _xEND _xCTRL _quote)] ### (3)
@@
|
@PATH _ROOT _LINE _description
@POST
excise(1,1);
noop();
@RULES
_xNIL <-
_xWHITE [s] ### (1)
@@
|
@CODE
L("hello") = 0;
@@CODE
@NODES _TEXTZONE
@POST
if (N("pos num") == 1) # UNAMBIGUOUS PART OF SPEECH.
{
if (N("pos"))
{
G("node") = N(1);
group(1,1,N("pos"));
pncopyvars(G("node"),N(1)); # 12/14/01 AM.
if (!N("sem")) # 01/01/02 AM.
{
if (N("text"))
S("tmp") = N("text");
else
S("tmp") = strtolower(N("$text"));
S("stem") = nvstem(S("tmp"));
if (S("stem"))
N("sem") = S("stem");
else
N("sem") = S("tmp");
}
}
}
# STARTING TO USE CONFIDENCE, FREQUENCY. #
else if (N("verb") >= 90)
{
S("tmp") = N(1);
group(1,1,"_verb");
pncopyvars(S("tmp"),N(1));
}
else if (N("adv") >= 90)
{
S("tmp") = N(1);
group(1,1,"_adv");
pncopyvars(S("tmp"),N(1));
}
@RULES
_xNIL <-
_xALPHA # Uncharacterized, unreduced.
@@
|
@NODES _ROOT
@POST
single() ;
@@POST
@RULES
_XMLDecl <-
_StartXML ### (1)
_xWILD [min=0 max=0 fail=("_EndProcessingInstruction")]
_EndProcessingInstruction ### (3)
@@
_doctypedecl [unsealed] <-
_StartDocType
_whiteSpace [opt]
_xWILD [min=0 max=0 fail=("_EndTag" "[")]
_EndTag
@@
_doctypedecl <-
_StartDocType
_whiteSpace [opt]
_xWILD [min=0 max=0 fail=("_EndDocType" "[")]
_whiteSpace [opt]
\[
_whiteSpace [opt]
_xWILD [min=0 max=0 fail=("_EndDocType")]
_EndDocType
@@
_ProcessingInstruction <-
_StartProcessingInstruction
_xWILD [min=0 max=0 fail=("_EndProcessingInstruction")]
_EndProcessingInstruction
@@
_CDataSection <-
_CDStart
_xWILD [min=0 max=0 fail=("_CDEnd")]
_CDEnd
@@
@@RULES
|
@CODE
TakeKB("ICD");
#G("root") = findconcept(findroot(), "ICD");
#rmchildren(G("root"))
#G("icd_p") = findconcept(G("root"),"icd_p");
#if (!G("icd_p")) G("icd_p") = makeconcept(G("root"),"icd_p");
#G("icd_d") = findconcept(G("root"),"icd_d");
#if (!G("icd_d")) G("icd_d") = makeconcept(G("root"),"icd_d");
G("root") = findconcept(findroot(), "ICD");
G("p_words") = findconcept(G("root"),"icd_p");
if (!G("p_words")) G("p_words") = makeconcept(G("root"),"icd_p");
#G("icd_d") = findconcept(G("root"),"icd_d");
#if (!G("icd_d")) G("icd_d") = makeconcept(G("root"),"icd_d");
@@CODE |
@NODES _LINE
@POST
L("word") = N("$text");
L("len") = strlength(L("word"));
while (L("i") < L("len")) {
L("let") = strpiece(L("word"),L("i"),L("i"));
L("x") = "x";
if (striscaps(L("let"))) L("x") = "X";
L("str") = L("str") + L("x");
L("i")++;
}
pnrename(N(1),L("str"));
@RULES
_xNIL <-
_xALPHA
@@ |
@NODES _section
@PRE
<1,7> length(1);
# <3,3> length(1);
# <5,5> length(1);
# <7,7> length(1);
@RULES
_abbr <-
_xALPHA ### (1)
\. ### (2)
_xALPHA ### (3)
\. ### (4)
_xALPHA [opt] ### (5)
\. [opt] ### (6)
_xALPHA [opt] ### (7)
\. [opt] ### (8)
@@
|
@CODE
L("match") = down(G("matches"));
while (L("match")) {
L("code") = findconcept(G("codes"),conceptname(L("match")));
if (L("code")) {
L("match count") = ChildCount(L("match"));
L("code count") = ChildCount(L("code"));
L("percent") = 100*L("match count")/L("code count");
"percent.txt" << conceptname(L("match")) << " " << str(L("percent")) << "\n";
L("con") = getconcept(G("order"),str(L("percent")));
L("code con") = getconcept(L("con"),conceptname(L("code")));
L("child") = down(L("match"));
while (L("child")) {
makeconcept(L("code con"),conceptname(L("child")));
L("child") = next(L("child"));
}
}
L("match") = next(L("match"));
}
L("percent") = 100;
L("count") = 1;
while (L("percent") > 0) {
L("con") = findconcept(G("order"),str(L("percent")));
if (L("con")) {
L("codes") = down(L("con"));
while (L("codes")) {
L("code") = conceptname(L("codes"));
if (L("count")) "matches.txt" << "\n";
L("count")++;
"matches.txt" << "Match (" << str(L("percent")) << "): " << L("code");
L("child") = down(L("codes"));
while (L("child")) {
"matches.txt" << " " << conceptname(L("child"));
L("child") = next(L("child"));
}
"matches.txt" << "\n";
L("code con") = findconcept(G("codes"),L("code"));
DisplayCode(L("code con"));
L("codes") = next(L("codes"));
}
}
L("percent")--;
}
DisplayKB(G("order"),0);
DisplayKB(G("matches"),0);
# DisplayKB(G("codes"),0);
# DisplayKB(G("icd11"),2);
@@CODE |
@CODE
G("iso") = getconcept(findroot(),"iso");
G("countries") = getconcept(findroot(),"countries");
@@CODE |
# Open a database
@CODE
dbopen("test","root","mypassword");
dballocstmt();
dbexecstmt("SELECT * FROM table;");
dbbindcol(1,"varchar",50,&G("employee name"),&G("result1"));
while (dbfetch())
{
"output.txt" << "employee name: ";
if (G("result1"))
"output.txt" << G("employee name") << "\n";
else
"output.txt" << "NULL" << "\n";
}
dbfreestmt();
dbclose();
@@CODE |
@NODES _abstract
@POST
if (N("ref type") == "eq") {
L("number") = getEquationNumber(N("ref"));
"output.txt" << L("number");
} else {
"output.txt" << " <xr id=\"" << N("full") << "\"/> ";
}
@RULES
_xNIL <-
_ref ### (1)
@@
@POST
L("body") = getRefereceBody(N("cite"));
"output.txt" << " <ref>" << L("body") << "</ref> ";
@RULES
_xNIL <-
_cite ### (1)
@@
|
@DECL
########
# FUNC: DICTATTR
# SUBJ: Add attribute for dictionary word.
########
dictattr(L("str"),L("attr"),L("val"))
{
if (!L("str") || !L("attr"))
return;
L("str") = strtolower(L("str"));
L("con") = dictgetword(L("str"));
replaceval(L("con"),L("attr"),L("val"));
}
########
# FUNC: FINDDICTATTR
# SUBJ: Add attribute for dictionary word.
# RET: Numeric-valued attr.
########
#finddictattr(L("str"),L("attr"))
#{
#if (!L("str") || !L("attr"))
# return 0;
#L("str") = strtolower(L("str"));
#L("con") = dictgetword(L("str"));
#return numval(L("con"),L("attr"));
#}
finddictattr(L("str"),L("attr"))
{
if (!L("str") || !L("attr"))
return 0;
L("str") = strtolower(L("str"));
L("con") = dictgetword(L("str"));
if (!L("con"))
{
"err.txt" << "finddictattr: " << L("str") << ", " << L("attr") << "\n";
return 0;
}
return numval(L("con"),L("attr"));
}
########
# FUNC: FINDDICTSATTR
# SUBJ: Add attribute for dictionary word.
# RET: String-valued attr.
########
finddictsattr(L("str"),L("attr"))
{
if (!L("str") || !L("attr"))
return;
L("str") = strtolower(L("str"));
L("con") = dictgetword(L("str"));
return strval(L("con"),L("attr"));
}
@CODE
if (numval(findroot(),"kb loaded"))
exitpass();
########################################
# Verbs that require a human-like agent.
########################################
# eg, "Moose said" -- Moose would be an NP.
dictattr("announce","agent-human",1);
dictattr("say","agent-human",1);
########################################
# Verbs that take scalar change.
########################################
# Note: Take a numeric value after the verb.
# eg, "rise 10%".
# These verbs appear to allow intransitive use.
dictattr("accelerate","vscalenum",1);
dictattr("climb","vscalenum",1);
dictattr("decrease","vscalenum",1);
dictattr("fall","vscalenum",1);
dictattr("gain","vscalenum",1);
dictattr("grow","vscalenum",1);
dictattr("increase","vscalenum",1);
dictattr("lengthen","vscalenum",1);
dictattr("lose","vscalenum",1);
dictattr("rise","vscalenum",1);
dictattr("shrink","vscalenum",1);
########################################
# SEMANTIC VERB FEATURES
########################################
# Ex: The verb sense of 'curb' means diminish in some way.
# vscalar - scalar in verb sense.
# nscalar - scalar in noun sense.
# (These may need further work for ambiguous nouns etc.)
# Note: Sometimes verb and noun will have the scalar sense,
# so doesn't always resolve part-of-speech.
# Appear to be mainly transitive verbs here.
# vscalar = 0, minus, plus, neutral.
dictattr("accelerate","vscalar","plus");
dictattr("bolster","vscalar","plus");
dictattr("boost","vscalar","plus");
dictattr("brake","vscalar","minus");
dictattr("curb","vscalar","minus");
dictattr("decelerate","vscalar","minus");
dictattr("decrease","vscalar","minus");
dictattr("decrement","vscalenum",1);
dictattr("deflate","vscalar","minus");
dictattr("diminish","vscalar","minus");
dictattr("enhance","vscalar","plus");
dictattr("increase","vscalar","plus");
dictattr("increment","vscalenum",1);
dictattr("inflate","vscalar","plus");
dictattr("lessen","vscalar","minus");
dictattr("lower","vscalar","minus");
dictattr("maintain","vscalar","neutral");
dictattr("raise","vscalar","plus");
dictattr("reduce","vscalar","minus");
dictattr("slow","vscalar","minus");
dictattr("speed","vscalar","plus");
########################################
# Plain adjectives with comparative, superlative endings.
########################################
# not-er, not-est, plain-adj.
# Note: number is ambiguous. More numb, and the numeric meaning.
dictattr("bitter","adj-plain",1);
dictattr("center","adj-plain",1);
dictattr("charter","adj-plain",1);
dictattr("clever","adj-plain",1);
dictattr("counter","adj-plain",1);
dictattr("eager","adj-plain",1);
dictattr("former","adj-plain",1);
dictattr("foster","adj-plain",1);
dictattr("improper","adj-plain",1);
dictattr("inner","adj-plain",1);
dictattr("lackluster","adj-plain",1);
dictattr("later","adj-plain",1); # Conform Treebank.
dictattr("latter","adj-plain",1);
dictattr("meager","adj-plain",1);
dictattr("other","adj-plain",1);
dictattr("power","adj-plain",1);
dictattr("proper","adj-plain",1);
dictattr("quarter","adj-plain",1);
dictattr("silver","adj-plain",1);
dictattr("sinister","adj-plain",1);
dictattr("sister","adj-plain",1);
dictattr("tender","adj-plain",1);
dictattr("test","adj-plain",1);
dictattr("together","adj-plain",1); # 04/23/07 AM.
dictattr("undercover","adj-plain",1);
dictattr("upper","adj-plain",1);
dictattr("utter","adj-plain",1);
dictattr("west","adj-plain",1);
dictattr("winter","adj-plain",1);
########################################
# Plain adverbs with comparative, superlative endings.
########################################
dictattr("asunder","adv-plain",1);
dictattr("counter","adv-plain",1);
dictattr("forever","adv-plain",1);
dictattr("hither","adv-plain",1);
dictattr("however","adv-plain",1);
# Note: Treebank tagguide says RB unless explicitly
# something like "X is later than Y", in which case it's
# RBR. Treebank answer key does not conform to this enough,
# so using RB for simplicity here. More semantic, clause,
# and sentential processing needed to assign RBR appropriately
# according to this scheme. #
dictattr("later","adv-plain",1); # Conform Treebank. # 04/19/07 AM.
dictattr("moreover","adv-plain",1);
dictattr("never","adv-plain",1);
dictattr("rather","adv-plain",1);
dictattr("together","adv-plain",1);
dictattr("thereafter","adv-plain",1);
########################################
# Exceptions.
# Adverbs, adjectives with comparative, superlative endings.
########################################
dictattr("later","-er",1); # Note the fact.
dictattr("best","-est",1);
dictattr("least","-est",1);
dictattr("most","-est",1);
dictattr("worst","-est",1);
dictattr("less","-er",1);
dictattr("more","-er",1);
dictattr("worse","-er",1);
########################################
# THAT-SUBJUNCTIVE
########################################
# Note: Some nouns and verbs yield a "that + subjunctive"
# pattern.
# He demands that John eat his dinner.
# (As opposed to 'He thinks that John eats his dinner.')
# 'eventive' nouns also:
# His demand that John eat his dinner ...
# Also multi-word: see to it that ...
dictattr("ask","that-subjunctive",1);
dictattr("assure","that-subjunctive",1);
dictattr("beg","that-subjunctive",1);
dictattr("command","that-subjunctive",1);
dictattr("decide","that-subjunctive",1);
dictattr("decree","that-subjunctive",1);
dictattr("demand","that-subjunctive",1);
dictattr("ensure","that-subjunctive",1);
dictattr("insist","that-subjunctive",1);
dictattr("order","that-subjunctive",1);
dictattr("request","that-subjunctive",1);
dictattr("see","that-subjunctive",1);
dictattr("vote","that-subjunctive",1);
dictattr("assurance","that-subjunctive",1);
dictattr("decision","that-subjunctive",1);
dictattr("insistence","that-subjunctive",1);
########################################
# VERB + OF
########################################
dictattr("think","verb-of",1);
dictattr("tire","verb-of",1);
dictattr("require","verb-of",1);
# Also, require NP of ...
########################################
# COPULAS
########################################
dictattr("appear","copula",1);
dictattr("be","copula",1);
dictattr("being","copula",1);
dictattr("become","copula",1);
dictattr("close","copula",1); # market closed higher.
dictattr("feel","copula",1);
dictattr("get","copula",1); # 5/31/06 AM.
dictattr("go","copula",1);
dictattr("grow","copula",1);
dictattr("lie","copula",1);
dictattr("look","copula",1);
dictattr("make","copula",1);
dictattr("mean","copula",1); # that means cloudy...
dictattr("open","copula",1); # market opened higher.
dictattr("prove","copula",1);
dictattr("remain","copula",1);
dictattr("sound","copula",1);
dictattr("stay","copula",1);
dictattr("turn","copula",1);
########################################
# TRANSITIVE VERBS
########################################
dictattr("purpose","trans",1);
dictattr("purposes","trans",1);
dictattr("purposing","trans",1);
dictattr("purposed","trans",1);
dictattr("ambition","trans",1);
dictattr("ambitions","trans",1);
dictattr("ambitioning","trans",1);
dictattr("ambitioned","trans",1);
dictattr("issue","trans",1);
dictattr("issues","trans",1);
dictattr("issuing","trans",1);
dictattr("issued","trans",1);
dictattr("link","trans",1);
dictattr("links","trans",1);
dictattr("linking","trans",1);
dictattr("linked","trans",1);
########################################
# INTRANSITIVE VERBS
########################################
# Todo: distinguish semantically and syntactically intransitive.
# (eg, "I think" implies that one is thinking about something.
# i.e., syntax=intr, sem=trans)
dictattr("grow","intr",1);
dictattr("sit","intr",1);
dictattr("struggle","intr",1);
dictattr("walk","intr",1);
########################################
# VNJ VERBS
########################################
# Ex: keep it real.
# Ex: paint the house purple.
# Corresponds to Longman X7.
dictattr("hold","X7",1);
dictattr("keep","X7",1);
dictattr("leave","X7",1);
dictattr("make","X7",1);
dictattr("paint","X7",1);
dictattr("serve","X7",1);
########################################
# VN(prep)J VERBS
########################################
# C1pr is another Longman designation.
# Also similar to X7.
# Ex: John viewed Mary as ditzy.
# Ex: John considered Mary (as) ditzy. (optional 'as')
# i - 'as' is optional.
dictattr("appoint","C1pr",1); # 1
dictattr("certify","C1pr",1);
dictattr("choose","C1pr",1);
dictattr("consider","C1pr",1);
dictattr("count","C1pr",1);
dictattr("crown","C1pr",1); # 1
dictattr("deem","C1pr",1);
dictattr("elect","C1pr",1); # 1
dictattr("esteem","C1pr",1); # 1
dictattr("make","C1pr",1); # 1
dictattr("proclaim","C1pr",1);
dictattr("rate","C1pr",1);
dictattr("reckon","C1pr",1);
dictattr("report","C1pr",1);
# ii - 'as' is obligatory.
dictattr("accept","C1pr",1);
dictattr("acknowledge","C1pr",1);
dictattr("characterize","C1pr",1);
dictattr("class","C1pr",1);
dictattr("define","C1pr",1);
dictattr("describe","C1pr",1);
dictattr("intend","C1pr",1); # 1
dictattr("make","C1pr",1);
dictattr("regard","C1pr",1);
dictattr("see","C1pr",1);
dictattr("take","C1pr",1);
dictattr("treat","C1pr",1);
dictattr("use","C1pr",1);
dictattr("view","C1pr",1);
# take for - also C1pr
########################################
# VNN VERBS
########################################
# Ex: give John an apple.
# Like Longman D1.
#dictattr("paint","vnn",1);
########################################
# HELPING VERBS
########################################
# The idea here was things like:
# to help work
# to (begin, get, commence, start) working
# ...
# Need a better description, at least two types.
# T2
dictattr("dare","T2",1);
dictattr("help","T2",1);
# And I3 is what?
# T3 = V + TO + V
dictattr("agree","T3",1);
dictattr("ask","T3",1);
dictattr("attempt","T3",1);
dictattr("claim","T3",1);
dictattr("decide","T3",1);
dictattr("deserve","T3",1);
dictattr("desire","T3",1);
dictattr("expect","T3",1);
dictattr("fail","T3",1); #
dictattr("go","T3",1);
dictattr("have","T3",1);
dictattr("hope","T3",1);
dictattr("manage","T3",1); #
dictattr("need","T3",1);
dictattr("promise","T3",1);
dictattr("strive","T3",1);
dictattr("struggle","T3",1);
dictattr("try","T3",1);
dictattr("use","T3",1); # passive: used to v-inf
dictattr("wait","T3",1);
dictattr("want","T3",1);
dictattr("work","T3",1);
# T4 = verb + ving (start eating)
# Also: cannot stand ving.
# Also: keep (on) ving.
dictattr("acknowledge","T4",1);
dictattr("avoid","T4",1);
dictattr("consider","T4",1);
dictattr("deny","T4",1);
dictattr("detest","T4",1);
dictattr("dislike","T4",1);
dictattr("evaluate","T4",1); #
dictattr("fancy","T4",1);
dictattr("finish","T4",1);
dictattr("keep","T4",1);
dictattr("postpone","T4",1);
dictattr("resent","T4",1);
dictattr("resist","T4",1);
dictattr("risk","T4",1);
dictattr("suggest","T4",1);
dictattr("begin","T4",1);
dictattr("chance","T4",1); # ?
dictattr("commence","T4",1);
dictattr("continue","T4",1);
dictattr("eschew","T4",1); #
dictattr("get","T4",1);
dictattr("resist","T4",1); #
dictattr("start","T4",1); #
dictattr("stop","T4",1);
dictattr("try","T4",1);
########################################
# VNV VERBS
########################################
# Longman V2.
# Ex: make them go.
dictattr("bid","V2",1); # archaic?
dictattr("have","V2",1);
dictattr("help","V2",1);
dictattr("let","V2",1);
dictattr("make","V2",1);
dictattr("see","V2",1);
dictattr("watch","V2",1);
########################################
# V+N+TO+V VERBS
########################################
# Longman V3.
# Ex: help them to go.
dictattr("allow","V3",1);
dictattr("ask","V3",1);
dictattr("coax","V3",1);
dictattr("command","V3",1);
dictattr("convince","V3",1);
dictattr("force","V3",1);
dictattr("help","V3",1);
dictattr("intend","V3",1);
dictattr("like","V2",1); # a little different...
dictattr("order","V3",1);
dictattr("permit","V3",1);
dictattr("prefer","V3",1); #
dictattr("pressure","V3",1);
dictattr("require","V3",1);
dictattr("teach","V3",1);
dictattr("tell","V3",1);
dictattr("urge","V3",1);
########################################
# V+N+V-ing VERBS
########################################
# Longman V4.
dictattr("catch","V4",1);
dictattr("discover","V4",1);
dictattr("keep","V4",1);
dictattr("feel","V4",1);
dictattr("find","V4",1);
dictattr("get","V4",1); # get him going.
dictattr("hate","V4",1);
dictattr("have","V4",1); # 05/22/07 AM.
dictattr("hear","V4",1);
dictattr("like","V4",1);
dictattr("notice","V4",1);
dictattr("observe","V4",1);
dictattr("see","V4",1);
dictattr("send","V4",1); # send him packing/running...
dictattr("sense","V4",1);
dictattr("smell","V4",1);
dictattr("start","V4",1);
dictattr("want","V4",1);
########################################
# V+N+V-en VERBS
########################################
# Longman V8.
dictattr("get","V8",1);
dictattr("have","V8",1);
dictattr("need","V8",1);
dictattr("want","V8",1);
########################################
# V+THAT VERBS
########################################
# Longman T5 and D5 verbs, with subcategories.
# Also:
# It seemed/appeared/transpired/happened that ...
# Correspondence with Schank MBUILD, MTRANS.
# T5a list.
dictattr("accept","T5",1);
dictattr("admit","T5",1);
dictattr("agree","T5",1);
dictattr("believe","T5",1);
dictattr("claim","T5",1);
dictattr("conclude","T5",1);
dictattr("discover","T5",1);
dictattr("doubt","T5",1);
dictattr("feel","T5",1);
dictattr("figure","T5",1);
dictattr("forget","T5",1);
dictattr("hope","T5",1);
dictattr("indicate","T5",1);
dictattr("remark","T5",1);
dictattr("understand","T5",1);
# T5c list.
dictattr("ask","T5",1);
dictattr("command","T5",1);
dictattr("demand","T5",1);
dictattr("insist","T5",1);
dictattr("order","T5",1);
dictattr("propose","T5",1);
dictattr("recommend","T5",1);
dictattr("request","T5",1);
dictattr("require","T5",1);
dictattr("suggest","T5",1);
dictattr("urge","T5",1);
# Others.
dictattr("add","T5",1);
dictattr("announce","T5",1);
dictattr("assert","T5",1);
dictattr("assure","T5",1);
dictattr("complain","T5",1);
dictattr("concede","T5",1);
dictattr("concur","T5",1);
dictattr("demonstrate","T5",1);
dictattr("determine","T5",1);
dictattr("emphasize","T5",1);
dictattr("find","T5",1);
dictattr("highlight","T5",1);
dictattr("illustrate","T5",1);
dictattr("imply","T5",1);
dictattr("infer","T5",1);
dictattr("mention","T5",1);
dictattr("note","T5",1);
dictattr("prove","T5",1);
dictattr("reveal","T5",1);
dictattr("say","T5",1);
dictattr("show","T5",1);
dictattr("stress","T5",1);
dictattr("underscore","T5",1);
dictattr("decide","T5",1); #
dictattr("charge","T5",1); #
########################################
# V+O+O VERBS
########################################
# Longman D1 verbs.
# John gave Mary a book.
# D1 (to)
dictattr("bring","D1",1);
dictattr("call","D1",1); #
dictattr("give","D1",1); #
dictattr("grant","D1",1);
dictattr("hand","D1",1);
dictattr("make","D1",1); #
dictattr("offer","D1",1);
dictattr("owe","D1",1);
dictattr("promise","D1",1);
dictattr("read","D1",1);
dictattr("refuse","D1",1); # Not exactly 'to'.
dictattr("send","D1",1);
dictattr("show","D1",1);
dictattr("take","D1",1);
dictattr("teach","D1",1);
dictattr("write","D1",1);
# D1 (for)
dictattr("cook","D1",1);
dictattr("find","D1",1);
dictattr("get","D1",1);
dictattr("leave","D1",1);
dictattr("make","D1",1);
dictattr("order","D1",1);
dictattr("peel","D1",1);
dictattr("save","D1",1);
dictattr("spare","D1",1);
# D1a
dictattr("ask","D1",1);
dictattr("strike","D1",1);
########################################
# AMBIG THAT STRONGLY PREFERS VERB
########################################
# Ie, need evidence for other POS.
dictattr("making","prefer-verb",1);
dictattr("wrong","prefer-adj",1);
########################################
# PREPOSITIONAL VERB IDIOMS
########################################
# "roll out"
# 0 = no info.
# 1 = PHRASAL, ie, verb+particle.
# 2 = prepositional.
# 3 = Both are valid.
# Note that sometimes they are ambiguous...intrans vs trans...
dictattr("act","out",1);
dictattr("add","up",1);
dictattr("auction","off",1);
dictattr("back","down",1);
dictattr("back","out",1);
dictattr("back","up",1);
dictattr("bail","out",1);
dictattr("balance","out",1);
dictattr("bang","up",1);
dictattr("bark","out",1); # ?
# Need a way to say 'base X on' only.
# which he will base on...
# based [X] on
dictattr("base","on",1); #
dictattr("bat","down",1);
dictattr("bear","out",1);
dictattr("beat","down",1);
dictattr("beat","off",1);
dictattr("beat","out",1);
dictattr("beat","up",1);
dictattr("bed","down",1);
dictattr("beef","up",1);
dictattr("bid","up",1);
dictattr("bite","off",1);
dictattr("black","out",1);
dictattr("blow","off",1);
dictattr("blow","out",1);
dictattr("blow","up",1);
dictattr("blurt","out",1);
dictattr("bog","down",1);
dictattr("boil","down",1);
dictattr("boot","off",1);
dictattr("bottle","up",1);
dictattr("bottom","out",1);
dictattr("bounce","up",1); # ?
dictattr("box","out",1);
dictattr("branch","out",1);
dictattr("break","down",1);
dictattr("break","off",1); # 2?
dictattr("break","out",1);
dictattr("break","up",1);
dictattr("bring","down",1);
dictattr("bring","out",1);
dictattr("bring","up",1);
dictattr("brush","off",1);
dictattr("buck","up",1);
dictattr("buckle","down",1);
dictattr("buckle","up",1);
dictattr("build","up",1);
dictattr("bump","up",1);
dictattr("burn","down",1);
dictattr("burn","out",1);
dictattr("bust","down",1); # ?
dictattr("button","down",1);
dictattr("button","up",1);
dictattr("buy","off",1);
dictattr("buy","out",1);
dictattr("buy","up",1);
dictattr("call","off",1);
dictattr("call","out",1);
dictattr("call","up",1);
dictattr("calm","down",1);
dictattr("camp","out",1);
dictattr("cancel","out",1); # ?
dictattr("cap","off",1);
dictattr("carry","off",1);
dictattr("carry","out",1);
dictattr("cart","off",1);
dictattr("cart","out",1);
dictattr("carve","out",1);
dictattr("carve","up",1);
dictattr("cash","out",1);
dictattr("cast","about",1); # ?
dictattr("cast","out",1);
dictattr("chain","up",1);
dictattr("chalk","up",1);
dictattr("check","out",1);
dictattr("cheer","up",1);
dictattr("chew","up",1);
dictattr("choke","down",1);
dictattr("choke","off",1);
dictattr("choke","up",1);
dictattr("chomp","up",1);
dictattr("chop","down",1);
dictattr("chop","off",1);
dictattr("chew","off",1);
dictattr("churn","out",1);
dictattr("clamp","down",1);
dictattr("clean","out",1);
dictattr("clean","up",1);
dictattr("clear","out",1);
dictattr("clear","up",1);
dictattr("climb","down",1);
dictattr("climb","up",1);
dictattr("clip","off",1);
dictattr("clog","up",1);
dictattr("close","down",1);
dictattr("close","off",1);
dictattr("close","out",1);
dictattr("close","up",1);
dictattr("combine","with",2); #
dictattr("come","down",1);
dictattr("come","off",1);
dictattr("come","out",1);
dictattr("conjure","up",1);
dictattr("contract","out",1); # ?
dictattr("cook","up",1);
dictattr("cool","down",1);
dictattr("cool","off",1);
dictattr("cough","up",1);
dictattr("count","out",1);
dictattr("cover","up",1);
dictattr("crack","down",1);
dictattr("cram","down",1); # ?
dictattr("crank","out",1);
dictattr("crank","up",1);
dictattr("crowd","out",1);
dictattr("cry","out",1);
dictattr("cut","down",1);
dictattr("cut","off",1);
dictattr("cut","out",1);
dictattr("cut","up",1);
dictattr("die","down",1);
dictattr("die","off",1);
dictattr("dig","up",1);
dictattr("dish","out",1);
dictattr("divide","up",1);
dictattr("divvy","up",1);
dictattr("dole","out",1);
dictattr("drag","down",1);
dictattr("drag","out",1);
dictattr("drag","up",1);
dictattr("drain","out",1);
dictattr("draw","down",1);
dictattr("draw","off",1);
dictattr("draw","out",1);
dictattr("draw","up",1);
dictattr("dream","up",1);
dictattr("dress","up",1);
dictattr("drive","down",1);
dictattr("drive","off",1);
dictattr("drive","out",1);
dictattr("drive","up",1);
dictattr("drop","off",1);
dictattr("drop","out",1);
dictattr("drown","out",1);
dictattr("drum","up",1);
dictattr("dull","down",1);
dictattr("dust","off",1);
dictattr("eat","up",1);
dictattr("edge","down",1);
dictattr("edge","up",1);
dictattr("edge","out",1);
dictattr("eke","out",1);
dictattr("even","up",1);
dictattr("face","down",1);
dictattr("fake","out",1);
dictattr("fall","out",1);
dictattr("fan","out",1);
dictattr("farm","out",1);
dictattr("fatten","up",1);
dictattr("fend","off",1);
dictattr("ferret","out",1);
dictattr("fight","off",1);
dictattr("fight","out",1);
dictattr("figure","out",1);
dictattr("fill","out",1);
dictattr("fill","up",1);
dictattr("filter","down",1);
dictattr("find","out",1);
dictattr("finish","off",1);
dictattr("finish","up",1);
dictattr("fire","off",1);
dictattr("fire","up",1);
dictattr("firm","up",1);
dictattr("fish","out",1); # ?
dictattr("fizzle","out",1);
dictattr("flame","out",1);
dictattr("flatten","out",1);
dictattr("flesh","out",1);
dictattr("fling","off",1);
dictattr("flush","out",1);
dictattr("fly","out",1);
dictattr("fold","up",1);
dictattr("follow","up",1);
dictattr("force","out",1);
dictattr("force","up",1);
dictattr("fork","up",1);
dictattr("foul","up",1);
dictattr("freak","out",1);
dictattr("free","up",1);
dictattr("firghten","off",1);
dictattr("gear","up",1); # to...
dictattr("get","out",1);
dictattr("get","up",1);
dictattr("give","out",1);
dictattr("give","up",1);
dictattr("glue","down",1);
dictattr("grow","out",1);
dictattr("gobble","up",1);
dictattr("grab","up",1);
dictattr("grind","up",1);
dictattr("gum","up",1);
dictattr("gun","down",1);
dictattr("gussy","up",1);
dictattr("hack","off",1);
dictattr("hammer","out",1);
dictattr("hand","down",1);
dictattr("hand","out",1);
dictattr("hand","up",1);
dictattr("hang","up",1);
dictattr("haul","out",1); # 5/25/06 AM.
dictattr("head","down",1);
dictattr("head","off",1);
dictattr("heat","up",1);
dictattr("heave","off",1); # ?
dictattr("help","out",1);
dictattr("hike","up",1);
dictattr("hit","off",1); # Idiomatic: hit it off...
dictattr("hold","down",1);
dictattr("hold","off",1);
dictattr("hold","out",1);
dictattr("hold","up",1);
dictattr("hook","up",1);
dictattr("hunker","down",1);
dictattr("inch","down",1); # ?
dictattr("inch","up",1); # ?
dictattr("iron","out",1);
dictattr("jack","up",1);
dictattr("jam","up",1);
dictattr("jerk","up",1);
dictattr("join","up",1);
dictattr("keep","out",1);
dictattr("keep","up",1);
dictattr("kick","off",1);
dictattr("kick","out",1);
dictattr("kick","up",1);
dictattr("kill","off",1);
dictattr("knock","down",1);
dictattr("knock","off",1);
dictattr("knock","out",1);
dictattr("lash","out",1);
dictattr("laugh","off",1);
dictattr("lay","down",1);
dictattr("lay","off",1);
dictattr("lay","out",1);
dictattr("lead","off",1);
dictattr("leak","out",1);
dictattr("lease","out",1);
dictattr("leave","off",1);
dictattr("leave","out",1);
dictattr("leave","up",1);
dictattr("lend","out",1);
dictattr("let","down",1);
dictattr("let","off",1);
dictattr("level","off",1);
dictattr("lie","down",1);
dictattr("lift","off",1);
dictattr("light","up",1);
dictattr("lighten","up",1);
dictattr("line","up",1);
dictattr("link","up",1);
dictattr("live","out",1); # ?
dictattr("load","up",1);
dictattr("loan","out",1);
dictattr("lock","up",1);
dictattr("look","up",1);
dictattr("loosen","up",1);
dictattr("lose","out",1);
dictattr("lop","off",1);
dictattr("luck","out",1);
dictattr("mail","off",1);
dictattr("mail","out",1);
dictattr("make","out",1);
dictattr("make","up",1);
dictattr("map","out",1);
dictattr("mark","down",1);
dictattr("mark","up",1);
dictattr("marry","off",1);
dictattr("match","up",1);
dictattr("mess","up",1);
dictattr("mete","out",1);
dictattr("miss","out",1);
dictattr("mop","up",1);
dictattr("move","down",1);
dictattr("move","out",1);
dictattr("move","up",1);
dictattr("muck","up",1);
dictattr("nail","down",1);
dictattr("nudge","up",1);
dictattr("offer","up",1);
dictattr("open","up",1);
dictattr("pace","off",1);
dictattr("pack","up",1);
dictattr("pair","up",1);
dictattr("pan","out",1);
dictattr("parcel","out",1);
dictattr("pare","down",1);
dictattr("pass","off",1);
dictattr("pass","out",1);
dictattr("pass","up",1);
dictattr("paste","up",1);
dictattr("patch","up",1);
dictattr("pawn","off",1);
dictattr("pay","down",1);
dictattr("pay","off",1);
dictattr("pay","out",1);
dictattr("peel","off",1);
dictattr("perk","up",1);
dictattr("phase","out",1);
dictattr("pick","up",1);
dictattr("pile","up",1);
dictattr("pin","down",1);
dictattr("play","down",1);
dictattr("play","out",1);
dictattr("plot","out",1); # ?
dictattr("pluck","up",1);
dictattr("plunk","down",1);
dictattr("point","out",1);
dictattr("point","up",1);
dictattr("pop","out",1);
dictattr("pour","out",1);
dictattr("prop","up",1);
dictattr("pull","down",1);
dictattr("pull","off",1);
dictattr("pull","out",1);
dictattr("pull","up",1);
dictattr("pump","up",1);
dictattr("push","down",1);
dictattr("push","up",1);
dictattr("put","down",1);
dictattr("put","in",1);
dictattr("put","off",1);
dictattr("put","out",1);
dictattr("put","up",1);
dictattr("puzzle","out",1);
dictattr("quiet","down",1);
dictattr("rack","up",1);
dictattr("raise","up",1);
dictattr("ramp","up",1);
dictattr("ratchet","up",1);
dictattr("rattle","off",1);
dictattr("reach","down",1);
dictattr("reach","out",1);
dictattr("reel","off",1);
dictattr("ride","out",1);
dictattr("ride","up",1);
dictattr("rig","up",1);
dictattr("ring","out",1);
dictattr("ring","up",1);
dictattr("rip","down",1);
dictattr("rip","off",1);
dictattr("rip","out",1);
dictattr("rip","up",1);
dictattr("roll","down",1);
dictattr("roll","off",1);
dictattr("roll","out",1);
dictattr("roll","up",1);
dictattr("root","out",1);
dictattr("rough","up",1);
dictattr("rope","off",1);
dictattr("round","out",1);
dictattr("round","up",1);
dictattr("rule","out",1);
dictattr("run","down",1); # also 2?
dictattr("run","out",1);
dictattr("run","up",1);
dictattr("save","up",1);
dictattr("scale","down",1);
dictattr("scare","off",1);
dictattr("scare","up",1);
dictattr("scarf","up",1);
dictattr("scoop","up",1);
dictattr("scratch","out",1);
dictattr("screen","out",1);
dictattr("screw","up",1);
dictattr("scrounge","up",1);
dictattr("seal","off",1);
dictattr("search","out",1);
dictattr("seek","out",1);
dictattr("sell","off",1);
dictattr("sell","out",1);
dictattr("send","down",1);
dictattr("send","off",1);
dictattr("send","out",1);
dictattr("serve","up",1);
dictattr("set","down",1);
dictattr("set","out",1);
dictattr("set","up",1);
dictattr("sew","up",1);
dictattr("settle","down",1);
dictattr("shake","down",1);
dictattr("shake","off",1);
dictattr("shake","out",1);
dictattr("shake","up",1);
dictattr("shape","up",1);
dictattr("share","out",1);
dictattr("shear","off",1);
dictattr("shell","out",1);
dictattr("ship","out",1);
dictattr("shoot","down",1);
dictattr("shoot","up",1);
dictattr("shore","up",1);
dictattr("shout","down",1);
dictattr("show","off",1);
dictattr("shrug","off",1);
dictattr("shut","down",1);
dictattr("shut","off",1);
dictattr("shut","out",1);
dictattr("shut","up",1);
dictattr("sign","up",1);
dictattr("single","out",1);
dictattr("siphon","off",1);
dictattr("sit","down",1);
dictattr("sit","out",1);
dictattr("size","up",1);
dictattr("sketch","out",1);
dictattr("skim","off",1);
dictattr("slice","off",1);
dictattr("slice","up",1);
dictattr("slide","down",1);
dictattr("slim","down",1);
dictattr("slip","down",1);
dictattr("slough","off",1);
dictattr("slow","down",1);
dictattr("smooth","out",1);
dictattr("snap","up",1);
dictattr("snatch","up",1);
dictattr("sniff","out",1);
dictattr("snuff","out",1);
dictattr("soak","off",1); # ?
dictattr("soak","up",1);
dictattr("sober","up",1);
dictattr("sop","up",1);
dictattr("sort","out",1);
dictattr("speak","out",1);
dictattr("speed","up",1);
dictattr("spend","down",1);
dictattr("spell","out",1);
dictattr("spice","up",1);
dictattr("spiff","up",1);
dictattr("spill","out",1);
dictattr("spin","off",1);
dictattr("spin","out",1);
dictattr("spit","out",1);
dictattr("split","off",1);
dictattr("split","up",1);
dictattr("spread","out",1);
dictattr("spruce","up",1);
dictattr("squeeze","out",1);
dictattr("stack","up",1);
dictattr("stake","out",1);
dictattr("stall","out",1);
dictattr("stand","out",1);
dictattr("stand","up",1);
dictattr("stare","down",1);
dictattr("start","out",1);
dictattr("start","up",1);
dictattr("stave","off",1);
dictattr("step","down",1);
dictattr("step","up",1);
dictattr("stick","up",1);
dictattr("stir","up",1);
dictattr("stock","up",1);
dictattr("straighten","out",1);
dictattr("straighten","up",1);
dictattr("stretch","out",1);
dictattr("strike","down",1);
dictattr("strike","out",1);
dictattr("strike","up",1);
dictattr("strip","down",1);
dictattr("strip","off",1);
dictattr("strip","out",1);
dictattr("sum","up",1);
dictattr("swab","down",1);
dictattr("swallow","up",1);
dictattr("sweat","out",1);
dictattr("sweep","up",1);
dictattr("swoop","down",1);
dictattr("tack","down",1);
dictattr("take","on",1);
dictattr("take","out",1);
dictattr("take","over",1);
dictattr("take","up",1);
dictattr("talk","down",1);
dictattr("talk","up",1);
dictattr("tamp","down",1);
dictattr("tangle","up",1);
dictattr("tear","down",1);
dictattr("tear","off",1);
dictattr("tear","up",1);
dictattr("tee","up",1);
dictattr("thin","out",1);
dictattr("think","up",1);
dictattr("thrash","out",1);
dictattr("throw","off",1);
dictattr("throw","out",1);
dictattr("throw","up",1);
dictattr("tick","off",1);
dictattr("tie","down",1);
dictattr("tie","up",1);
dictattr("tighten","up",1);
dictattr("tip","off",1);
dictattr("tone","down",1);
dictattr("top","off",1);
dictattr("top","out",1);
dictattr("toss","down",1);
dictattr("toss","out",1);
dictattr("total","up",1);
dictattr("tote","up",1);
dictattr("touch","off",1);
dictattr("track","down",1);
dictattr("trade","off",1);
dictattr("trade","up",1);
dictattr("trickle","down",1);
dictattr("trickle","out",1);
dictattr("trip","up",1);
dictattr("try","out",1);
dictattr("tumble","down",1);
dictattr("turn","down",1);
dictattr("turn","off",1);
dictattr("turn","out",1);
dictattr("turn","up",1);
dictattr("use","up",1);
dictattr("vote","down",1);
dictattr("wake","up",1);
dictattr("walk","off",1); # walk the jitters off.
dictattr("walk","out",1);
dictattr("wall","off",1);
dictattr("ward","off",1);
dictattr("warm","up",1);
dictattr("wash","down",1);
dictattr("watch","out",1);
dictattr("water","down",1);
dictattr("wave","off",1);
dictattr("wear","down",1);
dictattr("wear","off",1);
dictattr("wear","out",1);
dictattr("weed","out",1);
dictattr("weigh","down",1);
dictattr("whack","off",1);
dictattr("wheel","up",1);
dictattr("whip","up",1);
dictattr("whittle","down",1);
dictattr("win","out",1);
dictattr("wind","down",1);
dictattr("wind","up",1);
dictattr("wipe","out",1);
dictattr("work","down",1);
dictattr("work","off",1);
dictattr("work","out",1);
dictattr("work","up",1);
dictattr("wrap","up",1);
dictattr("write","down",1); # ?
dictattr("write","off",1);
dictattr("yank","down",1);
dictattr("yank","off",1);
dictattr("yank","out",1);
dictattr("yield","up",1);
dictattr("zero","out",1);
#### PREPOSITIONAL ####
# NOTE: Need to distinguish
# 1. transitive "bring about X"
# 2. intransitive "X eased off."
dictattr("account","for",2);
dictattr("act","up",2);
dictattr("ante","up",2);
dictattr("apply","for",2);
dictattr("balk","at",2); #
#dictattr("bark","up",2); # ?
dictattr("back","off",2); # also 1?
dictattr("bleed","off",2); # ? 1 ?
dictattr("bone","up",2);
dictattr("bind","up",2);
dictattr("bring","about",2); # ?
dictattr("brush","up",2);
dictattr("bubble","up",2);
dictattr("buzz","off",2);
dictattr("call","for",2); # 06/14/06 AM.
dictattr("catch","up",2);
dictattr("charge","off",2); # ?
dictattr("check","up",2); # on...
dictattr("clam","up",2);
dictattr("climb","up",2);
dictattr("come","off",2);
dictattr("come","up",2);
dictattr("complain","to",2); #
dictattr("consist","of",2);
dictattr("cozy","up",2);
dictattr("creep","up",2);
dictattr("crop","up",2);
dictattr("die","off",2);
dictattr("dive","off",2); # ?
dictattr("doze","off",2);
dictattr("dry","up",2);
dictattr("ease","off",2);
dictattr("ease","up",2);
dictattr("edge","up",2);
dictattr("end","up",2);
dictattr("face","up",2);
dictattr("fall","off",2);
dictattr("feed","up",2); # Only "fed up"...
dictattr("flare","up",2);
dictattr("fly","off",2); # ?
dictattr("fret","about",2);
dictattr("gang","up",2);
dictattr("gaze","up",2);
dictattr("give","off",2);
dictattr("go","to",2); #
dictattr("go","up",2);
dictattr("head","up",2);
dictattr("hole","up",2);
dictattr("hop","up",2);
dictattr("inch","up",2);
dictattr("jet","off",2); # 04/21/07 AM.
dictattr("jump","up",2);
dictattr("lead","to",2); #
dictattr("lead","up",2);
dictattr("let","up",2);
dictattr("link","to",2);
dictattr("live","off",2); # ?
dictattr("live","up",2);
dictattr("look","at",2);
dictattr("look","out",2);
dictattr("measure","up",2);
dictattr("own","up",2); # to...
dictattr("pay","up",2);
dictattr("point","to",2); #
dictattr("point","toward",2);
dictattr("play","up",2);
dictattr("pony","up",2); # /in ?
dictattr("pop","up",2);
#dictattr("range","up",2);
dictattr("reach","up",2);
dictattr("read","up",2);
dictattr("rear","up",2);
dictattr("relate","to",2); #
dictattr("rise","up",2);
dictattr("rocket","up",2);
dictattr("seize","up",2); # ?
dictattr("silt","up",2); # ??
dictattr("sit","up",2);
dictattr("skid","off",2); # ?
dictattr("skip","off",2);
dictattr("slack","off",2);
dictattr("slip","up",2);
dictattr("sneak","up",2);
dictattr("speak","up",2);
dictattr("specialize","in",2); #
dictattr("spring","up",2);
dictattr("sprout","up",2);
dictattr("square","off",2); # also 1?
dictattr("stay","up",2);
dictattr("stop","off",2); # ? # 1?
#dictattr("stride","up",2); # to...
dictattr("suit","up",2);
dictattr("swear","off",2);
dictattr("tail","off",2); # ?
dictattr("talk","about",2);
dictattr("taper","off",2);
dictattr("team","up",2);
dictattr("tee","off",2); # 1?
dictattr("think","about",2);
dictattr("tick","up",2);
dictattr("trend","up",2);
dictattr("walk","up",2);
dictattr("wander","off",2);
dictattr("wear","off",2); # also 1?
dictattr("well","up",2);
dictattr("whisk","off",2); # ?
dictattr("zoom","up",2);
######### PREPOSITIONAL AND/OR PHRASAL ####
# Both are valid.
dictattr("curl","up",3);
dictattr("dash","off",3); # dash a letter off
dictattr("hang","out",3);
dictattr("run","off",3);
dictattr("set","off",3);
dictattr("take","off",3);
dictattr("show","up",3);
dictattr("sign","off",3); # sign property off...
dictattr("start","off",3); # ? # start off happy...
#dictattr("bounce","off",x); # ?
# dictattr("get","off",x); # get something off -- X7,X9 verb...
#dictattr("veer","off",x);
########################################
# CORE PART-OF-SPEECH
########################################
# For example, "possible" is listed as noun and adj.
# But at its core, it is an adjective that can be used
# in noun contexts.
dictattr("personal","core","adj");
dictattr("possible","core","adj");
########################################
# JJ PREFERRED OVER VBN
########################################
# Words that prefer an adjective interpretation
# with copula or ellipted copula contexts.
# Semantic overtones here, eg, human-emotion-verbs.
# Also states of people and things.
# THESE WERE DONE FROM CORPUS.
dictattr("abandon","jj-pref",1);
dictattr("abash","jj-pref",1);
dictattr("abort","jj-pref",1);
dictattr("abuse","jj-pref",1);
dictattr("accelerate","jj-pref",1);
dictattr("accept","jj-pref",1);
dictattr("acclaim","jj-pref",1);
dictattr("accomplish","jj-pref",1);
dictattr("accrue","jj-pref",1);
dictattr("accumulate","jj-pref",1);
dictattr("accuse","jj-pref",1);
dictattr("accustom","jj-pref",1);
dictattr("acknowledge","jj-pref",1);
dictattr("acquire","jj-pref",1);
dictattr("activate","jj-pref",1);
dictattr("add","jj-pref",1);
dictattr("addict","jj-pref",1);
dictattr("addle","jj-pref",1);
dictattr("address","jj-pref",1);
dictattr("adjust","jj-pref",1);
dictattr("admire","jj-pref",1);
dictattr("admit","jj-pref",1);
dictattr("adopt","jj-pref",1);
dictattr("adulterate","jj-pref",1);
dictattr("advance","jj-pref",1);
dictattr("advertise","jj-pref",1);
dictattr("advise","jj-pref",1);
dictattr("affect","jj-pref",1);
dictattr("affiliate","jj-pref",1);
dictattr("afflict","jj-pref",1);
dictattr("aforemention","jj-pref",1);
dictattr("age","jj-pref",1);
dictattr("agree","jj-pref",1);
dictattr("alarm","jj-pref",1);
dictattr("align","jj-pref",1);
dictattr("allege","jj-pref",1);
dictattr("ally","jj-pref",1);
dictattr("allow","jj-pref",1);
dictattr("alter","jj-pref",1);
dictattr("amaze","jj-pref",1);
dictattr("amuse","jj-pref",1);
dictattr("anesthetize","jj-pref",1);
dictattr("anger","jj-pref",1);
dictattr("anguish","jj-pref",1);
dictattr("animate","jj-pref",1);
dictattr("announce","jj-pref",1);
dictattr("annoy","jj-pref",1);
dictattr("annualize","jj-pref",1);
dictattr("anticipate","jj-pref",1);
dictattr("antiquate","jj-pref",1);
dictattr("appall","jj-pref",1);
dictattr("apply","jj-pref",1);
dictattr("appoint","jj-pref",1);
dictattr("appreciate","jj-pref",1);
dictattr("approve","jj-pref",1);
dictattr("approximate","jj-pref",1);
dictattr("arch","jj-pref",1);
dictattr("arm","jj-pref",1);
dictattr("armor","jj-pref",1);
dictattr("ashame","jj-pref",1);
dictattr("ask","jj-pref",1);
dictattr("assemble","jj-pref",1);
dictattr("assign","jj-pref",1);
dictattr("assimilate","jj-pref",1);
dictattr("associate","jj-pref",1);
dictattr("assort","jj-pref",1);
dictattr("assume","jj-pref",1);
dictattr("assure","jj-pref",1);
dictattr("astound","jj-pref",1);
dictattr("attach","jj-pref",1);
dictattr("attempt","jj-pref",1);
dictattr("attire","jj-pref",1);
dictattr("attune","jj-pref",1);
dictattr("audit","jj-pref",1);
dictattr("augment","jj-pref",1);
dictattr("authorize","jj-pref",1);
dictattr("autograph","jj-pref",1);
dictattr("automate","jj-pref",1);
dictattr("avoid","jj-pref",1);
dictattr("await","jj-pref",1);
dictattr("awe","jj-pref",1);
dictattr("back","jj-pref",1);
dictattr("backhand","jj-pref",1);
dictattr("bag","jj-pref",1);
dictattr("bake","jj-pref",1);
dictattr("balance","jj-pref",1);
dictattr("balkanize","jj-pref",1);
dictattr("barbeque","jj-pref",1);
dictattr("bate","jj-pref",1);
dictattr("batter","jj-pref",1);
dictattr("beach","jj-pref",1);
dictattr("beard","jj-pref",1);
dictattr("belate","jj-pref",1); #
dictattr("beleaguer","jj-pref",1);
dictattr("belittle","jj-pref",1);
dictattr("belle","jj-pref",1);
dictattr("beloved","jj-pref",1);
dictattr("bemuse","jj-pref",1);
dictattr("benight","jj-pref",1);
dictattr("beribbon","jj-pref",1);
dictattr("besiege","jj-pref",1);
dictattr("bespectacle","jj-pref",1);
dictattr("bewilder","jj-pref",1);
dictattr("bifurcate","jj-pref",1);
dictattr("bigot","jj-pref",1);
dictattr("bill","jj-pref",1);
dictattr("bleach","jj-pref",1);
dictattr("blend","jj-pref",1);
dictattr("blight","jj-pref",1);
dictattr("blindfold","jj-pref",1);
dictattr("blindside","jj-pref",1);
dictattr("bloat","jj-pref",1);
dictattr("block","jj-pref",1);
dictattr("bloody","jj-pref",1);
dictattr("bond","jj-pref",1);
dictattr("bore","jj-pref",1);
dictattr("borrow","jj-pref",1);
dictattr("botch","jj-pref",1);
dictattr("bottle","jj-pref",1);
dictattr("brand","jj-pref",1);
dictattr("broker","jj-pref",1);
dictattr("buckle","jj-pref",1);
dictattr("bureaucraticize","jj-pref",1);
dictattr("bury","jj-pref",1);
dictattr("burn","jj-pref",1);
dictattr("bust","jj-pref",1);
dictattr("calculate","jj-pref",1);
dictattr("camouflage","jj-pref",1);
dictattr("cancel","jj-pref",1);
dictattr("can","jj-pref",1);
dictattr("capitalize","jj-pref",1);
dictattr("cap","jj-pref",1);
dictattr("captivate","jj-pref",1);
dictattr("carve","jj-pref",1);
dictattr("cater","jj-pref",1);
dictattr("celebrate","jj-pref",1);
dictattr("centralize","jj-pref",1);
dictattr("certify","jj-pref",1);
dictattr("chain","jj-pref",1);
dictattr("chair","jj-pref",1);
dictattr("change","jj-pref",1);
dictattr("characterize","jj-pref",1);
dictattr("charge","jj-pref",1);
dictattr("char","jj-pref",1);
dictattr("charter","jj-pref",1);
dictattr("cheat","jj-pref",1);
dictattr("cherish","jj-pref",1);
dictattr("chill","jj-pref",1);
dictattr("chopp","jj-pref",1);
dictattr("choreograph","jj-pref",1);
dictattr("circumscribe","jj-pref",1);
dictattr("civilise","jj-pref",1);
dictattr("civilize","jj-pref",1);
dictattr("classify","jj-pref",1);
dictattr("clearhead","jj-pref",1);
dictattr("cliche","jj-pref",1);
dictattr("clog","jj-pref",1);
dictattr("cloister","jj-pref",1);
dictattr("close","jj-pref",1);
dictattr("closet","jj-pref",1);
dictattr("cloud","jj-pref",1);
dictattr("clutter","jj-pref",1);
dictattr("coat","jj-pref",1);
dictattr("cockeye","jj-pref",1);
dictattr("code","jj-pref",1);
dictattr("coerce","jj-pref",1);
dictattr("coif","jj-pref",1);
dictattr("coldheart","jj-pref",1);
dictattr("collapse","jj-pref",1);
dictattr("collateralize","jj-pref",1);
dictattr("color","jj-pref",1);
dictattr("combine","jj-pref",1);
dictattr("commit","jj-pref",1);
dictattr("compact","jj-pref",1);
dictattr("compel","jj-pref",1);
dictattr("complete","jj-pref",1);
dictattr("complicate","jj-pref",1);
dictattr("compound","jj-pref",1);
dictattr("compute","jj-pref",1);
dictattr("computerize","jj-pref",1);
dictattr("computerrelate","jj-pref",1);
dictattr("conceal","jj-pref",1);
dictattr("conceive","jj-pref",1);
dictattr("concentrate","jj-pref",1);
dictattr("concern","jj-pref",1);
dictattr("concert","jj-pref",1);
dictattr("condemn","jj-pref",1);
dictattr("condense","jj-pref",1);
dictattr("condition","jj-pref",1);
dictattr("confine","jj-pref",1);
dictattr("confirm","jj-pref",1);
dictattr("confuse","jj-pref",1);
dictattr("congest","jj-pref",1);
dictattr("connect","jj-pref",1);
dictattr("consider","jj-pref",1);
dictattr("consolidate","jj-pref",1);
dictattr("constrict","jj-pref",1);
dictattr("contain","jj-pref",1);
dictattr("contaminate","jj-pref",1);
dictattr("contemplate","jj-pref",1);
dictattr("content","jj-pref",1);
dictattr("contest","jj-pref",1);
dictattr("continue","jj-pref",1);
dictattr("contort","jj-pref",1);
dictattr("contrive","jj-pref",1);
dictattr("control","jj-pref",1);
dictattr("convert","jj-pref",1);
dictattr("convince","jj-pref",1);
dictattr("convolute","jj-pref",1);
dictattr("cook","jj-pref",1);
dictattr("coordinate","jj-pref",1);
dictattr("corner","jj-pref",1);
dictattr("correct","jj-pref",1);
dictattr("corrugate","jj-pref",1);
dictattr("cover","jj-pref",1);
dictattr("covet","jj-pref",1);
dictattr("crab","jj-pref",1);
dictattr("cramp","jj-pref",1);
dictattr("crash","jj-pref",1);
dictattr("craze","jj-pref",1);
dictattr("create","jj-pref",1);
dictattr("credentialize","jj-pref",1);
dictattr("crest","jj-pref",1);
dictattr("criminalize","jj-pref",1);
dictattr("crimp","jj-pref",1);
dictattr("cripple","jj-pref",1);
dictattr("crook","jj-pref",1);
dictattr("crowd","jj-pref",1);
dictattr("crumple","jj-pref",1);
dictattr("crush","jj-pref",1);
dictattr("curve","jj-pref",1);
dictattr("customize","jj-pref",1);
dictattr("damage","jj-pref",1);
dictattr("damn","jj-pref",1);
dictattr("date","jj-pref",1);
dictattr("daunt","jj-pref",1);
dictattr("daze","jj-pref",1);
dictattr("deadlock","jj-pref",1);
dictattr("debilitate","jj-pref",1);
dictattr("decapitalize","jj-pref",1);
dictattr("decease","jj-pref",1);
dictattr("decentralize","jj-pref",1);
dictattr("declare","jj-pref",1);
dictattr("decommission","jj-pref",1);
dictattr("decompose","jj-pref",1);
dictattr("deconstruct","jj-pref",1);
dictattr("decriminalize","jj-pref",1);
dictattr("dedicate","jj-pref",1);
dictattr("default","jj-pref",1);
dictattr("defer","jj-pref",1);
dictattr("define","jj-pref",1);
dictattr("deform","jj-pref",1);
dictattr("degrade","jj-pref",1);
dictattr("dehumidify","jj-pref",1);
dictattr("dehydrate","jj-pref",1);
dictattr("delay","jj-pref",1);
dictattr("delight","jj-pref",1);
dictattr("dement","jj-pref",1);
dictattr("demonstrate","jj-pref",1);
dictattr("demoralize","jj-pref",1);
dictattr("depress","jj-pref",1);
dictattr("deregulate","jj-pref",1);
dictattr("desert","jj-pref",1);
dictattr("designate","jj-pref",1);
dictattr("desire","jj-pref",1);
dictattr("destroy","jj-pref",1);
dictattr("detail","jj-pref",1);
dictattr("deteriorate","jj-pref",1);
dictattr("determine","jj-pref",1);
dictattr("devastate","jj-pref",1);
dictattr("develop","jj-pref",1);
dictattr("devote","jj-pref",1);
dictattr("differentiate","jj-pref",1);
dictattr("digitalize","jj-pref",1);
dictattr("dignify","jj-pref",1);
dictattr("dilapidate","jj-pref",1);
dictattr("dilute","jj-pref",1);
dictattr("diminish","jj-pref",1);
dictattr("dimwitted","jj-pref",1);
dictattr("disable","jj-pref",1);
dictattr("disadvantage","jj-pref",1);
dictattr("disaffect","jj-pref",1);
dictattr("disappoint","jj-pref",1);
dictattr("disband","jj-pref",1);
dictattr("discipline","jj-pref",1);
dictattr("disclose","jj-pref",1);
dictattr("discomfit","jj-pref",1);
dictattr("disconnect","jj-pref",1);
dictattr("discontent","jj-pref",1);
dictattr("discontinue","jj-pref",1);
dictattr("discount","jj-pref",1);
dictattr("discourage","jj-pref",1);
dictattr("discredit","jj-pref",1);
dictattr("discriminate","jj-pref",1);
dictattr("disease","jj-pref",1);
dictattr("disembody","jj-pref",1);
dictattr("disenchant","jj-pref",1);
dictattr("disfavor","jj-pref",1);
dictattr("disgruntle","jj-pref",1);
dictattr("disguise","jj-pref",1);
dictattr("disgust","jj-pref",1);
dictattr("dishevel","jj-pref",1);
dictattr("disincline","jj-pref",1);
dictattr("disinterest","jj-pref",1);
dictattr("disjoint","jj-pref",1);
dictattr("dislike","jj-pref",1);
dictattr("dislocate","jj-pref",1);
dictattr("dismay","jj-pref",1);
dictattr("disorganize","jj-pref",1);
dictattr("disorient","jj-pref",1);
dictattr("disperse","jj-pref",1);
dictattr("displease","jj-pref",1);
dictattr("dispose","jj-pref",1);
dictattr("dispute","jj-pref",1);
dictattr("dissatisfy","jj-pref",1);
dictattr("distill","jj-pref",1);
dictattr("distinguish","jj-pref",1);
dictattr("distort","jj-pref",1);
dictattr("distress","jj-pref",1);
dictattr("distribute","jj-pref",1);
dictattr("disturb","jj-pref",1);
dictattr("disuse","jj-pref",1);
dictattr("diversify","jj-pref",1);
dictattr("divest","jj-pref",1);
dictattr("divide","jj-pref",1);
dictattr("divorce","jj-pref",1);
dictattr("dog","jj-pref",1);
dictattr("dome","jj-pref",1);
dictattr("doom","jj-pref",1);
dictattr("dot","jj-pref",1);
dictattr("dread","jj-pref",1);
dictattr("dry","jj-pref",1);
dictattr("drown","jj-pref",1);
dictattr("dumbfound","jj-pref",1);
dictattr("earn","jj-pref",1);
dictattr("edge","jj-pref",1);
dictattr("educate","jj-pref",1);
dictattr("elate","jj-pref",1);
dictattr("elect","jj-pref",1);
dictattr("electrogalvanize","jj-pref",1);
dictattr("elevate","jj-pref",1);
dictattr("embargo","jj-pref",1);
dictattr("embarrass","jj-pref",1);
dictattr("embattle","jj-pref",1);
dictattr("embed","jj-pref",1);
dictattr("embitter","jj-pref",1);
dictattr("embolden","jj-pref",1);
dictattr("enamor","jj-pref",1);
dictattr("encourage","jj-pref",1);
dictattr("endanger","jj-pref",1);
dictattr("end","jj-pref",1);
dictattr("endow","jj-pref",1);
dictattr("enforce","jj-pref",1);
dictattr("engage","jj-pref",1);
dictattr("engineer","jj-pref",1);
dictattr("enhance","jj-pref",1);
dictattr("enlarge","jj-pref",1);
dictattr("enlighten","jj-pref",1);
dictattr("enlist","jj-pref",1);
dictattr("enrage","jj-pref",1);
dictattr("entangle","jj-pref",1);
dictattr("enthrall","jj-pref",1);
dictattr("entrench","jj-pref",1);
dictattr("enumerate","jj-pref",1);
dictattr("equip","jj-pref",1);
dictattr("establish","jj-pref",1);
dictattr("estimate","jj-pref",1);
dictattr("estrange","jj-pref",1);
dictattr("evenhanded","jj-pref",1);
dictattr("evolve","jj-pref",1);
dictattr("exaggerate","jj-pref",1);
dictattr("excite","jj-pref",1);
dictattr("execute","jj-pref",1);
dictattr("exhaust","jj-pref",1);
dictattr("exile","jj-pref",1);
dictattr("expand","jj-pref",1);
dictattr("expect","jj-pref",1);
dictattr("expedite","jj-pref",1);
dictattr("experience","jj-pref",1);
dictattr("expire","jj-pref",1);
dictattr("expose","jj-pref",1);
dictattr("extend","jj-pref",1);
dictattr("fable","jj-pref",1);
dictattr("fabricate","jj-pref",1);
dictattr("factor","jj-pref",1);
dictattr("fade","jj-pref",1);
dictattr("fail","jj-pref",1);
dictattr("fame","jj-pref",1);
dictattr("farfetched","jj-pref",1);
dictattr("farm","jj-pref",1);
dictattr("fatiegue","jj-pref",1);
dictattr("favor","jj-pref",1);
dictattr("fear","jj-pref",1);
dictattr("feather","jj-pref",1);
dictattr("feature","jj-pref",1);
dictattr("feed","jj-pref",1);
dictattr("federalize","jj-pref",1);
dictattr("fence","jj-pref",1);
dictattr("fertilize","jj-pref",1);
dictattr("film","jj-pref",1);
dictattr("finance","jj-pref",1);
dictattr("finish","jj-pref",1);
dictattr("fix","jj-pref",1);
dictattr("flabbergasted","jj-pref",1);
dictattr("flaw","jj-pref",1);
dictattr("fluster","jj-pref",1);
dictattr("focus","jj-pref",1);
dictattr("fog","jj-pref",1);
dictattr("foil","jj-pref",1);
dictattr("follow","jj-pref",1);
dictattr("force","jj-pref",1);
dictattr("foreclose","jj-pref",1);
dictattr("forge","jj-pref",1);
dictattr("fork","jj-pref",1);
dictattr("form","jj-pref",1);
dictattr("fortify","jj-pref",1);
dictattr("foul","jj-pref",1);
dictattr("fracture","jj-pref",1);
dictattr("fragment","jj-pref",1);
dictattr("frame","jj-pref",1);
dictattr("franchise","jj-pref",1);
dictattr("frank","jj-pref",1);
dictattr("fray","jj-pref",1);
dictattr("frenzy","jj-pref",1);
dictattr("fry","jj-pref",1);
dictattr("frighten","jj-pref",1);
dictattr("frustrate","jj-pref",1);
dictattr("fund","jj-pref",1);
dictattr("furnish","jj-pref",1);
dictattr("furrow","jj-pref",1);
dictattr("galvanize","jj-pref",1);
dictattr("generalize","jj-pref",1);
dictattr("germinate","jj-pref",1);
dictattr("gift","jj-pref",1);
dictattr("gild","jj-pref",1);
dictattr("globalize","jj-pref",1);
dictattr("glut","jj-pref",1);
dictattr("govern","jj-pref",1);
dictattr("graduate","jj-pref",1);
dictattr("graft","jj-pref",1);
dictattr("grain","jj-pref",1);
dictattr("grant","jj-pref",1);
dictattr("gratify","jj-pref",1);
dictattr("grid","jj-pref",1);
dictattr("gridlock","jj-pref",1);
dictattr("grill","jj-pref",1);
dictattr("grizzle","jj-pref",1);
dictattr("ground","jj-pref",1);
dictattr("guarantee","jj-pref",1);
dictattr("guard","jj-pref",1);
dictattr("hairyknuckled","jj-pref",1);
dictattr("halfheart","jj-pref",1);
dictattr("hallow","jj-pref",1);
dictattr("halve","jj-pref",1);
dictattr("handicap","jj-pref",1);
dictattr("harden","jj-pref",1);
dictattr("haunt","jj-pref",1);
dictattr("heat","jj-pref",1);
dictattr("heighten","jj-pref",1);
dictattr("helmet","jj-pref",1);
dictattr("highpriced","jj-pref",1);
dictattr("hone","jj-pref",1);
dictattr("honor","jj-pref",1);
dictattr("hook","jj-pref",1);
dictattr("hospitalize","jj-pref",1);
dictattr("host","jj-pref",1);
dictattr("humiliate","jj-pref",1);
dictattr("hunch","jj-pref",1);
dictattr("hurry","jj-pref",1);
dictattr("ice","jj-pref",1);
dictattr("idealize","jj-pref",1);
dictattr("identify","jj-pref",1);
dictattr("illuminate","jj-pref",1);
dictattr("immiserate","jj-pref",1);
dictattr("impact","jj-pref",1);
dictattr("impair","jj-pref",1);
dictattr("impassion","jj-pref",1);
dictattr("imperil","jj-pref",1);
dictattr("imply","jj-pref",1);
dictattr("import","jj-pref",1);
dictattr("impose","jj-pref",1);
dictattr("impoverish","jj-pref",1);
dictattr("impress","jj-pref",1);
dictattr("improve","jj-pref",1);
dictattr("impute","jj-pref",1);
dictattr("incense","jj-pref",1);
dictattr("incline","jj-pref",1);
dictattr("include","jj-pref",1);
#dictattr("incorporate","jj-pref",1);
dictattr("increase","jj-pref",1);
dictattr("indebt","jj-pref",1);
dictattr("index","jj-pref",1);
dictattr("indicate","jj-pref",1);
dictattr("industrialize","jj-pref",1);
dictattr("inexperienced","jj-pref",1);
dictattr("infect","jj-pref",1);
dictattr("infest","jj-pref",1);
dictattr("inflame","jj-pref",1);
dictattr("inflate","jj-pref",1);
dictattr("inform","jj-pref",1);
dictattr("ingrain","jj-pref",1);
dictattr("inhabit","jj-pref",1);
dictattr("inherit","jj-pref",1);
dictattr("injure","jj-pref",1);
dictattr("inspire","jj-pref",1);
dictattr("install","jj-pref",1);
dictattr("instrument","jj-pref",1);
dictattr("insulate","jj-pref",1);
dictattr("insure","jj-pref",1);
dictattr("integrate","jj-pref",1);
dictattr("intend","jj-pref",1);
dictattr("intensify","jj-pref",1);
dictattr("intention","jj-pref",1);
dictattr("interest","jj-pref",1);
dictattr("interrelate","jj-pref",1);
dictattr("interrupt","jj-pref",1);
dictattr("intoxicate","jj-pref",1);
dictattr("intrigue","jj-pref",1);
dictattr("introvert","jj-pref",1);
dictattr("invert","jj-pref",1);
dictattr("involve","jj-pref",1);
dictattr("irradiate","jj-pref",1);
dictattr("irritate","jj-pref",1);
dictattr("isolate","jj-pref",1);
dictattr("issue","jj-pref",1);
dictattr("jade","jj-pref",1);
dictattr("jail","jj-pref",1);
dictattr("jam","jj-pref",1);
dictattr("justify","jj-pref",1);
dictattr("kerchiefed","jj-pref",1);
dictattr("key","jj-pref",1);
dictattr("kindred","jj-pref",1);
dictattr("kink","jj-pref",1);
dictattr("labor","jj-pref",1);
dictattr("ladder","jj-pref",1);
dictattr("landlock","jj-pref",1);
dictattr("lapse","jj-pref",1);
#dictattr("lead","jj-pref",1); # Need to be, etc.
dictattr("lease","jj-pref",1);
dictattr("leverage","jj-pref",1);
dictattr("liberalize","jj-pref",1);
dictattr("liberate","jj-pref",1);
dictattr("license","jj-pref",1);
dictattr("light","jj-pref",1);
dictattr("lightheaded","jj-pref",1);
dictattr("lighthearted","jj-pref",1);
dictattr("limit","jj-pref",1);
dictattr("line","jj-pref",1);
dictattr("link","jj-pref",1);
dictattr("liquify","jj-pref",1);
dictattr("list","jj-pref",1);
dictattr("livery","jj-pref",1);
dictattr("load","jj-pref",1);
dictattr("localize","jj-pref",1);
dictattr("locate","jj-pref",1);
dictattr("lock","jj-pref",1);
dictattr("longhaired","jj-pref",1);
dictattr("lopsided","jj-pref",1);
dictattr("love","jj-pref",1);
dictattr("mail","jj-pref",1);
dictattr("manage","jj-pref",1);
dictattr("man","jj-pref",1);
dictattr("manner","jj-pref",1);
dictattr("manufacture","jj-pref",1);
dictattr("mark","jj-pref",1);
dictattr("marry","jj-pref",1);
dictattr("match","jj-pref",1);
dictattr("measure","jj-pref",1);
dictattr("mechanize","jj-pref",1);
dictattr("merge","jj-pref",1);
dictattr("midpriced","jj-pref",1);
dictattr("midsized","jj-pref",1);
dictattr("miff","jj-pref",1);
dictattr("mill","jj-pref",1);
dictattr("mineralize","jj-pref",1);
dictattr("mire","jj-pref",1);
dictattr("misguided","jj-pref",1);
dictattr("mishandle","jj-pref",1);
dictattr("miss","jj-pref",1);
dictattr("mistrust","jj-pref",1);
dictattr("mix","jj-pref",1);
dictattr("modernize","jj-pref",1);
dictattr("modify","jj-pref",1);
dictattr("money","jj-pref",1);
dictattr("monied","jj-pref",1); #
dictattr("monitor","jj-pref",1);
dictattr("monogram","jj-pref",1);
dictattr("mortgagebacked","jj-pref",1);
dictattr("motivate","jj-pref",1);
dictattr("motorize","jj-pref",1);
dictattr("mount","jj-pref",1);
dictattr("multifaceted","jj-pref",1);
dictattr("multilayered","jj-pref",1);
dictattr("multisided","jj-pref",1);
dictattr("mustachioed","jj-pref",1);
dictattr("mute","jj-pref",1);
dictattr("naked","jj-pref",1);
dictattr("name","jj-pref",1);
dictattr("naturalize","jj-pref",1);
dictattr("natured","jj-pref",1);
dictattr("need","jj-pref",1);
dictattr("neglect","jj-pref",1);
dictattr("negotiate","jj-pref",1);
dictattr("newfangled","jj-pref",1);
dictattr("nonchlorinated","jj-pref",1);
dictattr("noninstitutionalized","jj-pref",1);
dictattr("nonregulate","jj-pref",1);
dictattr("note","jj-pref",1);
dictattr("notice","jj-pref",1);
dictattr("obligate","jj-pref",1);
dictattr("oblige","jj-pref",1);
dictattr("observe","jj-pref",1);
dictattr("obsess","jj-pref",1);
dictattr("occupy","jj-pref",1);
dictattr("offer","jj-pref",1);
dictattr("oppose","jj-pref",1);
dictattr("oppress","jj-pref",1);
dictattr("organize","jj-pref",1);
dictattr("orient","jj-pref",1);
dictattr("orphan","jj-pref",1);
dictattr("oust","jj-pref",1);
dictattr("outdate","jj-pref",1);
dictattr("outlaw","jj-pref",1);
dictattr("outline","jj-pref",1);
dictattr("outmoded","jj-pref",1);
dictattr("outrage","jj-pref",1);
dictattr("outsize","jj-pref",1);
dictattr("overburden","jj-pref",1);
dictattr("overcollect","jj-pref",1);
dictattr("overcrowd","jj-pref",1);
dictattr("overdevelop","jj-pref",1);
dictattr("overdress","jj-pref",1);
dictattr("overextend","jj-pref",1);
dictattr("overhype","jj-pref",1);
dictattr("overjoy","jj-pref",1);
dictattr("overleverage","jj-pref",1);
dictattr("overload","jj-pref",1);
dictattr("overprice","jj-pref",1);
dictattr("overregulate","jj-pref",1);
dictattr("oversized","jj-pref",1);
dictattr("overstaffed","jj-pref",1);
dictattr("overstored","jj-pref",1);
dictattr("oversubscribe","jj-pref",1);
dictattr("oversupply","jj-pref",1);
dictattr("overuse","jj-pref",1);
dictattr("overvalue","jj-pref",1);
dictattr("overwhelm","jj-pref",1);
dictattr("overwork","jj-pref",1);
dictattr("own","jj-pref",1);
dictattr("oxidize","jj-pref",1);
dictattr("package","jj-pref",1);
dictattr("pack","jj-pref",1);
dictattr("pad","jj-pref",1);
dictattr("pain","jj-pref",1);
dictattr("paint","jj-pref",1);
dictattr("pamper","jj-pref",1);
dictattr("panic","jj-pref",1);
dictattr("paralyze","jj-pref",1);
dictattr("parch","jj-pref",1);
dictattr("part","jj-pref",1);
dictattr("patch","jj-pref",1);
dictattr("patent","jj-pref",1);
dictattr("pave","jj-pref",1);
dictattr("peak","jj-pref",1);
dictattr("perceive","jj-pref",1);
dictattr("perforate","jj-pref",1);
dictattr("perfume","jj-pref",1);
dictattr("perplex","jj-pref",1);
dictattr("personalize","jj-pref",1);
dictattr("perturb","jj-pref",1);
dictattr("pervert","jj-pref",1);
dictattr("petrify","jj-pref",1);
dictattr("pinheaded","jj-pref",1);
dictattr("pinpoint","jj-pref",1);
dictattr("pitch","jj-pref",1);
dictattr("plan","jj-pref",1);
dictattr("please","jj-pref",1);
dictattr("pleat","jj-pref",1);
dictattr("pockmarked","jj-pref",1);
dictattr("point","jj-pref",1);
dictattr("poise","jj-pref",1);
dictattr("polish","jj-pref",1);
dictattr("politicize","jj-pref",1);
dictattr("pollute","jj-pref",1);
dictattr("pool","jj-pref",1);
dictattr("populate","jj-pref",1);
dictattr("position","jj-pref",1);
dictattr("post","jj-pref",1);
dictattr("postpone","jj-pref",1);
dictattr("pot","jj-pref",1);
dictattr("powder","jj-pref",1);
dictattr("practice","jj-pref",1);
dictattr("praise","jj-pref",1);
dictattr("prearrange","jj-pref",1);
dictattr("preclude","jj-pref",1);
dictattr("prefer","jj-pref",1);
dictattr("prejudice","jj-pref",1);
dictattr("premediate","jj-pref",1);
dictattr("premeditate","jj-pref",1);
dictattr("preoccupy","jj-pref",1);
dictattr("prepare","jj-pref",1);
dictattr("prescribe","jj-pref",1);
dictattr("pressure","jj-pref",1);
dictattr("presume","jj-pref",1);
dictattr("price","jj-pref",1);
dictattr("prime","jj-pref",1);
dictattr("principle","jj-pref",1);
dictattr("print","jj-pref",1);
dictattr("privatize","jj-pref",1);
dictattr("privilege","jj-pref",1);
dictattr("prize","jj-pref",1);
dictattr("process","jj-pref",1);
dictattr("proclaim","jj-pref",1);
dictattr("profess","jj-pref",1);
dictattr("program","jj-pref",1);
dictattr("project","jj-pref",1);
dictattr("prolong","jj-pref",1);
dictattr("promise","jj-pref",1);
dictattr("pronounce","jj-pref",1);
dictattr("proportion","jj-pref",1);
dictattr("propose","jj-pref",1);
dictattr("protect","jj-pref",1);
dictattr("protracted","jj-pref",1);
dictattr("prove","jj-pref",1);
dictattr("provoke","jj-pref",1);
dictattr("publicize","jj-pref",1);
dictattr("publish","jj-pref",1);
dictattr("purchase","jj-pref",1);
dictattr("purport","jj-pref",1);
dictattr("pursue","jj-pref",1);
dictattr("puzzle","jj-pref",1);
dictattr("qualify","jj-pref",1);
dictattr("quickwitted","jj-pref",1);
dictattr("rag","jj-pref",1);
dictattr("raise","jj-pref",1);
dictattr("rank","jj-pref",1);
dictattr("rape","jj-pref",1);
dictattr("rate","jj-pref",1);
dictattr("rationalize","jj-pref",1);
dictattr("rattle","jj-pref",1);
dictattr("realign","jj-pref",1);
dictattr("realize","jj-pref",1);
dictattr("reason","jj-pref",1);
dictattr("receive","jj-pref",1);
dictattr("recognize","jj-pref",1);
dictattr("recommend","jj-pref",1);
dictattr("reconstruct","jj-pref",1);
dictattr("record","jj-pref",1);
dictattr("recycle","jj-pref",1);
dictattr("redesign","jj-pref",1);
dictattr("reduce","jj-pref",1);
dictattr("refine","jj-pref",1);
dictattr("reform","jj-pref",1);
dictattr("reformulate","jj-pref",1);
dictattr("refrigerate","jj-pref",1);
dictattr("regard","jj-pref",1);
dictattr("regiment","jj-pref",1);
dictattr("register","jj-pref",1);
dictattr("regulate","jj-pref",1);
dictattr("reinforce","jj-pref",1);
dictattr("rejuvenate","jj-pref",1);
dictattr("relate","jj-pref",1);
dictattr("relax","jj-pref",1);
dictattr("relieve","jj-pref",1);
dictattr("renew","jj-pref",1);
dictattr("renovate","jj-pref",1);
dictattr("renown","jj-pref",1);
dictattr("rent","jj-pref",1);
dictattr("reoffer","jj-pref",1);
dictattr("reorganize","jj-pref",1);
dictattr("repaint","jj-pref",1);
dictattr("repeat","jj-pref",1);
dictattr("report","jj-pref",1);
dictattr("repossess","jj-pref",1);
dictattr("repress","jj-pref",1);
dictattr("repute","jj-pref",1);
dictattr("require","jj-pref",1);
dictattr("reserve","jj-pref",1);
#dictattr("resign","jj-pref",1); # Need to-be or other context.
dictattr("respect","jj-pref",1);
dictattr("restate","jj-pref",1);
dictattr("restrain","jj-pref",1);
dictattr("restrict","jj-pref",1);
dictattr("restructure","jj-pref",1);
dictattr("restyle","jj-pref",1);
dictattr("retain","jj-pref",1);
dictattr("retard","jj-pref",1);
dictattr("retire","jj-pref",1);
dictattr("retract","jj-pref",1);
dictattr("revere","jj-pref",1);
dictattr("reverse","jj-pref",1);
dictattr("revile","jj-pref",1);
dictattr("revise","jj-pref",1);
dictattr("rib","jj-pref",1);
dictattr("riddle","jj-pref",1);
dictattr("rig","jj-pref",1);
dictattr("roast","jj-pref",1);
dictattr("roll","jj-pref",1);
dictattr("root","jj-pref",1);
dictattr("round","jj-pref",1);
dictattr("ruffle","jj-pref",1);
dictattr("rugged","jj-pref",1);
dictattr("ruin","jj-pref",1);
dictattr("rumor","jj-pref",1);
dictattr("rumple","jj-pref",1);
dictattr("rupture","jj-pref",1);
dictattr("rush","jj-pref",1);
dictattr("sacred","jj-pref",1);
dictattr("sadden","jj-pref",1);
dictattr("salary","jj-pref",1);
dictattr("satisfy","jj-pref",1);
dictattr("saturate","jj-pref",1);
dictattr("scare","jj-pref",1);
dictattr("scarr","jj-pref",1);
dictattr("scatter","jj-pref",1);
dictattr("scent","jj-pref",1);
dictattr("schedule","jj-pref",1);
dictattr("scorch","jj-pref",1);
dictattr("score","jj-pref",1);
dictattr("scramble","jj-pref",1);
dictattr("scuttle","jj-pref",1);
dictattr("seal","jj-pref",1);
dictattr("season","jj-pref",1);
dictattr("secure","jj-pref",1);
dictattr("segment","jj-pref",1);
dictattr("segregate","jj-pref",1);
dictattr("select","jj-pref",1);
dictattr("separate","jj-pref",1);
dictattr("sequin","jj-pref",1);
dictattr("settle","jj-pref",1);
dictattr("shade","jj-pref",1);
dictattr("shape","jj-pref",1);
dictattr("share","jj-pref",1);
dictattr("shatter","jj-pref",1);
dictattr("shear","jj-pref",1);
dictattr("shellshock","jj-pref",1);
dictattr("shelter","jj-pref",1);
dictattr("shelve","jj-pref",1);
dictattr("ship","jj-pref",1);
dictattr("shock","jj-pref",1);
dictattr("short","jj-pref",1);
dictattr("shorthanded","jj-pref",1);
dictattr("shortlived","jj-pref",1);
dictattr("shortsighted","jj-pref",1);
dictattr("shred","jj-pref",1);
dictattr("shutter","jj-pref",1);
dictattr("sicken","jj-pref",1);
dictattr("sideline","jj-pref",1);
dictattr("sign","jj-pref",1);
dictattr("simplify","jj-pref",1);
dictattr("simulate","jj-pref",1);
dictattr("skew","jj-pref",1);
dictattr("skilled","jj-pref",1);
dictattr("slacken","jj-pref",1);
dictattr("slant","jj-pref",1);
dictattr("slight","jj-pref",1);
dictattr("smash","jj-pref",1);
dictattr("snap","jj-pref",1);
dictattr("socalled","jj-pref",1);
dictattr("soften","jj-pref",1);
dictattr("soil","jj-pref",1);
dictattr("solarheated","jj-pref",1);
dictattr("solicit","jj-pref",1);
dictattr("sophisticate","jj-pref",1);
dictattr("soul","jj-pref",1);
dictattr("sour","jj-pref",1);
dictattr("specialize","jj-pref",1);
dictattr("specify","jj-pref",1);
dictattr("speckle","jj-pref",1);
dictattr("spike","jj-pref",1);
dictattr("spirited","jj-pref",1);
dictattr("splinter","jj-pref",1);
dictattr("spoil","jj-pref",1);
dictattr("spot","jj-pref",1);
dictattr("spurn","jj-pref",1);
dictattr("squash","jj-pref",1);
dictattr("stagger","jj-pref",1);
dictattr("stall","jj-pref",1);
dictattr("standardize","jj-pref",1);
dictattr("state","jj-pref",1);
dictattr("stereotype","jj-pref",1);
dictattr("sterilize","jj-pref",1);
dictattr("stew","jj-pref",1);
dictattr("stiffnecked","jj-pref",1);
dictattr("stipple","jj-pref",1);
dictattr("strain","jj-pref",1);
dictattr("straitjacket","jj-pref",1);
dictattr("strap","jj-pref",1);
dictattr("stratify","jj-pref",1);
dictattr("streamline","jj-pref",1);
dictattr("strengthen","jj-pref",1);
dictattr("stretch","jj-pref",1);
dictattr("stripe","jj-pref",1);
dictattr("strip","jj-pref",1);
dictattr("structure","jj-pref",1);
dictattr("study","jj-pref",1);
dictattr("stuff","jj-pref",1);
dictattr("stun","jj-pref",1);
dictattr("stymy","jj-pref",1);
dictattr("subdue","jj-pref",1);
dictattr("subjugate","jj-pref",1);
dictattr("subordinate","jj-pref",1);
dictattr("subsidize","jj-pref",1);
dictattr("substantiate","jj-pref",1);
dictattr("sugar","jj-pref",1);
dictattr("suggest","jj-pref",1);
dictattr("supercharge","jj-pref",1);
dictattr("superconcentrate","jj-pref",1);
dictattr("supervise","jj-pref",1);
dictattr("suppose","jj-pref",1);
dictattr("suppress","jj-pref",1);
dictattr("surprise","jj-pref",1);
dictattr("suspect","jj-pref",1);
dictattr("suspend","jj-pref",1);
dictattr("sustain","jj-pref",1);
dictattr("sweeten","jj-pref",1);
dictattr("swell","jj-pref",1);
dictattr("switch","jj-pref",1);
dictattr("syndicate","jj-pref",1);
dictattr("tailor","jj-pref",1);
dictattr("taint","jj-pref",1);
dictattr("talented","jj-pref",1);
dictattr("tangle","jj-pref",1);
dictattr("tape","jj-pref",1);
dictattr("taper","jj-pref",1);
dictattr("target","jj-pref",1);
dictattr("tarnish","jj-pref",1);
dictattr("tatter","jj-pref",1);
dictattr("televise","jj-pref",1);
dictattr("tender","jj-pref",1);
dictattr("terrify","jj-pref",1);
dictattr("tether","jj-pref",1);
dictattr("texture","jj-pref",1);
dictattr("thoroughbred","jj-pref",1);
dictattr("threaten","jj-pref",1);
dictattr("thrill","jj-pref",1);
dictattr("tick","jj-pref",1);
dictattr("tighten","jj-pref",1);
dictattr("tightfisted","jj-pref",1);
dictattr("tilt","jj-pref",1);
dictattr("time","jj-pref",1);
dictattr("tint","jj-pref",1);
dictattr("tire","jj-pref",1);
dictattr("title","jj-pref",1);
dictattr("tongue","jj-pref",1);
dictattr("torment","jj-pref",1);
dictattr("torture","jj-pref",1);
dictattr("track","jj-pref",1);
dictattr("trade","jj-pref",1);
dictattr("train","jj-pref",1);
dictattr("trample","jj-pref",1);
dictattr("transfer","jj-pref",1);
dictattr("transmit","jj-pref",1);
dictattr("transplant","jj-pref",1);
dictattr("trap","jj-pref",1);
dictattr("treasure","jj-pref",1);
dictattr("try","jj-pref",1);
dictattr("trigger","jj-pref",1);
dictattr("trim","jj-pref",1);
dictattr("trouble","jj-pref",1);
dictattr("truncate","jj-pref",1);
dictattr("tune","jj-pref",1);
dictattr("tuxedo","jj-pref",1);
dictattr("twist","jj-pref",1);
dictattr("twotiered","jj-pref",1);
dictattr("unabashed","jj-pref",1);
dictattr("unabated","jj-pref",1);
dictattr("unabsorbed","jj-pref",1);
dictattr("unaccompanied","jj-pref",1);
dictattr("unaccounted","jj-pref",1);
dictattr("unaccustomed","jj-pref",1);
dictattr("unaddressed","jj-pref",1);
dictattr("unadjusted","jj-pref",1);
dictattr("unadorned","jj-pref",1);
dictattr("unaffected","jj-pref",1);
dictattr("unaffiliated","jj-pref",1);
dictattr("unaltered","jj-pref",1);
dictattr("unamended","jj-pref",1);
dictattr("unamortized","jj-pref",1);
dictattr("unamused","jj-pref",1);
dictattr("unannounced","jj-pref",1);
dictattr("unanswered","jj-pref",1);
dictattr("unanticipated","jj-pref",1);
dictattr("unapproved","jj-pref",1);
dictattr("unarmed","jj-pref",1);
dictattr("unasked","jj-pref",1);
dictattr("unassisted","jj-pref",1);
dictattr("unattended","jj-pref",1);
dictattr("unaudited","jj-pref",1);
dictattr("unauthorized","jj-pref",1);
dictattr("unbalanced","jj-pref",1);
dictattr("unbiased","jj-pref",1);
dictattr("unbleached","jj-pref",1);
dictattr("unbridled","jj-pref",1);
dictattr("uncalled","jj-pref",1);
dictattr("uncensored","jj-pref",1);
dictattr("unchallenged","jj-pref",1);
dictattr("unchanged","jj-pref",1);
dictattr("uncharted","jj-pref",1);
dictattr("unchecked","jj-pref",1);
dictattr("unclaimed","jj-pref",1);
dictattr("unclassified","jj-pref",1);
dictattr("unclothed","jj-pref",1);
dictattr("uncoached","jj-pref",1);
dictattr("uncoated","jj-pref",1);
dictattr("uncollaborated","jj-pref",1);
dictattr("uncombed","jj-pref",1);
dictattr("uncompensated","jj-pref",1);
dictattr("uncomplicated","jj-pref",1);
dictattr("unconcerned","jj-pref",1);
dictattr("unconfirmed","jj-pref",1);
dictattr("unconnected","jj-pref",1);
dictattr("unconsolidated","jj-pref",1);
dictattr("uncontested","jj-pref",1);
dictattr("uncontrolled","jj-pref",1);
dictattr("unconvinced","jj-pref",1);
dictattr("uncorrected","jj-pref",1);
dictattr("uncountered","jj-pref",1);
dictattr("uncovered","jj-pref",1);
dictattr("undamaged","jj-pref",1);
dictattr("undated","jj-pref",1);
dictattr("undaunted","jj-pref",1);
dictattr("undecided","jj-pref",1);
dictattr("undeclared","jj-pref",1);
dictattr("undefeated","jj-pref",1);
dictattr("undefined","jj-pref",1);
dictattr("undelivered","jj-pref",1);
dictattr("underappreciated","jj-pref",1);
dictattr("undercapitalized","jj-pref",1);
dictattr("underdeveloped","jj-pref",1);
dictattr("underdressed","jj-pref",1);
dictattr("undereducated","jj-pref",1);
dictattr("underemployed","jj-pref",1);
dictattr("underfunded","jj-pref",1);
dictattr("undermine","jj-pref",1);
dictattr("underprepared","jj-pref",1);
dictattr("underpriced","jj-pref",1);
dictattr("underprivileged","jj-pref",1);
dictattr("underserved","jj-pref",1);
dictattr("undersized","jj-pref",1);
dictattr("understate","jj-pref",1);
dictattr("undervalued","jj-pref",1);
dictattr("underworked","jj-pref",1);
dictattr("undeserved","jj-pref",1);
dictattr("undetected","jj-pref",1);
dictattr("undetermined","jj-pref",1);
dictattr("undeterred","jj-pref",1);
dictattr("undeveloped","jj-pref",1);
dictattr("undiluted","jj-pref",1);
dictattr("undisciplined","jj-pref",1);
dictattr("undisclosed","jj-pref",1);
dictattr("undisputed","jj-pref",1);
dictattr("undistinguished","jj-pref",1);
dictattr("undisturbed","jj-pref",1);
dictattr("undiversified","jj-pref",1);
dictattr("undivided","jj-pref",1);
dictattr("undreamed","jj-pref",1);
dictattr("unearned","jj-pref",1);
dictattr("uneducated","jj-pref",1);
dictattr("unelected","jj-pref",1);
dictattr("unemployed","jj-pref",1);
dictattr("unencumbered","jj-pref",1);
dictattr("unenlightened","jj-pref",1);
dictattr("unequaled","jj-pref",1);
dictattr("unescorted","jj-pref",1);
dictattr("unexercised","jj-pref",1);
dictattr("unexpected","jj-pref",1);
dictattr("unexpended","jj-pref",1);
dictattr("unexplained","jj-pref",1);
dictattr("unexplored","jj-pref",1);
dictattr("unfazed","jj-pref",1);
dictattr("unfertilized","jj-pref",1);
dictattr("unfettered","jj-pref",1);
dictattr("unfilled","jj-pref",1);
dictattr("unfinished","jj-pref",1);
dictattr("unfixed","jj-pref",1);
dictattr("unfocused","jj-pref",1);
dictattr("unfounded","jj-pref",1);
dictattr("unfulfilled","jj-pref",1);
dictattr("unfunded","jj-pref",1);
dictattr("unglued","jj-pref",1);
dictattr("unguaranteed","jj-pref",1);
dictattr("unguided","jj-pref",1);
dictattr("unharmed","jj-pref",1);
dictattr("unhealed","jj-pref",1);
dictattr("unheeded","jj-pref",1);
dictattr("unheralded","jj-pref",1);
dictattr("unhindered","jj-pref",1);
dictattr("unidentified","jj-pref",1);
dictattr("unify","jj-pref",1);
dictattr("uniformed","jj-pref",1);
dictattr("unimpaired","jj-pref",1);
dictattr("unimpeded","jj-pref",1);
dictattr("unimpressed","jj-pref",1);
dictattr("unimproved","jj-pref",1);
dictattr("unincorporated","jj-pref",1);
dictattr("unindicted","jj-pref",1);
dictattr("uninfected","jj-pref",1);
dictattr("uninformed","jj-pref",1);
dictattr("uninhabited","jj-pref",1);
dictattr("uninhibited","jj-pref",1);
dictattr("uninitiated","jj-pref",1);
dictattr("uninspected","jj-pref",1);
dictattr("uninspired","jj-pref",1);
dictattr("uninsured","jj-pref",1);
dictattr("unintended","jj-pref",1);
dictattr("uninterested","jj-pref",1);
dictattr("uninterrupted","jj-pref",1);
dictattr("uninvited","jj-pref",1);
dictattr("unionize","jj-pref",1);
dictattr("unissued","jj-pref",1);
dictattr("united","jj-pref",1);
dictattr("unjustified","jj-pref",1);
dictattr("unlabeled","jj-pref",1);
dictattr("unleaded","jj-pref",1);
dictattr("unlicensed","jj-pref",1);
dictattr("unlimited","jj-pref",1);
dictattr("unlinked","jj-pref",1);
dictattr("unlisted","jj-pref",1);
dictattr("unloaded","jj-pref",1);
dictattr("unmanned","jj-pref",1);
dictattr("unmarked","jj-pref",1);
dictattr("unmarried","jj-pref",1);
dictattr("unmatched","jj-pref",1);
dictattr("unmoved","jj-pref",1);
dictattr("unnamed","jj-pref",1);
dictattr("unneeded","jj-pref",1);
dictattr("unnerve","jj-pref",1);
dictattr("unnoticed","jj-pref",1);
dictattr("unnumbered","jj-pref",1);
dictattr("unobserved","jj-pref",1);
dictattr("unoccupied","jj-pref",1);
dictattr("unopened","jj-pref",1);
dictattr("unopposed","jj-pref",1);
dictattr("unorganized","jj-pref",1);
dictattr("unpack","jj-pref",1);
dictattr("unparalleled","jj-pref",1);
dictattr("unpaved","jj-pref",1);
dictattr("unpegged","jj-pref",1);
dictattr("unperformed","jj-pref",1);
dictattr("unperturbed","jj-pref",1);
dictattr("unplanned","jj-pref",1);
dictattr("unpolished","jj-pref",1);
dictattr("unprecedented","jj-pref",1);
dictattr("unprepared","jj-pref",1);
dictattr("unprotected","jj-pref",1);
dictattr("unpublicized","jj-pref",1);
dictattr("unpublished","jj-pref",1);
dictattr("unpunctured","jj-pref",1);
dictattr("unpunished","jj-pref",1);
dictattr("unqualified","jj-pref",1);
dictattr("unraveled","jj-pref",1);
dictattr("unrealized","jj-pref",1);
dictattr("unrecognized","jj-pref",1);
dictattr("unrefrigerated","jj-pref",1);
dictattr("unregistered","jj-pref",1);
dictattr("unregulated","jj-pref",1);
dictattr("unreinforced","jj-pref",1);
dictattr("unrelated","jj-pref",1);
dictattr("unreleased","jj-pref",1);
dictattr("unreported","jj-pref",1);
dictattr("unresolved","jj-pref",1);
dictattr("unrestrained","jj-pref",1);
dictattr("unrestricted","jj-pref",1);
dictattr("unretouched","jj-pref",1);
dictattr("unrivaled","jj-pref",1);
dictattr("unsanctioned","jj-pref",1);
dictattr("unsatisfied","jj-pref",1);
dictattr("unscathed","jj-pref",1);
dictattr("unscheduled","jj-pref",1);
dictattr("unscripted","jj-pref",1);
dictattr("unseat","jj-pref",1);
dictattr("unsecured","jj-pref",1);
dictattr("unsettled","jj-pref",1);
dictattr("unshackled","jj-pref",1);
dictattr("unshirted","jj-pref",1);
dictattr("unsigned","jj-pref",1);
dictattr("unskilled","jj-pref",1);
dictattr("unsolicited","jj-pref",1);
dictattr("unsolved","jj-pref",1);
dictattr("unspecified","jj-pref",1);
dictattr("unspoiled","jj-pref",1);
dictattr("unstated","jj-pref",1);
dictattr("unstimulated","jj-pref",1);
dictattr("unstructured","jj-pref",1);
dictattr("unsubordinated","jj-pref",1);
dictattr("unsubsidized","jj-pref",1);
dictattr("unsubstantiated","jj-pref",1);
dictattr("unsupported","jj-pref",1);
dictattr("unsurpassed","jj-pref",1);
dictattr("unsurprised","jj-pref",1);
dictattr("unsuspected","jj-pref",1);
dictattr("unswagged","jj-pref",1);
dictattr("untamed","jj-pref",1);
dictattr("untapped","jj-pref",1);
dictattr("untarnished","jj-pref",1);
dictattr("untested","jj-pref",1);
dictattr("untouched","jj-pref",1);
dictattr("untrained","jj-pref",1);
dictattr("untreated","jj-pref",1);
dictattr("untried","jj-pref",1);
dictattr("unturned","jj-pref",1);
dictattr("unused","jj-pref",1);
dictattr("unveiled","jj-pref",1);
dictattr("unwanted","jj-pref",1);
dictattr("unwarranted","jj-pref",1);
dictattr("unwashed","jj-pref",1);
dictattr("unwed","jj-pref",1);
dictattr("update","jj-pref",1);
dictattr("upend","jj-pref",1);
dictattr("upgrade","jj-pref",1);
dictattr("use","jj-pref",1);
dictattr("value","jj-pref",1);
dictattr("vary","jj-pref",1);
dictattr("vaunt","jj-pref",1);
dictattr("ventilate","jj-pref",1);
dictattr("vest","jj-pref",1);
dictattr("vex","jj-pref",1);
dictattr("victimize","jj-pref",1);
dictattr("voice","jj-pref",1);
dictattr("wall","jj-pref",1);
dictattr("want","jj-pref",1);
dictattr("warmhearted","jj-pref",1);
dictattr("warp","jj-pref",1);
dictattr("warrant","jj-pref",1);
dictattr("waste","jj-pref",1);
dictattr("watch","jj-pref",1);
dictattr("waterlog","jj-pref",1);
dictattr("weaken","jj-pref",1);
dictattr("weakwilled","jj-pref",1);
dictattr("weight","jj-pref",1);
dictattr("wellplaced","jj-pref",1);
dictattr("whalesized","jj-pref",1);
dictattr("whipsaw","jj-pref",1);
dictattr("whitewalled","jj-pref",1);
dictattr("wholehearted","jj-pref",1);
dictattr("wicked","jj-pref",1);
dictattr("widow","jj-pref",1);
dictattr("wilt","jj-pref",1);
dictattr("wing","jj-pref",1);
dictattr("word","jj-pref",1);
dictattr("worry","jj-pref",1);
dictattr("wound","jj-pref",1);
dictattr("wretched","jj-pref",1);
dictattr("wrinkle","jj-pref",1);
########################################
# SOFT PLURALS
########################################
# Can participate in noun noun phrases.
# Ex: A futures contract.
dictattr("funds","soft-plural",1);
dictattr("futures","soft-plural",1);
dictattr("securities","soft-plural",1);
########################################
# COMMON CAPS/ABBRS
########################################
# Common abbreviations or capitals that
# act like reqular words.
dictattr("pc","common-cap",1);
dictattr("pcs","common-cap",1);
# FLAG THAT KB HAS BEEN LOADED.
replaceval(findroot(),"kb loaded",1);
@@CODE
|
@CODE
# A global threshold for confidence in a category.
#var("threshold", 70) # Minimum is 70%
G("threshold") = 70;
# Moved here. #
@@CODE
@NODES _ROOT
@RULES
_BLANKLINE <- _xWILD [min=0 max=0 matches=(\ \r \t)] \n @@
# Just whitespace.
#_LINE <- _xWILD [min=0 max=0 fails=(\r \n \t)] \n @@
_LINE [unsealed] <- _xWILD [min=0 max=0 fails=(\n)] \n @@
_LINE [unsealed] <- _xWILD [plus fails=(\r \n)] @@
|
@NODES _LINE
@PRE
<1,1> cap();
<1,1> length(6);
@RULES
# Ex: Skills
_SkillsHeaderWord [layer=(_headerWord )] <- _xWILD [min=1 max=1 s match=("Skills")] @@
|
@NODES _ROOT
@POST
prlit("ctc.txt", "CONTACT ZONE\n");
prlit("ctc.txt", "------------\n");
ndump("ctc.txt",1);
prlit("ctc.txt", "\n");
@RULES
_xNIL <- _contactZone @@
|
@DECL
printblurb(L("out"))
{
L("out") << "*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*\n";
L("out") << "*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*\n";
L("out") << "*x* *x*\n";
L("out") << "*x* Copyright (C) 1990 University of Pennsylvania *x*\n";
L("out") << "*x* *x*\n";
L("out") << "*x* The data in this file are part of a preliminary version of the *x*\n";
L("out") << "*x* Penn Treebank Corpus. Any research using this corpus or based *x*\n";
L("out") << "*x* on it should acknowledge that fact, as well as the preliminary *x*\n";
L("out") << "*x* nature of the corpus. *x*\n";
L("out") << "*x* *x*\n";
L("out") << "*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*\n";
L("out") << "*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*\n";
L("out") << "*x* Copyright (C) 2005 Text Analysis International, Inc. *x*\n";
L("out") << "*x* All rights reserved. *x*\n";
L("out") << "*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*\n";
}
############ POSTOKB
## NOTE: Send pos to kb.
######################
postokb(L("nm"),L("txt"))
{
if (!L("nm") || !L("txt"))
return;
if (strisdigit(L("txt")))
return;
# CONFIGURE: TO DISTINGUISH LETTER CASE, COMMENT THIS: #
L("txt") = strtolower(L("txt")); # 09/24/13 AM.
L("con") = getconcept(G("kbpos"),L("nm"));
L("wcon") = getconcept(L("con"),L("txt"));
}
############ POSTOFILE
## NOTE: Send pos to file.
######################
postofile()
{
if (!G("kbpos")) return;
sorthier(G("kbpos"));
L("o") = "pos.txt";
L("c") = down(G("kbpos"));
while (L("c"))
{
L("o") << "\n" << strtoupper(conceptname(L("c"))) << "\n";
# Words for this pos.
L("w") = down(L("c"));
while (L("w"))
{
L("o") << conceptname(L("w")) << "\n";
L("w") = next(L("w"));
}
L("c") = next(L("c"));
}
}
###################################################################
@CODE
# If not outputting tags, exit.
if (!G("verbose")) # Todo: another flag here.
exitpass();
if (G("pretagged"))
exitpass();
if (L("con") = findconcept(findroot(),"pos")) # 09/19/13 AM.
rmconcept(L("con")); # CLEAR LIST FOR CURRENT DOC. # 09/19/13 AM.
G("kbpos") = getconcept(findroot(),"pos"); # 09/16/13 AM.
G("para") = "======================================";
if (G("treebank"))
printblurb("tags.txt");
# Initialize traversal data.
G("parseRoot") = pnroot();
G("node") = G("parseRoot");
G("depth") = 0;
G("path") = 0; # Store the current path in the parse tree.
L("newline") = 1; # If on a new empty line.
L("newpar") = 0; # If at new paragraph.
while (G("node")) # Traverse the parse tree.
{
G("path")[G("depth")] = G("node"); # Update path in the parse tree.
G("childs") = pndown(G("node"));
G("next") = pnnext(G("node"));
# If there are prior deleted tokens, print those.
# If bracketing this node, do the start.
if (G("bracket") && pnvar(G("node"),"bracket"))
{
if (!L("newline") && !L("newpar"))
"tags.txt" << "\n";
"tags.txt" << "[ ";
L("newline") = 0;
L("newpar") = 0;
}
# Stop at a node with a mypos variable.
# Need some other way for default pos tags...
L("nm") = pnname(G("node"));
L("ln") = strlength(L("nm")) - 1;
L("ch") = strpiece(L("nm"),0,0);
if (L("ch") != "_") # Literal.
{
if (strisdigit(L("nm")))
pnreplaceval(G("node"),"mypos","CD");
else if (L("ch") == " " || L("ch") == "\t"
|| L("ch") == "\n" || L("ch") == "\r")
; # Ignore whitespace.
else if (strisalpha(L("ch")))
{
if (!pnvar(G("node"),"mypos"))
pnreplaceval(G("node"),"mypos","UNKNOWN");
}
else # Punctuation.
pnreplaceval(G("node"),"nopos",1);
L("nm") = "NIL";
}
else
{
if (L("nm") == "_sent")
{
if (!G("bracket"))
"tags.txt" << "\n";
else
{
if (!L("newline") && !L("newpar"))
"tags.txt" << "\n";
if (!L("newpar"))
"tags.txt" << "\n";
}
L("newline") = 1;
}
else if (L("nm") == "_TEXTZONE")
{
if (!L("newline") && !L("newpar"))
"tags.txt" << "\n";
if (!L("newpar"))
"tags.txt" << "\n";
"tags.txt" << G("para") << "\n\n";
L("newline") = 1;
L("newpar") = 1;
}
if (L("ln") >= 1)
L("nm") = strpiece(L("nm"),1,L("ln"));
}
L("npos") = nodepos(G("node"),L("nm"));
L("ignorepos") = pnvar(G("node"),"ignorepos");
L("nopos") = pnvar(G("node"),"nopos");
if (L("npos") && !L("ignorepos"))
{
L("newpar") = 0;
G("gochilds") = 0; # Don't traverse children.
L("txt") = prosify(G("node"),"text"); # 12/15/20 AM.
"tags.txt" << L("txt")
<< "/"
<< L("npos")
;
# CONFIGURE: EACH POS TO ITS OWN FILE. #
# L("out") = L("nm") + ".txt"; #
# L("out") << L("txt") << "\n"; #
# OR THIS, ALL IN ONE FILE: #
postokb(L("nm"),L("txt")); # 09/16/13 AM.
if (!G("bracket"))
{
"tags.txt" << "\n";
L("newline") = 1;
}
else
{
"tags.txt" << " ";
L("newline") = 0;
}
if (G("bracket") && pnvar(G("node"),"bracket"))
{
"tags.txt" << "]\n"; # End bracket.
L("newline") = 1;
}
}
else if (L("nopos")) # Things like punctuation...
{
L("newpar") = 0;
G("gochilds") = 0; # Don't traverse children.
L("txt") = pnvar(G("node"),"$text");
"tags.txt" << L("txt")
<< "/"
<< L("txt"); # Just echo it.
if (!G("bracket"))
{
"tags.txt" << "\n";
L("newline") = 1;
}
else
{
"tags.txt" << " ";
L("newline") = 0;
}
if (G("bracket") && pnvar(G("node"),"bracket"))
{
"tags.txt" << "]\n"; # End bracket.
L("newline") = 1;
}
}
else
G("gochilds") = 1; # Traverse children.
if (G("childs") # If node has children, traverse them.
&& G("gochilds"))
{
G("node") = G("childs");
++G("depth");
}
else if (G("next")) # If node has right sibling, get it.
{
G("node") = G("next");
}
else # Try continuing from a parent.
{
G("done") = 0;
G("node") = 0;
while (!G("done")) # Find a continuation or quit.
{
if (--G("depth") > 0)
{
G("node") = G("path")[G("depth")]; # Move up to parent.
if (G("bracket") && pnvar(G("node"),"bracket"))
{
"tags.txt" << "]\n"; # End bracket.
L("newline") = 1;
}
if (G("node") = pnnext(G("node"))) # Try to move right.
G("done") = 1;
}
else
G("done") = 1;
}
}
}
postofile(); # 09/16/13 AM.
@@CODE
|
# Make concept under given parent concept. Optionally as the numth child of the parent. num==0 or absent places concept at end of list of children. name is the name of new concept.
L("return_con") = makeconcept(L("parent"), L("name"), L("num")); |
@PATH _ROOT _headerZone _conjugationGroup _catGroup _liGroup
@POST
G("file") << G("verb") << " \"" << X("title",3) << "\" " << N("text",1) << " " << N("text",2) << " " << N("text",3) << "\n";
@RULES
_xNIL <-
_iGroup ### (1)
_iGroup ### (2)
_hiGroup [look] ### (3)
@@
@POST
G("file") << G("verb") << " \"" << X("title",3) << "\" " << N("text",1) << " " << N("text",2) << "\n";
@RULES
_xNIL <-
_iGroup ### (1)
_hiGroup [look] ### (2)
@@
|
@NODES _ROOT
@PRE
<1,1> vareq("num",0);
@POST
G("word") = N("$text",1);
"word.txt" << N("$text",1) << "\n";
@RULES
_xNIL <-
_LINE ### (1)
@@
|
###################################################
# FILE: lines.pat
# SUBJ: Gather Lines
# CREATED: 10/Mar/99
# Date of this version: 31/Aug/01
# Copyright
###################################################
@NODES _ROOT
@RULES
_BLANKLINE <-
_xWILD [min=0 max=0 matches=(\ \t \r)] ### (1)
\n ### (2)
@@
_LINE <-
_xWILD [min=0 max=0 fails=(\r \n)] ### (1)
_xWILD [one match=(\n _xEND)] ### (2)
@@
###################################################
# FILE: lines.pat
# SUBJ: Gather Lines
# CREATED: 10/Mar/99
# Date of this version: 31/Aug/01
# Copyright
###################################################
@NODES _ROOT
@RULES
_BLANKLINE <-
_xWILD [min=0 max=0 matches=(\ \t \r)] ### (1)
\n ### (2)
@@
_LINE <-
_xWILD [min=0 max=0 fails=(\r \n)] ### (1)
_xWILD [one match=(\n _xEND)] ### (2)
@@
###################################################
# FILE: lines.pat
# SUBJ: Gather Lines
# CREATED: 10/Mar/99
# Date of this version: 31/Aug/01
# Copyright
###################################################
@NODES _ROOT
@RULES
_BLANKLINE <-
_xWILD [min=0 max=0 matches=(\ \t \r)] ### (1)
\n ### (2)
@@
_LINE <-
_xWILD [min=0 max=0 fails=(\r \n)] ### (1)
_xWILD [one match=(\n _xEND)] ### (2)
@@
|
@PATH _ROOT _experienceZone _LINE
@POST
S("len") = 1; # One cap in list.
single()
@RULES
# With [s], BASE is needed to prevent infinite loop in REC pass!
# Making this unsealed so we can gather data within _Caps later.
# (May not be needed.)
_Caps [base unsealed] <- _xCAP [s] @@
_Caps [base unsealed] <- _educationPart [s] @@ # 12/02/99 AM. Hack.
@POST
++N("len",1); # Increment number of caps.
listadd(1,3) # Discard the matched whitespace.
# Glom last cap into list, without nesting.
@RULES
_xNIL <- _Caps _xWHITE [s star]
_xWILD [s one match=( _xCAP _possessive _CompleteSchoolName
)] @@
# Adding a company pattern here. #
@POST
++N("len",1);
listadd(1,4)
@RULES
_xNIL <- _Caps \, [s] _xWHITE [s star] _companyRoot [s] @@
# Some generic stuff here.
@POST
# Don't increment length for this.
# Should retain the ampersand.
listadd(1,5)
@RULES
_xNIL <- _Caps _xWHITE [s star] \& [s] _xWHITE [s star]
_xWILD [s one match=( _xCAP _possessive _CompleteSchoolName
)] @@
|
@PATH _ROOT _posZone _defZone _definition _headerZone _LINE
@POST
addstrval(X("con",6),"text",N("text",1));
@RULES
_xNIL <-
_item ### (1)
@@ |
# Sort the strings in multi-string-valued global variable varname
@CODE
G("xx") = "abacus";
G("xx")[1] = "aardvark";
sortvals("xx");
"output.txt" << G("xx") << "\n"; |
#@NODES _ROOT
@PATH _ROOT
@RULES
_REZZONE [unsealed] <- _xWILD [plus fail=(
_contactBoundary
_objectiveBoundary
_educationBoundary
_experienceBoundary
_skillsBoundary
_presentationsBoundary
_publicationsBoundary
_referencesBoundary
_otherBoundary
)] @@
|
@CODE
# rmchildren(findroot());
G("level_1_con") = makeconcept(findroot(),"level_1_con");
G("level_1_words") = addstrval(G("level_1_con"), "words", "Space separated string 1.");
# G("level_1_num") = addnumval(G("level_1_con"), "num", 1);
# G("level_1_word") = addstrval(G("level_1_con"), "word", "one");
G("level_2_con") = makeconcept(G("level_1_con"), "level_2_con");
G("level_2_words") = addstrval(G("level_2_con"), "words", "Space separated string 2.");
# G("level_2_num") = addnumval(G("level_2_con"), "num", 2);
# G("level_2_word") = addstrval(G("level_2_con"), "word", "two");
G("level_3_con") = makeconcept(G("level_2_con"), "level_3_con");
G("level_3_words") = addstrval(G("level_3_con"), "words", "Space separated string 3.");
# G("level_3_num") = addnumval(G("level_3_con"), "num", 3);
# G("level_3_word") = addstrval(G("level_3_con"), "word", "three");
G("level_3_con_2") = makeconcept(G("level_2_con"), "level_3_con_2");
G("level_3_words_2") = addstrval(G("level_3_con_2"), "words", "Space separated string 3, con 2.");
DisplayKB(G("level_1_con"), 1);
SaveKB("levels.kbb", G("level_1_con"), 2);
@@CODE |
@CODE
if (!G("pretagged"))
exitpass();
@@CODE
@PATH _ROOT _LINE _pos _tok
@POST
lookupword(N(1));
@RULES
_xNIL <-
_xALPHA
@@
|
@CODE
DisplayKB(G("kb"),0);
@@CODE |
@CODE
DisplayKB(G("people"),2);
@@CODE |
@NODES _ROOT
@PRE
<1,1> var("con");
<3,3> var("con");
@POST
L("con") = PathToConcept(G("kb"),N("$text",1));
addstrval(L("con"),N("con",3),N("con",5));
@RULES
_xNIL <-
_LINE ### (1)
_LINE ### (2)
_LINE ### (3)
_LINE ### (4)
_LINE ### (5)
@@
|
@NODES _ROOT
@RULES
_BLANKLINE <-
_xWILD [min=0 max=0 matches=(\ \t \r)] ### (1)
\n ### (2)
@@
@POST
S("num") = G("line number")++;
S("text") = N("$text",1);
single();
@RULES
_LINE <-
_xWILD [min=0 max=0 fails=(\r \n)] ### (1)
_xWILD [one match=(\n _xEND)] ### (2)
@@
|
# Create a dump file of knowledge base concept.
kbdumptree(L("root_con"), L("file_str")); |
@CODE
SaveKB("iso-countries.kbb",G("iso"),2);
sortchilds(G("countries"));
DisplayKB(G("countries"),2);
L("con") = down(G("countries"));
"countries.dict" << "# Country names in English\n";
while (L("con")) {
L("country") = strtolower(conceptname(L("con")));
"countries.dict" << L("country") << " country=1";
L("full") = strval(L("con"),"full");
"countries.dict" << " iso2=" << strval(L("con"),"iso2");
"countries.dict" << " iso3=" << strval(L("con"),"iso3");
"countries.dict" << "\n";
if (L("full") && (strendswith(L("full"),"of") || strendswith(L("full"),"the"))) {
"countries.dict" << L("full") << " " << L("country") << " country=1";
"countries.dict" << " iso2=" << strval(L("con"),"iso2");
"countries.dict" << " iso3=" << strval(L("con"),"iso3");
"countries.dict" << "\n";
}
L("con") = next(L("con"));
}
@@CODE |
@NODES _LINE
@RULES
# Ex: "University of XXX (XXX), -> _SchoolNamePhrase"
_SchoolNamePhrase [sealed] <-
_SchoolNamePhrase [s]
_xWHITE [star s]
_xWILD [min=1 max=1 s match=(for of) ]
_xWHITE [star s]
_xWILD [s opt match=(the)]
_xWHITE [s star]
_xALPHA [s]
_xWHITE [star s]
_xWILD [opt s fails=( _xPUNCT _xWHITE _whtSEP _xNUM
_degree _major _minor _gpa )]
@@
|
@PATH _ROOT _paragraph _sentence
###############################################
# Gal Luft, 57,
###############################################
@PRE
<3,3> var("age");
@POST
S("con") = AddPerson(N(1),0);
addnumval(S("con"),"age",num(N("$text",3)));
single();
@RULES
_person <-
_xWILD [one match=(_person _titleCaps)] ### (1)
\, ### (2)
_xNUM ### (3)
@@
###############################################
# Melissa Bragg of Canton, Ohio,
###############################################
# @POST
# S("con") = AddPerson(N(1),N(2));
# single();
# @RULES
# _person <-
# _person ### (1)
# _residentOf ### (2)
# @@
|
@NODES _LINE
@PRE
<1,1> cap();
@RULES
# Ex: Northeastern
_adjDirection <- _xWILD [min=1 max=1 s match=("Northeastern" "Southern" "Eastern" "Western" "Northern" "Northwestern" "Southeastern" "Southwestern" "Central")] @@
|
@CODE
# If found new sentence breaks, do this pass.
if (!G("eos"))
exitpass();
@@CODE
@NODES _TEXTZONE
@CHECK
if (!N("eos"))
fail();
@RULES
_EOS <-
_xANY
@@
|
@PATH _ROOT _paragraph _sentence
@POST
S("stock") = makeconcept(N("object",1),"stock");
addstrval(S("stock"),"action",N("$text",4));
addstrval(S("stock"),"percent",N("$text",5));
addnumval(S("stock"),"from",num(N("value",7)));
addnumval(S("stock"),"to",num(N("value",9)));
single();
@RULES
_event <-
_company [s] ### (1)
stock [s] ### (2)
_be [s] ### (3)
_direction [s] ### (4)
_percent [s] ### (5)
from [s] ### (6)
_money [s] ### (7)
_to [s] ### (8)
_money [s] ### (9)
@@
@POST
S("action") = makeconcept(X("object"),N("action",3));
addstrval(S("action"),"action","buy");
S("company1") = makeconcept(S("action"),"company1");
S("company2") = makeconcept(S("action"),"company2");
S("amount") = makeconcept(S("action"),"amount");
addstrval(S("company1"),"name",N("normal",1));
# COMPANY2 CONJUNCTION
if (N("conj count",4))
{
S("conj count") = 0;
while (S("conj count") < N("conj count",4))
addstrval(S("company2"),"name",N("conj",4)[S("conj count")++]);
}
else
addstrval(S("company2"),"name",N("normal",4));
# MONEY CONJUNCTION
if (N("conj count",6))
{
S("conj count") = 0;
while (S("conj count") < N("conj count",6))
addnumval(S("amount"),N("conj type",6)[S("conj count")],
num(N("conj value",6)[S("conj count")++]) );
}
else
addnumval(S("amount"),N("type",6),N("value",6));
single();
@RULES
_event <-
_company [s] ### (1)
_have [s optional] ### (2)
_xWILD [s matches=(_buy _acquire)] ### (3)
_company [s] ### (4)
for [s] ### (5)
_money [s] ### (6)
@@ |
@DECL
DictionaryStart() {
G("dict path") = G("$apppath") + "\\kb\\user\\all.dict";
G("dict") = openfile(G("dict path"));
}
DictionaryWord(L("word"),L("attrName"),L("value"),L("attrType")) {
G("dict") << L("word") << " " << L("attrName") << "=" << L("value") << "\n";
}
DictionaryEnd() {
closefile(G("dict"));
}
@@DECL |
@NODES _ROOT
@POST
"end.txt" << N("$text", 1) << "\n";
noop();
@RULES
_xNIL <-
_xWILD [fails=( \n _xEND)] ### (1)
_xWILD ### (2)
@@
|
@PATH _ROOT _headerZone
@PRE
<1,1> var("pos");
@POST
G("vocab") << G("word") << " pos=" << N("pos");
@RULES
_xNIL <-
_headerZone ### (1)
@@
|
@PATH _ROOT _paragraph _sentence
@RULES
_anaphora <-
_pro [s] ### (1)
@@
@POST
pncopyvars();
single();
@RULES
_anaphora <-
_det [s optional] ### (1)
_adj [s star] ### (2)
_buyEvent [s] ### (3)
@@ |
@CODE
L("f") = "math.txt";
# L("sqrt") = sqrt(9);
# L("pow") = pow(3,3);
# L("max") = max(5,4);
# L("min") = min(5,4);
L("f") << "Square root 9: " << L("sqrt") << "\n";
L("f") << "3 squared: " << L("pow") << "\n";
L("f") << "max(5,4): " << L("min") << "\n";
L("f") << "min(5,4): " << L("min") << "\n";
@@CODE |
@CODE
L("hello") = 0;
@@CODE
@PATH _ROOT
@PRE
<2,2> varz("NL");
<3,3> var("NL"); # The newline-before-me attribute.
@POST
if (N("NL",1) > 1)
{
++X("PARS"); # Count potential paragraphs.
++S("PAR");
}
singler(1,2);
@RULES
_LINE [unsealed] <-
_xANY
_xWILD [star fail=(_dummy)]
_xANY [opt lookahead]
@@
|
@CODE
L("hello") = 0;
@@CODE
#@PATH _ROOT _TEXTZONE _tok
@NODES _tok
# num - year - old
# alpha - alpha - alpha
@CHECK
if (X("hyphenated"))
fail();
@POST
X("hyphenated") = 1;
X("pos_np") = "JJ"; # Default. # 06/07/06 AM.
xrename("_adj");
X("num-year-old") = 1;
@RULES
_xNIL <-
_xSTART
_xWILD [plus match=(_xNUM _xALPHA)]
\-
year
\-
old
_xEND
@@
# num - alpha - num
# 1-for-2
# 2-out-of-3
# ...
@CHECK
if (X("hyphenated"))
fail();
@POST
X("hyphenated") = 1;
X("pos_np") = "JJ";
X("num-dash-dash") = 1;
xrename("_adj");
@RULES
_xNIL <-
_xSTART
_xNUM
_xWILD [plus match=(_xALPHA \- )]
_xNUM
_xEND
@@
_xNIL <-
_xSTART
_xNUM
\-
_xALPHA
\-
_xALPHA
_xEND
@@
# year - earlier
@CHECK
if (X("hyphenated"))
fail();
@POST
X("hyphenated") = 1;
X("pos_np") = "JJ";
xrename("_adj");
@RULES
_xNIL <-
year
\-
earlier
@@
# alpha - and - alpha
# alpha - alpha - alpha
@CHECK
if (X("hyphenated"))
fail();
@POST
X("hyphenated") = 1;
X("pos_np") = "JJ"; # Default. # 06/07/06 AM.
if (N("noun",1) && N("noun",5))
{
# Todo: Proper setup of these nouns.
# N("mypos",1) = N("mypos",5) = "NN";
xrename("_noun");
X("noun") = 1;
chpos(X(),"NN");
}
X("alpha-and-alpha") = 1;
@RULES
_xNIL <-
_xALPHA
\-
and
\-
_xALPHA
@@
# alpha - alpha - alpha
@CHECK
if (X("tok175 a-a-a-"))
fail();
if (X("hyphenated"))
fail(); # 05/28/07 AM.
@POST
X("hyphenated") = 1; # 05/28/07 AM.
xrename("_adj");
if (N("noun",5))
X("pos_np") = "NN";
else
{
X("adj") = 1;
chpos(X(),"JJ");
}
X("tok175 a-a-a-") = 1;
@RULES
_xNIL <-
_xSTART
_xWILD [star match=( _xNUM \, \- )]
_xALPHA
\-
_xALPHA
\-
_xALPHA
_xWILD [star match=( \- _xALPHA)]
_xEND
@@
# alpha . alpha . alpha
@CHECK
if (X("tok175 a.a.a"))
fail();
@POST
xrename("_noun");
X("noun") = 1;
chpos(X(),"NP");
X("tok175 a.a.a") = 1;
@RULES
_xNIL <-
_xSTART
_xALPHA
\.
_xALPHA
\.
_xALPHA
_xWILD [star match=( \. _xALPHA)]
_xEND
@@
# alpha - alpha
# Note: Splitting up the complex rule below.
@PRE
<2,2> var("noun");
<2,2> varz("adj");
<4,4> var("noun");
@CHECK
if (X("hyphenated"))
fail();
if (N("verb",4))
{
if (!vconjq(N(4),"inf") && !vconjq(N(4),"-s"))
fail();
}
@POST
L("tmp4") = N(4);
X("hyphenated") = 1;
L("cap2") = strisupper(N("$text",2));
L("cap4") = strisupper(N("$text",4));
if (L("cap2") || L("cap4"))
X("cap") = 1;
if (L("cap4"))
X("pos_np") = "NP";
group(4,4,"_noun");
pncopyvars(L("tmp4"),N(4));
fixnoun(N(4));
L("pos") = N("mypos",4);
if (L("pos") == "NNS")
L("pos") = "NN"; # 05/21/07 AM.
xrename("_adj");
if (pnvar(L("tmp4"),"sem") == "date")
chpos(X(),"JJ"); # eg., "five-year".
else
chpos(X(),L("pos")); # NN or NNS...
X("adj") = 1;
X("tok175 a-a0") = 1;
@RULES
_xNIL <-
_xSTART
_xALPHA
\-
_xALPHA
_xEND
@@
# alpha - alpha
# alpha dash alpha
# If it gloms to a word, use that.
@CHECK
if (X("hyphenated"))
fail();
@POST
L("tmp4") = N(4);
X("hyphenated") = 1;
L("cap2") = strisupper(N("$text",2));
L("cap4") = strisupper(N("$text",4));
if (L("cap2") || L("cap4"))
X("cap") = 1;
if (L("cap4"))
X("pos_np") = "NP";
# else
# X("pos_np") = "JJ"; # Default. #
#
# Try glomming.
# L("txt") = strtolower(N("$text",2)+N("$text",4));
# if (dictfindword(L("txt")))
# {
# L("t") = N("$text",2)+N("$text",4); # Preserve case.
# group(3,3,"_dash");
# xrename(L("t"));
# lookupword(X());
# X("id") = "tok
# }
# else
if (N("verb",4))
{
L("vc") = vconj(N(4));
if (L("vc") == "-ing"
|| L("vc") == "-en"
|| L("vc") == "-edn")
{
L("inflected") = 1;
X("pos_np") = "JJ"; # 05/04/07 AM.
}
}
if (L("inflected") && !L("cap4"))
{
group(4,4,"_adj");
xrename("_adj");
X("pos_np") = "JJ"; # 05/04/07 AM.
}
else if (N("unknown",4)
|| X("cap")) # 06/21/06 AM.
{
group(4,4,"_noun");
xrename("_noun");
chpos(X(),"NP");
}
else if (N("adj",4) || L("inflected"))
{
group(4,4,"_adj");
xrename("_adj");
X("pos_np") = "JJ"; # 05/04/07 AM.
}
else if (N("noun",4))
{
# Default to adj for now.
L("tmp4") = N(4);
group(4,4,"_noun");
pncopyvars(L("tmp4"),N(4));
fixnoun(N(4));
L("pos") = N("mypos",4);
# Don't know why this one was done. #
# if (L("pos") == "NNS")
# L("pos") = "NN"; #
xrename("_adj");
if (pnvar(L("tmp4"),"sem") == "date")
chpos(X(),"JJ"); # eg., "five-year".
else
chpos(X(),L("pos")); # NN or NNS...
}
else if (N("pos num",4) == 1 && N("adv",4))
{
group(4,4,"_adv");
xrename("_adv");
}
else
{
# Default to adj for now.
group(4,4,"_adj");
xrename("_adj");
}
X("tok175 a-a") = 1;
@RULES
_xNIL <- # 7
_xSTART
_xALPHA # [s] buggy -- can't reduce nonlit to lit.
\-
_xALPHA # [s] buggy
_xEND
@@
# alpha - num
@CHECK
if (X("hyphenated"))
fail();
@POST
X("hyphenated") = 1;
xrename("_noun");
if (strisupper(N("$text",2)))
chpos(X(),"NP");
# Check plural etc.
pncopyvars(N(2),X());
@RULES
_xNIL <-
_xSTART
_xALPHA
\-
_xNUM
_xEND
@@
# inc.'s
@POST
X("dissolve") = 1; # Get rid of _tok node.
group(4,5,"_aposS");
group(2,3,"_noun");
@RULES
_xNIL <-
_xWILD [one match=(_xSTART _conj)]
_xALPHA [s]
\. [opt]
\'
s
_xEND
@@
@POST
X("dissolve") = 1; # Get rid of _tok node.
group(4,5,"_aposD");
group(2,3,"_noun");
@RULES
_xNIL <-
_xWILD [one match=(_xSTART _conj)]
_xALPHA [s]
\. [opt]
\'
d
_xEND
@@
#
@POST
group(2,5,"_nounCountry");
group(2,2,"_noun");
@RULES
_xNIL <-
_xSTART
U
\.
S
\.
_xWILD [one lookahead match=( \- )]
@@
@POST
group(2,5,"_nounCountry");
group(2,2,"_letlet");
chpos(X(),"NP");
X("cap") = 1;
xrename("_noun");
@RULES
_xNIL <-
_xSTART
U
\.
S
\.
_xEND
@@
@PRE
<2,2> length(1);
<4,4> length(1);
@POST
group(2,5,"_letlet");
chpos(X(),"NP");
xrename("_noun");
@RULES
_xNIL <-
_xSTART
_xCAP
\.
_xALPHA
\. [opt]
_xEND
@@
@POST
if (strislower(N("$text",4)) )
{
group(4,4,"_adj");
xrename("_adj");
}
else
{
group(4,4,"_noun");
group(2,4,"_caps");
xrename("_noun");
X("cap") = 1;
X("glom") = 1;
}
@RULES
_xNIL <-
_xSTART
_noun
\-
_xALPHA
_xEND
@@
@POST
group(1,3,"_name");
xrename("_noun");
X("cap") = 1; # Flag capitalized token.
@RULES
_xNIL <-
o
\'
_xALPHA
@@
# num - alpha
# num-alpha
@CHECK
if (!N("noun",4) && !N("adj",4))
fail();
@POST
L("tmp4") = N(4);
group(2,4,"_adj");
pncopyvars(L("tmp4"),N(2));
N("hyphenated",2) = 1;
@RULES
_xNIL <-
_xSTART
_num
\-
_xALPHA
_xEND
@@
# 's
# ' s
@CHECK
if (pnname(X()) == "_aposS")
fail(); # Guard against infinite loop here.
@POST
xrename("_aposS");
X("id") = "tok175 aposS";
X("nopos") = 0; # Valid possessive or verb pos for this.
@RULES
_xNIL <-
\'
s [s]
@@
# 'd
# ' d
@CHECK
if (pnname(X()) == "_aposD")
fail(); # Guard against infinite loop here.
@POST
xrename("_aposD");
X("id") = "tok175 aposD";
X("aposD") = 1;
X("nopos") = 0; # Valid possessive or verb pos for this.
@RULES
_xNIL <-
\'
d [s]
@@
# 'll
# ' ll
@CHECK
if (pnname(X()) == "_modal")
fail(); # Guard against infinite loop here.
@POST
xrename("_modal");
X("id") = "tok175 aposLL";
X("aposLL") = 1;
X("nopos") = 0; # Valid possessive or verb pos for this.
X("stem") = X("sem") = "will";
chpos(X(),"MD");
@RULES
_xNIL <-
\'
ll [s]
@@
# 've
# ' ve
@CHECK
if (pnname(X()) == "_verb")
fail(); # Guard against infinite loop here.
@POST
xrename("_verb");
X("id") = "tok175 aposVE";
X("aposVE") = 1;
X("nopos") = 0; # Valid possessive or verb pos for this.
X("stem") = X("sem") = "have";
chpos(X(),"VBP");
group(1,2,"_have");
@RULES
_xNIL <-
\'
ve [s]
@@
# 'm
# ' m
@CHECK
if (pnname(X()) == "_verb")
fail(); # Guard against infinite loop here.
@POST
xrename("_verb");
X("id") = "tok175 aposM";
X("aposM") = 1;
X("nopos") = 0; # Valid possessive or verb pos for this.
X("stem") = X("sem") = "be";
chpos(X(),"VBP");
group(1,2,"_be");
@RULES
_xNIL <-
\'
m [s]
@@
# num - alpha
# num-alpha
@POST
L("tmp4") = N(4);
# Reduce to prevent infinite loop in recursive pass.
if (N("noun",4))
group(4,4,"_noun");
else
group(4,4,"_misc");
pncopyvars(L("tmp4"),N(4));
xrename("_adj");
X("hyphenated") = 1;
X("pos_np") = "JJ"; # Default. # 06/07/06 AM.
@RULES
_xNIL <-
_xSTART
_xNUM
\-
_xALPHA
_xEND
@@
# year-to-year
# Idiom...
@CHECK
if (X("adj"))
fail(); # Loop guard.
@POST
xrename("_adj");
X("hyphenated") = 1;
X("pos_np") = "JJ"; # Default. # 06/07/06 AM.
X("adj") = 1;
@RULES
_xNIL <-
_xSTART
year
\-
to
\-
year
_xEND
@@
# adj - any
@CHECK
if (X("adj"))
fail(); # Loop guard.
@POST
xrename("_adj");
X("hyphenated") = 1;
X("pos_np") = "JJ"; # Default. # 06/07/06 AM.
X("adj") = 1;
clearpos(X(),1,0);
@RULES
_xNIL <-
_xSTART
_xWILD [one match=(_adj _num)]
\-
_xANY
_xEND
@@
# near - alpha
@CHECK
if (X("detok"))
fail();
@POST
X("detok") = 1;
X("hyphenated") = 1;
X("pos_np") = "JJ"; # Default. # 06/07/06 AM.
chpos(N(1),"JJ"); # Near is adj here.
L("tmp3") = N(3);
# Discard verb...
if (N("noun",3))
{
group(3,3,"_noun");
xrename("_noun");
pncopyvars(L("tmp3"),N(3));
}
else
{
group(3,3,"_adj");
xrename("_adj");
pncopyvars(L("tmp3"),N(3));
}
X("posarr len") = X("nopos") = 1;
@RULES
_xNIL <-
near [s]
\-
_xALPHA
@@
|
@NODES _ROOT
@POST
S("section_title") = N("$text", 1);
# excise(4,4);
excise(1,2);
single();
@RULES
_section <-
_xWILD [min=1 max=10 fails=(\: \n \r _break)] ### (1)
\: [trig] ### (2)
_xWILD [plus fails=(_break _xEND)] ### (3)
# _xWILD [one matches=(_break _xEND)] ### (4)
@@
# @POST
# excise(1,1);
# @RULES
# _xNIL <-
# _break
# @@
|
@NODES _LINE
@POST
group(4,4,"_description");
group(2,2,"_code");
@RULES
_xNIL <-
_indent ### (1)
_xWILD [fail=(_xWHITE)] ### (2)
_xWHITE ### (3)
_xWILD [fail=(_xEND)] ### (4)
_xEND ### (5)
@@
|
# Pre action that succeeds if leaf token has capitalized first letter
@PRE
<1,1>cap();
@RULES
_noun <- _xALPHA@@ |
@NODES _LINE
@RULES
_comma <-
\, ### (1)
@@
|
@PATH _ROOT _doctypedecl _EntityDecl
@POST
if (N("$text",4))
S("buffer1") = str(N("$text",4)) ;
if (N("$text",5))
S("buffer2") = str(N("$text",5)) ;
if (S("buffer1") && S("buffer2")) {
S("EntityName") = S("buffer1") + S("buffer2") ;
}
else if (S("buffer1"))
S("EntityName") = S("buffer1") ;
else if (S("buffer2"))
S("EntityName") = S("buffer2") ;
G("CurrentEntity") = findconcept(G("Entities"),S("EntityName")) ;
if (G("CurrentEntity") == 0 ) {
makeconcept(G("Entities"),S("EntityName")) ;
G("CurrentEntity") = findconcept(G("Entities"),S("EntityName")) ;
}
addattr(G("CurrentEntity"),"parameter") ;
addsval(G("CurrentEntity"),"parameter",1) ;
addattr(G("CurrentEntity"),"internal") ;
addsval(G("CurrentEntity"),"internal",0) ;
addattr(G("CurrentEntity"),"textValue") ;
addattr(G("CurrentEntity"),"URI") ;
addstrval(G("CurrentEntity"),"URI",str(N("URI",7))) ;
single() ;
@@POST
@RULES
_PEDecl <-
_whiteSpace [opt]
_xWILD [s trig min=1 max=1 matches=("\%")]
_whiteSpace
_xWILD [s min=1 max=1 matches=("_xALPHA" "_" ":")]
_xWILD [s min=0 max=0 matches=("_xALPHA" "_xNUM" "." "-" "_" ":")]
_whiteSpace
_ExternalID
@@
@@RULES
@POST
if (N("$text",4))
S("buffer1") = str(N("$text",4)) ;
if (N("$text",5))
S("buffer2") = str(N("$text",5)) ;
if (S("buffer1") && S("buffer2")) {
S("EntityName") = S("buffer1") + S("buffer2") ;
}
else if (S("buffer1"))
S("EntityName") = S("buffer1") ;
else if (S("buffer2"))
S("EntityName") = S("buffer2") ;
G("CurrentEntity") = findconcept(G("Entities"),S("EntityName")) ;
if (G("CurrentEntity") == 0 ) {
makeconcept(G("Entities"),S("EntityName")) ;
G("CurrentEntity") = findconcept(G("Entities"),S("EntityName")) ;
}
addattr(G("CurrentEntity"),"parameter") ;
addsval(G("CurrentEntity"),"parameter",1) ;
addattr(G("CurrentEntity"),"internal") ;
addsval(G("CurrentEntity"),"internal",1) ;
addattr(G("CurrentEntity"),"textValue") ;
addstrval(G("CurrentEntity"),"textValue",str(N("textValue",7))) ;
single() ;
@@POST
@RULES
_PEDecl <-
_whiteSpace [opt]
_xWILD [s trig min=1 max=1 matches=("\%")]
_whiteSpace
_xWILD [s min=1 max=1 matches=("_xALPHA" "_" ":")]
_xWILD [s min=0 max=0 matches=("_xALPHA" "_xNUM" "." "-" "_" ":")]
_whiteSpace
_EntityRef
@@
_PEDecl <-
_whiteSpace [opt]
_xWILD [s trig min=1 max=1 matches=("\%")]
_whiteSpace
_xWILD [s min=1 max=1 matches=("_xALPHA" "_" ":")]
_xWILD [s min=0 max=0 matches=("_xALPHA" "_xNUM" "." "-" "_" ":")]
_whiteSpace
_PEReference
@@
@@RULES
@POST
if (N("$text",4))
S("buffer1") = str(N("$text",4)) ;
if (N("$text",5))
S("buffer2") = str(N("$text",5)) ;
if (S("buffer1") && S("buffer2")) {
S("EntityName") = S("buffer1") + S("buffer2") ;
}
else if (S("buffer1"))
S("EntityName") = S("buffer1") ;
else if (S("buffer2"))
S("EntityName") = S("buffer2") ;
G("CurrentEntity") = findconcept(G("Entities"),S("EntityName")) ;
if (G("CurrentEntity") == 0 ) {
makeconcept(G("Entities"),S("EntityName")) ;
G("CurrentEntity") = findconcept(G("Entities"),S("EntityName")) ;
}
addattr(G("CurrentEntity"),"parameter") ;
addsval(G("CurrentEntity"),"parameter",1) ;
addattr(G("CurrentEntity"),"internal") ;
addsval(G("CurrentEntity"),"internal",1) ;
addattr(G("CurrentEntity"),"textValue") ;
addstrval(G("CurrentEntity"),"textValue",str(N("textValue",7))) ;
single() ;
@@POST
@RULES
_PEDecl <-
_whiteSpace [opt]
_xWILD [s trig min=1 max=1 matches=("\%")]
_whiteSpace
_xWILD [s min=1 max=1 matches=("_xALPHA" "_" ":")]
_xWILD [s min=0 max=0 matches=("_xALPHA" "_xNUM" "." "-" "_" ":")]
_whiteSpace
_PubidLiteral
@@
_PEDecl <-
_whiteSpace [opt]
_xWILD [s trig min=1 max=1 matches=("\%")]
_whiteSpace
_xWILD [s min=1 max=1 matches=("_xALPHA" "_" ":")]
_xWILD [s min=0 max=0 matches=("_xALPHA" "_xNUM" "." "-" "_" ":")]
_whiteSpace
_SystemLiteral
@@
@@RULES
@POST
if (N("$text",2))
S("buffer1") = str(N("$text",2)) ;
if (N("$text",3))
S("buffer2") = str(N("$text",3)) ;
if (N("$text",2) && N("$text",3)) {
S("EntityName") = S("buffer1") + S("buffer2") ;
}
else if (N("$text",2))
S("EntityName") = S("buffer1") ;
else if (N("$text",3))
S("EntityName") = S("buffer2") ;
G("CurrentEntity") = findconcept(G("Entities"),S("EntityName")) ;
if (G("CurrentEntity") == 0 ) {
makeconcept(G("Entities"),S("EntityName")) ;
G("CurrentEntity") = findconcept(G("Entities"),S("EntityName")) ;
}
addattr(G("CurrentEntity"),"parameter") ;
addsval(G("CurrentEntity"),"parameter",0) ;
addattr(G("CurrentEntity"),"internal") ;
addsval(G("CurrentEntity"),"internal",1) ;
addattr(G("CurrentEntity"),"textValue") ;
addstrval(G("CurrentEntity"),"textValue",str(N("textValue",5))) ;
single() ;
@@POST
@RULES
_GEDecl <-
_whiteSpace [opt]
_xWILD [s min=1 max=1 matches=("_xALPHA" "_" ":")]
_xWILD [s min=0 max=0 matches=("_xALPHA" "_xNUM" "." "-" "_" ":")]
_whiteSpace
_PubidLiteral
@@
_GEDecl <-
_whiteSpace [opt]
_xWILD [s min=1 max=1 matches=("_xALPHA" "_" ":")]
_xWILD [s min=0 max=0 matches=("_xALPHA" "_xNUM" "." "-" "_" ":")]
_whiteSpace
_SystemLiteral
@@
_GEDecl <-
_whiteSpace [opt]
_xWILD [s min=1 max=1 matches=("_xALPHA" "_" ":")]
_xWILD [s min=0 max=0 matches=("_xALPHA" "_xNUM" "." "-" "_" ":")]
_whiteSpace
_EntityRef
@@
_GEDecl <-
_whiteSpace [opt]
_xWILD [s min=1 max=1 matches=("_xALPHA" "_" ":")]
_xWILD [s min=0 max=0 matches=("_xALPHA" "_xNUM" "." "-" "_" ":")]
_whiteSpace
_PEReference
@@
_GEDecl <-
_whiteSpace [opt]
_xWILD [s min=1 max=1 matches=("_xALPHA" "_" ":")]
_xWILD [s min=0 max=0 matches=("_xALPHA" "_xNUM" "." "-" "_" ":")]
_whiteSpace
_PubidLiteral
@@
_GEDecl <-
_whiteSpace [opt]
_xWILD [s min=1 max=1 matches=("_xALPHA" "_" ":")]
_xWILD [s min=0 max=0 matches=("_xALPHA" "_xNUM" "." "-" "_" ":")]
_whiteSpace
_SystemLiteral
@@
@@RULES
|
@DECL
###############################################
# General functions
###############################################
AddUniqueCon(L("concept"),L("name")) {
L("con") = findconcept(L("concept"),L("name"));
if (!L("con")) L("con") = makeconcept(L("concept"),L("name"));
return L("con");
}
AddUniqueStr(L("concept"),L("attr"),L("value")) {
if (L("value") && strval(L("concept"),L("attr")) != L("value"))
addstrval(L("concept"),L("attr"),L("value"));
}
AddUniqueNum(L("concept"),L("attr"),L("value")) {
"unique.txt" << L("attr") << " " << str(L("value")) << " " << conceptpath(L("concept")) << "\n";
L("val") = AttrValues(L("concept"),L("attr"));
while (L("val")) {
L("num") = getnumval(L("val"));
"unique.txt" << " value: " << str(L("num")) << "\n";
if (L("num") == L("value"))
return 0;
L("val") = nextval(L("val"));
}
addnumval(L("concept"),L("attr"),L("value"));
return 1;
}
AddUniqueConVal(L("concept"),L("attr"),L("value")) {
"unique.txt" << L("attr") << " " << conceptpath(L("concept")) << " ==> " << L("attr") << " -- " << conceptpath(L("value")) << "\n";
L("val") = AttrValues(L("concept"),L("attr"));
while (L("val")) {
L("con") = getconval(L("val"));
"unique.txt" << conceptname(L("con")) << "\n";
if (conceptpath(L("con")) == conceptpath(L("value")))
return 0;
L("val") = nextval(L("val"));
}
addconval(L("concept"),L("attr"),L("value"));
return 1;
}
CopyAttr(L("from"),L("to"),L("attr")) {
L("from value") = strval(L("from"),L("attr"));
if (L("from value")) {
L("to value") = strval(L("to"),L("attr"));
if (L("from value") && !L("to value"))
addstrval(L("to"),L("attr"),L("from value"));
}
}
CopyAttrNew(L("from"),L("to"),L("attr from"),L("attr to")) {
L("from value") = strval(L("from"),L("attr from"));
if (L("from value")) {
L("to value") = strval(L("to"),L("attr to"));
if (L("from value") && !L("to value"))
addstrval(L("to"),L("attr to"),L("from value"));
}
}
CopyConAttr(L("from"),L("to"),L("attr")) {
L("from value") = conval(L("from"),L("attr"));
if (L("from value")) {
L("to value") = conval(L("to"),L("attr"));
if (L("from value") && !L("to value"))
addconval(L("to"),L("attr"),L("from value"));
}
}
AttrValues(L("con"),L("attr")) {
L("at") = findattr(L("con"),L("attr"));
if (L("at"))
return attrvals(L("at"));
return 0;
}
LastChild(L("parent")) {
L("child") = down(L("parent"));
while (L("child")) {
L("last") = L("child");
L("child") = next(L("child"));
}
return L("last");
}
MakeCountCon(L("con"),L("count name")) {
L("count name") = CountName(L("con"),L("count name"));
return makeconcept(L("con"),L("count name"));
}
IncrementCount(L("con"),L("countname")) {
L("count") = numval(L("con"),L("countname"));
if (L("count")) {
L("count") = L("count") + 1;
replaceval(L("con"),L("countname"),L("count"));
} else {
addnumval(L("con"),L("countname"),1);
L("count") = 1;
}
return L("count");
}
CountName(L("con"),L("root")) {
L("count") = IncrementCount(L("con"),L("root"));
return L("root") + str(L("count"));
}
StripEndDigits(L("name")) {
if (strisdigit(L("name"))) return 0;
L("len") = strlength(L("name")) - 1;
L("i") = L("len") - 1;
L("str") = strpiece(L("name"),L("i"),L("len"));
while (strisdigit(L("str")) && L("i")) {
L("i")--;
L("str") = strpiece(L("name"),L("i"),L("len"));
}
return strpiece(L("name"),0,L("i"));
}
###############################################
# KB Dump Functins
###############################################
DumpKB(L("con"),L("file")) {
L("dir") = G("$apppath") + "/kb/";
L("filename") = L("dir") + L("file") + ".kb";
if (!kbdumptree(L("con"),L("filename"))) {
"kb.txt" << "FAILED dump: " << L("filename") << "\n";
} else {
"kb.txt" << "DUMPED: " << L("filename") << "\n";
}
}
TakeKB(L("filename")) {
L("path") = G("$apppath") + "/kb/" + L("filename") + ".kb";
"kb.txt" << "Taking: " << L("path") << "\n";
if (take(L("path"))) {
"kb.txt" << " Taken successfully: " << L("path") << "\n";
} else {
"kb.txt" << " Taken FAILED: " << L("path") << "\n";
}
}
ChildCount(L("con")) {
L("count") = 0;
L("child") = down(L("con"));
while (L("child")) {
L("count")++;
L("child") = next(L("child"));
}
return L("count");
}
###############################################
# KBB DISPLAY FUNCTIONS
###############################################
DisplayKB(L("top con"),L("full")) {
L("file") = DisplayFileName();
DisplayKBRecurse(L("file"),L("top con"),0,L("full"));
L("file") << "\n";
return L("top con");
}
KBHeader(L("text")) {
L("file") = DisplayFileName();
L("file") << "#######################\n";
L("file") << "# " << L("text") << "\n";
L("file") << "#######################\n\n";
}
DisplayFileName() {
if (num(G("$passnum")) < 10) {
L("file") = "ana00" + str(G("$passnum"));
}else if (num(G("$passnum")) < 100) {
L("file") = "ana0" + str(G("$passnum"));
} else {
L("file") = "ana0" + str(G("$passnum"));
}
L("file") = L("file") + ".kbb";
return L("file");
}
DisplayKBRecurse(L("file"),L("top"),L("level"),L("full")) {
if (L("level") == 0) {
L("file") << conceptname(L("top")) << "\n";
}
L("con") = down(L("top"));
while (L("con")) {
L("file") << SpacesStr(L("level")+1) << conceptname(L("con"));
DisplayAttributes(L("file"),L("con"),L("full"),L("level"));
L("file") << "\n";
if (down(L("con"))) {
L("lev") = 1;
DisplayKBRecurse(L("file"),L("con"),L("level")+L("lev"),L("full"));
}
L("con") = next(L("con"));
}
}
DisplayAttributes(L("file"),L("con"),L("full"),L("level")) {
L("attrs") = findattrs(L("con"));
if (L("attrs")) L("file") << ": ";
if (L("full") && L("attrs")) L("file") << "\n";
L("first attr") = 1;
while (L("attrs")) {
L("vals") = attrvals(L("attrs"));
if (!L("full") && !L("first attr")) {
L("file") << ", ";
}
if (L("full")) {
if (!L("first attr")) L("file") << "\n";
L("file") << SpacesStr(L("level")+2);
}
L("file") << attrname(L("attrs")) << "=[";
L("first") = 1;
while (L("vals")) {
if (!L("first"))
L("file") << ",";
L("val") = getstrval(L("vals"));
L("num") = getnumval(L("vals"));
L("con") = getconval(L("vals"));
if (L("con")) {
L("file") << conceptpath(L("con"));
} else if (!L("full") && strlength(L("val")) > 20) {
L("shorty") = strpiece(L("val"),0,20);
L("file") << L("shorty");
L("file") << "...";
if (strendswith(L("val"),"\""))
L("file") << "\"";
} else if (L("num") > -1) {
L("file") << str(L("num"));
} else {
L("file") << L("val");
}
L("first") = 0;
L("vals") = nextval(L("vals"));
}
L("file") << "]";
L("first attr") = 0;
L("attrs") = nextattr(L("attrs"));
}
}
# Because NLP++ doesn't allow for empty strings,
# this function can only be called with "num" >= 1
SpacesStr(L("num")) {
L("n") = 1;
L("spaces") = " ";
while (L("n") < L("num")) {
L("spaces") = L("spaces") + " ";
L("n")++;
}
return L("spaces");
}
###############################################
# DICTIONARY FUNCTIONS
###############################################
DictionaryClear() {
G("dictionary path") = G("$apppath") + "\\kb\\user\\dictionary.kb";
G("dictionary") = openfile(G("dictionary path"));
}
DictionaryWord(L("word"),L("attrName"),L("value"),L("attrType")) {
L("file") = G("dictionary");
if (!dictfindword(L("word")))
L("file") << "add word \"" + L("word") + "\"\n";
L("file") << "ind attr\n" << findwordpath(L("word")) << "\n0\n";
L("file") << findwordpath(L("attrName")) << "\n";
if (L("attrType") == "str")
L("file") << "pst\n" << L("value");
else if (L("attrType") == "num")
L("file") << "pnum\n" << str(L("value"));
else if (L("attrType") == "con")
L("file") << "pcon\n" << conceptpath(L("value"));
L("file") << "\nend ind\n\n";
}
DictionaryEnd() {
G("dictionary") << "\nquit\n\n";
closefile(G("dictionary"));
}
@@DECL
|
Subsets and Splits