text
stringlengths
22
301k
@NODES _ROOT @POST excise(1,6); noop(); @RULES _xNIL <- http ### (1) _xWILD [plus fails=(\t)] ### (2) \t ### (3) RID ### (4) _xNUM ### (5) \n [opt] ### (6) @@
# Add an empty attribute named "an attribute" to the concept named "a concept" @CODE G("myConcept") = makeconcept(findroot(),"a concept"); G("myAttr") = addattr(G("myConcept"),"an attribute"); "output.txt" << attrname(G("myAttr")) << "\n";
@NODES _LINE @RULES _ordinal <- _xNUM [s] _xWILD [s one t match=(st nd rd th)] @@
@CODE # Uncomment when analyzer is complete # DisplayKB(G("pred_codes"),1); DisplayKB(G("note_words"),1); DisplayKB(G("pred_codes"),1); #Save preds to csv L("name") = "_preds"; L("filepath") = G("$inputhead") + L("name") + ".csv"; L("header") = "code, max, sum, mean\n" L("filepath") << L("header"); L("iter") = dow...
# Given an array (multi-valued variable) of KB concepts, sort the concepts by the given attribute. numeric_b = 1 if num, 0 if string type attribute. descending_b = 1 if descending order, 0 if ascending. E.g., G("sorted") = sortconsbyattr(G("cons"),"count",1,0); will sort an array of KB concepts by their "count" attri...
# Match a minimum of 1 up to any number of nodes. Matches indefinitely repeating element @RULES _nouns <- _noun [plus] @@
@DECL ############## ## FN: XMLHEADER ## SUBJ: Print header tags for XML file. ## RET: None. ############## xmlheader( L("out") # Output stream. ) { L("out") << "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>" << "\n"; } ############## ## FN: XMLSTART ## SUBJ: Print a start XML tag. ## RET: None. ##############...
@CODE DictionaryEnd(); # DisplayKB(findroot(),0); @@CODE
@NODES _LINE @RULES # Ex: contracted _verb <- contracted [s] @@ # Ex: contract _verb <- contract [s] @@ # Ex: wrote _verb <- wrote [s] @@ # Ex: write _verb <- write [s] @@ # Ex: designed _verb <- designed [s] @@ # Ex: design _verb <- design [s] @@ # Ex: implemented _verb <- implemented [s] @@ # Ex: implement _...
# hello tokenize nil # Gen: Convert input to token list. nlp kb # comment nlp tags # comment nlp items # comment nlp count # comment nlp names # comment nlp output # comment
# Exit from the current pass file immediately, without performing rule matching (if any) @CODE exitpass(); # Exit the current pass file immediately. @@CODE
@NODES _LINE @PRE <1,1> length(3); <5,5> length(3); @RULES # Ex: www.absoluterealtime.com _url <- www [s layer=("_machineName")] \. [s] _xALPHA [s layer=("_companyName")] \. [s] _xWILD [min=1 max=1 s layer=("_domainName") match=("com")] @@
@NODES _ROOT @POST "zap.txt" << N("$text") << "\n"; excise(1,1); @RULES _xNIL <- _xWILD [one match=(_beginEnum _endEnum _itemMarker _COMMENT _spacing)] ### (1) @@
@NODES _ROOT @RULES _header <- _xWILD [one matches=(\[)] ### (1) _xWILD _xWILD [one matches=(DATE)] \: _xWILD _xWILD [one matches=(\n \r)] ### (6) @@
@PATH _ROOT _posZone _defZone _definition _headerZone _LINE @POST X("con",6) = MakeCountCon(X("con",3),"explanation"); @RULES _xNIL <- _item ### (1) @@
@PATH _ROOT _LINE _language @POST addstrval(X("con",2),"language",N("$text",1)); single(); @RULES _lang <- _xWILD [plus fail=(\, _xEND)] @@
@PATH _ROOT _AttlistDecl @POST S("buffer1") = str(N("$text",2)) ; S("buffer2") = str(N("$text",3)) ; if (N("$text",2) && N("$text",3)) { S("AttributeName") = S("buffer1") + S("buffer2") ; } else if (N("$text",2)) S("AttributeName") = S("buffer1") ; else if (N("$text",3)) S("AttributeName") = S("buffer2") ...
@NODES _timeZone @POST L("timezone") = getconcept(G("state"),"timezone"); makeconcept(L("timezone"),N("$text")); @RULES _xNIL <- _xWILD [plus fail=(\,)] ### (1) @@
@NODES _termEntry @POST X("entry") = N("$text", 4); @RULES _xNIL <- entry ### (1) \= ### (2) E ### (3) _xNUM ### (4) _xWILD [one matches=(\n \r)] ### (5) @@
@PATH _ROOT _contactZone # @INI # Restart count in each zone here. # X("nlines") = 0; # @@INI @POST N("lineno",1) = ++X("nlines"); N("format below",1) = "true"; @RULES _xNIL <- _LINE _xWILD [s one lookahead match=(_BLANKLINE _horizRule)] @@ @POST N("format above",2) = "true"; @RULES _xNIL <- _xWILD [s one ...
@PATH _ROOT _group _subgroup _LINE @POST if (X("con",4)) addstrval(X("con",4),"hex",N("$text",1)); @RULES _xNIL <-_hex @@ @POST if (X("con",4)) addstrval(X("con",4),"type",N("type",1)); @RULES _xNIL <-_qualified @@
@CODE L("hello") = 0; if (!G("semantic processing")) exitpass(); @@CODE #@PATH _ROOT _TEXTZONE _sent _clause @NODES _clause #@CHECK # if (!N("ne") && !N("ne arr")) # fail(); @POST if (N("sem texts")) X("sem texts") = N("sem texts"); if (N("ne") || N("ne arr")) L("obj") = domobjectregister(N(1),X());...
@CODE L("hello") = 0; @@CODE
@NODES _ROOT @RULES _xNIL <- _xWILD ### (1 @@
@CODE if (G("$islastfile") || !G("$isdirrun")) { # Loop through states KB and make states dict file L("state") = down(G("states")); while (L("state")) { G("dict") << conceptname(L("state")) << " s=state"; L("attr") = down(L("state")); while (L("attr")) { L("name") = co...
@PATH _ROOT _experienceZone _experienceInstance _LINE _Caps @POST X("job title",3) = N("$text",1); X("company name",3) = N("$text",5); single(); @RULES _xNIL <- _jobTitle [s] _xWHITE [s] at [s] _xWHITE [s] _Caps [s] @@
# Match if the element is in a match list. Matches is a restricted wildcard and succeeds only if one of the list names matches a node @RULES _james <- _xWILD [matches=(jim jimmy james) singlet min=1 max=1] @@
@CODE L("hello") = 0; @@CODE @NODES _sent @CHECK if (!N("verb",2)) fail(); @POST L("tmp2") = N(2); group(2,2,"_verb"); L("v") = N(2); pncopyvars(L("tmp2"),N(2)); group(2,2,"_vg"); mhbv(N(2),L("neg"),0,0,0,0,L("v")); pncopyvars(L("tmp2"),N(2)); N("voice",2) = "active"; clearpos(N(2),1,0); # Ze...
@POST rfarulesfile(1, 2, 3, 4, 5) single() @RULES # ALLOWING EMPTY RULE REGION IF THERE IS CODE or DECL. _RULESFILE [base] <- _DECL _CODE [opt] _SELECT [opt] _RECURSES [opt] _REGIONS [opt] @@ _RULESFILE [base] <- _DECL [opt] _CODE _SELECT [opt] _RECURSES [opt] _REGIONS [opt] @@ # Could remove _CODE from here, but ...
@CODE G("root") = findconcept(findroot(),"specialist_lexicon"); if (!G("root")) G("root") = makeconcept(findroot(),"specialist_lexicon"); rmchildren(G("specialist_lexicon")); @@CODE
@CODE G("some global variable") = 1; SomeFunction("moose","running"); "code.txt" << "Hello from the code region!"; @@CODE
@PATH _ROOT _labels _labelEntry @CODE G("currAttr") = 0; @@CODE @POST if (!G("currAttr")) { G("currAttr") = findattrs(X("RID", 3)); } if ( !N("$text", 1) ) { S("empty") = 1; #New L("tempAttr") = G("currAttr"); G("currAttr") = nextattr(G("currAttr")); rmattr(X("RID", 3), attrname(L("tempAttr"))); } else { S("...
# Set the BASE attribute of the first node to "true" or "false" @POST setbase(1,"true"); single();  # Need to put the default reduce in manually, since POST is not empty. @RULES _np <- _noun @@
@CODE #DisplayKB(G("words"), 1); DisplayKB(G("adjMatrixData"), 1); @@CODE
@PATH _ROOT _contactZone _LINE # If name hasn't been selected from _humanName nodes. @CHECK if ( !X("name found",2) && (N("ctcname conf") >= 60) && (N("name found") || N("ctcname conf") == X("hi ctcname conf",2)) ) succeed(); fail(); @POST # Need a way to get all the pieces of a name. # Probably sho...
@NODES _LINE @POST excise(1,1); noop(); @RULES _xNIL <- _xWHITE [s] ### (1) @@
@NODES _LINE @RULES _SchoolRoot [] <- _xWILD [s one matches=( Conservatory Academy Universidad University College Colleges School Institute Seminary Tech Univ Poly Polytechnic )] @@ # these are in the sample hierarchy, like MIT, UCSB... _SchoolName [] <- _schoolPhrase [s]@@
@NODES _LINE @RULES _SchoolNamePhrase [] <- _xWILD [one s match=(_SchoolNamePhrase _SchoolRoot) ] _xWHITE [s] _xWILD [one s match=(for of) ] _xWHITE [s] _xWILD [one s match=(_CityName _state) layer=(_SchoolLocation)] @@ # Ex: "University of XXX (XXX), -> _SchoolNamePhrase" _SchoolNamePhrase [] <- _xWILD ...
# Doing this rigamarole in case region is empty. @NODES _CODE _CHECKS _PRES _POSTS _NODES _PATH _MULTI _RULES _DECL @POST excise(1,1) @RULES _xNIL <- _xWILD [one match=(_startMark _endMark)] @@
@DECL figureImageFilename(L("filename")) { L("filename") = strsubst(L("filename"),"/","-"); L("tit") = strsubst(G("title")," ","-"); L("tit") = strsubst(L("tit"),"'","-"); L("auths") = strsubst(G("authors")," ","-"); L("newfile") = L("auths") + "-" + L("tit") + "-" + L("filename"); if (!strcontainsnocase(".png"...
@PATH _ROOT _textZone _LINE @POST X("list") = 1; "list.txt" << N("$text",3) << "\n"; @RULES _xNIL <- _xSTART ### (1) \: [opt] ### (2) \# ### (3) @@
@NODES _ROOT @POST "kb.txt" << conceptpath(G("part")) << "\n"; "kb.txt" << G("last indent") << " " << N("indent") << " " << N("title") << "\n"; while (G("last indent") && G("last indent") >= N("indent")) { "kb.txt" << " " << G("last indent") << " " << N("indent") << " <=======\n"; G("part") = up(G("part")); G("la...
@NODES _ROOT @RULES _Comment <- _CommentStart [one] ### (1) _xWILD [star fail=("_CommentEnd" "_CommentEnd" "_DoubleHyphen")] ### (2) _CommentEnd [one] ### (3) @@ _ExternalID <- _xWILD [one matches=("PUBLIC")] ### (1) _whiteSpace [opt] ### (2) _PubidLiteral [one] ### (3) _whiteSpace [o...
@PATH _ROOT _experienceZone _experienceInstance @POST # Before zapping anchor, copy its line number to instance. X("anchor lineno") = N("lineno",1); splice(1,1); # Zap the _expStart node @RULES _xNIL <- _ANCHOR @@
@NODES _td @POST excise(1,1); noop(); @RULES _xNIL <- _xWHITE [s] ### (1) @@
# Fetch value as a string from a numeric or string-valued KB value object. L("return_str") = getsval(L("val"));
@CODE DisplayKB(G("P_eui"), 1); SaveKB("P_eui.kbb",G("P_eui"),1); @@CODE
@PATH _ROOT _bibItem @POST addBib(X("ref",0)," - "); @RULES _xNIL <- _dash [s] ### (1) @@ @POST addBib(X("ref",0)," ''"); @RULES _xNIL <- _bold ### (1) @@ @POST addBib(X("ref",0)," '''"); @RULES _xNIL <- _emph ### (1) @@ @POST addBib(X("ref",0)," '''"); @RULES _xNIL <- _italics ###...
@NODES _ROOT @POST S("rowspan") = N("rowspan",1); single(); @RULES _td <- _tdOpen ### (1) _xWILD [fail=(_tdClose)] ### (2) _tdClose ### (3) @@
@NODES _ROOT @RULES _td <- _tdOpen ### (1) _xWILD [fail=(_tdClose _tdOpen)] _tdClose @@
@CODE G("terms") = findconcept(findroot(),"terms"); if (!G("terms")) G("terms") = makeconcept(findroot(),"terms"); rmchildren(G("terms")); @@CODE
@PATH _ROOT _DECL _NLPPP #@POST # movesem(1) # single() #@RULES #_ACTION [base] <- # _STMTS [s] # @@ #@POST # setbase(1,"true") # Not sure if this is needed for anything. #@RULES #_xNIL <- _STMTS [s] @@ # @POST rfbdecl(1,2) single() @RULES _FUNCDEF <- _FNCALL _STMTS # This needs to be a BLOCK. @@
@NODES _ROOT @RULES _itemOpen <- \< ### (1) item ### (2) \> ### (3) @@ _itemClose <- \< ### (1) \/ ### (2) item ### (3) \> ### (4) @@ _categoryidOpen <- \< ### (1) categoryid ### (2) \> ### (3) @@ _categoryidClose <- \< ### (1) \/ ### (2) ...
@CODE if (G("$isdirrun")) { L("write") = "app"; } else { L("write") = "w"; } L("debugpath") = G("$kbpath") + "debug.txt"; G("debug") = openfile(L("debugpath"),L("write")); L("vocab") = G("$kbpath") + "vocab.dictt"; # L("vocab") = "vocab.dict"; G("vocab") = openfile(L("vocab"),"app"); @@CODE
@NODES _LINE @RULES _CompleteSchoolName <- _CompleteSchoolName [s] _xWHITE [s] _xWILD [s one matches = ( and And \& )] _xWHITE [s] _xWILD [s one matches = ( _CompleteSchoolName _SchoolRoot _SchoolNamePhrase)] @@ _CompleteSchoolName <- _CompleteSchoolName [s] _xWHITE [s] _xWILD [s one matches = ( _CompleteS...
@NODES _td @POST excise(1,1); @RULES _xNIL <- _xWILD [one match=(_tag _tdOpen _tdClose)] ### (1) @@
@NODES _ROOT @CHECK if ( N("Numeral Value",1) <1000000) fail(); if ( N("Numeral Value",3) > 999999 ) fail(); if ( N("Numeral Value",5) > 999 ) fail(); if ( N("Numeral Value",9) > 99 ) fail(); @@CHECK @POST G("num1") = N("Numeral Value",1) ; G("num2") = N("Numeral Value",3) ; G...
@CODE L("hello") = 0; @@CODE @NODES _sent # Count clauses in a sentence. @POST N("clause num") = ++X("clauses"); @RULES _xNIL <- _clause @@ # ^ if @POST X("conditional") = 1; # 05/08/07 AM. @RULES _xNIL <- _xSTART if [s] @@
@NODES _ROOT @POST S("level") = N("$text",4); "headers.txt" << N("$text",4) << " close\n"; single(); @RULES _headerClose <- \< ### (1) \/ h ### (2) _xNUM ### (3) \> ### (4) @@ @POST S("level") = N("$text",3); "headers.txt" << N("$text",3) << " open\n"; single(); @RULES _header <- \< ### (1) h ### (2...
@CODE prlit("zdump.txt", "\nCap Phrases (BEFORE CONJUNCTION MERGE)\n"); prlit("zdump.txt", "----------------------------------------\n"); @@CODE @PATH _ROOT _LINE @POST ndump("zdump.txt",1); prlit("zdump.txt", "-------\n"); @RULES _xNIL <- _Caps @@
@CODE G("hello") = 0; @@CODE #@PATH _ROOT _TEXTZONE _sent _clause @NODES _clause # vg to vg @POST L("tmp1") = N(1); L("tmp5") = N(5); group(1,5,"_vg"); X("voice") = N("voice",1) = "active"; # Syntax from 1st. N("verb node",1) = pnvar(L("tmp1"),"verb node"); N("first verb",1) = pnvar(L("tmp1"),"first ve...
@NODES _LINE @POST singler(2,2); @RULES _code <- _xSTART ### (1) _word @@
@CODE L("hello") = 0; @@CODE
@CODE G("pos") = findconcept(findroot(),"pos"); if (!G("pos")) G("pos") = makeconcept(findroot(),"pos"); rmchildren(G("pos")); @@CODE
@NODES _ROOT @RULES _np <- _xWILD [s plus match=(_det _adj)] ### (1) _xWILD [s plus match=(_noun)] ### (2) @@
@NODES _ROOT @PRE <1,1> var("header"); @POST splice(1,1); @RULES _xNIL <- _LINE ### (1) @@
@PATH _ROOT _addendum @POST excise(1,1); noop(); @RULES _xNIL <- _xWHITE [s] ### (1) @@
@PATH _ROOT _paragraph _sentence @POST pncopyvars(); single(); @RULES _company <- _det [s] ### (1) _company [s] ### (2) @@
# Close the output file stream @CODE G("file") = openfile("c:\\tmp.txt"); closefile(G("file")); @@CODE
@CODE if (!G("find html")) exitpass(); # If no title found, flag it. if (!G("title")) { if (G("error")) { L("fname") = G("$apppath") + "\\data\\errhtml.txt"; L("errhtml") = openfile(L("fname"),"app"); L("errhtml") << G("$inputhead") << ": No title found." << "\n"; closefile(L("errhtml")); ...
@NODES _ROOT @POST G("dict") << N("word") << " " << N("attr") << "=" << N("value") << "\n"; @RULES _xNIL <- _attrBlock ### (1) @@
@CODE fileout("ctc.txt"); @@CODE # For otherZone at the beginning of a resume, if it has # noteworthy addressParts, rename it to contactZone. # NOTE: A temporary heuristic. If experience zone is next, it may # well have cityState constructs. Need to decide what the next zone # really is, once we start dealing with ...
@NODES _LINE @RULES # Ex: employment\_history _ExperienceHeaderPhrase [layer=(_header )] <- employment [s] _xWHITE [star s] history [s] @@ # Ex: employment\_experience _ExperienceHeaderPhrase [layer=(_header )] <- employment [s] _xWHITE [star s] experience [s] @@ # Ex: work\_experience _ExperienceHeaderPhrase [laye...
@NODES _RECORD #===================== First Record Item ====================== @POST X("field con") = down(G("fields con")); if (!N("value")) N("value") = " "; addstrval(X("record con"),conceptname(X("field con")),N("value")); @RULES _xNIL <- _xSTART [s] ### (1) _item ### (2) @@ #==================...
@NODES _LINE @PRE <1,1> cap(); <3,3> cap(); @RULES # Ex: Back\_To _WebLinks <- Back [s] _xWHITE [star s] To [s] @@ # Ex: My\_Page _WebLinks <- My [s] _xWHITE [star s] Page [s] @@ # Ex: Cool\_Links _WebLinks <- Cool [s] _xWHITE [star s] Links [s] @@ @PRE <2,2> cap(); @RULES # Ex: [Image] _WebLinks <- \[ [s] Image ...
@NODES _LINE @RULES # Ex: la _PostalRoad <- _xWILD [min=1 max=1 s match=("la" "alley" "ally" "aly" "anex" "annex" "annx" "anx" "arc" "arcade" "av" "ave" "aven" "avenu" "avenue" "avn" "avnue" "bayoo" "bayou" "bch" "beach" "bend" "bg" "bgs" "blf" "blfs" "bluf" "bluff" "bluffs" "blvd" "bnd" "bot" "bottm" "bottom" "bo...
# Create the concept apple, then create two attributes of apple, then delete both of them. Finally, add both of the attributes back and then delete only one if(findconcept(findroot(), "apples")) rmconcept(findconcept(findroot(), "apples")); G("apples") = makeconcept(findroot(), "apples"); addstrval(G("apples"), "colo...
@PATH _ROOT _paragraph _sentence @POST excise(1,1); @RULES _xNIL <- _xWHITE [s] ### 1 @@
@PATH _ROOT _LINE _item @POST if (X("num",2)) { group(2,2,"_title"); } @RULES _xNIL <- _indent ### (1) _xWILD [fail=(_xEND)] ### (2) _xEND ### (3) @@
@MULTI _ROOT @POST singler(2,2); @RULES _properNoun <- _xWILD [one fails=(_xSTART \")] _xCAP [plus] ### (1) _xWILD [opt matches=(and & of \-)] _xWILD [] @@
@NODES _LINE @POST singler(1,1); @RULES _phrase <- _xWILD [fail=(_code)] ### (1) _code ### (2) @@
@NODES _paragraph @POST excise(1,1); noop(); @RULES _xNIL <- _xWILD [match=(_xWHITE _xCTRL)] ### (1) @@
# This will match words such as JUNK, junks, junky, JunkYard @PRE <1,1> regexpi("junk*"); @POST group(1,1,"_junkword"); @RULES _xNIL <- _xALPHA @@
@PATH _ROOT _header _identifier @POST excise(1,1); noop(); @RULES _xNIL <- _xWHITE [s] ### (1) @@
@PATH _ROOT _addendum @POST L("radLexTerms") = GetRadLexTerms(N(3)); "log.txt" << "\n++++++++++++ printing " << arraylength(L("radLexTerms")) << " items in addendum +++++++++++++++++\n"; "radLexTerms.txt" << N("$text", 1) << "\n"; if(L("radLexTerms")) { L("count") = 0; while (L("count") < arraylength(L("radLexTerm...
@PATH _ROOT _doctypedecl @RULES _choiceElement [unsealed] <- _whiteSpace [opt] ### (1) \| [one] ### (2) _whiteSpace [opt] ### (3) _cp [one] ### (4) _xWILD [opt matches=("*" "+" "?")] ### (5) @@ _seqElement [unsealed] <- _whiteSpace [opt] ### (1) \, [one] ### (2) _whiteSpace [opt] ...
@NODES _LINE @POST L("file") = "icd.kbb"; L("hier") = "icdhier.kbb"; if (X("num")) { if (X("num") == 1 && N("num") == 0) { L("file") << "ICD11"; L("hier") << "ICD11"; } if (N("num") == 0 && N("value")) { X("code") = N("value"); } else if (N("num") == 1 && N("value")) { X("code") = N("value"); } else...
@NODES _LINE @PRE <1,1> cap(); @RULES # Ex: SE _Direction <- _xWILD [min=1 max=1 s match=("SE" "South" "East" "West" "NE" "NW" "North" "SW" "N" "S" "E" "W")] @@
@PATH _ROOT _doctypedecl _AttlistDecl @RULES _AttType [unsealed] <- _xWILD [s one matches=("NOTATION")] ### (1) _whiteSpace [opt] ### (2) \( [one] ### (3) _whiteSpace [opt] ### (4) _xWILD [s min=1 max=1 matches=("_xALPHA" "_" ":")] ### (5) _xWILD [s min=0 max=0 matches=("_xALPHA" "_xNUM" "."...
@NODES _LINE @PRE <1,1> cap() <3,3> cap() @RULES # Ex: MS\_Access _MSSoftware <- MS [s] _xWHITE [star s] Access [s] @@ # Ex: MS\_BackOffice _MSSoftware <- MS [s] _xWHITE [star s] BackOffice [s] @@ # Ex: MS\_Excel _MSSoftware <- MS [s] _xWHITE [star s] Excel [s] @@ # Ex: MS\_FrontPage _MSSoftware <- MS [s] _xWHITE ...
# Fetch the numeric-value of a kb attribute attrName belonging to concept concept @CODE # create a range G("range") = makeconcept(findroot(), "range"); addnumval(G("range"),"min",33); addnumval(G("range"),"min",34); addnumval(G("range"),"max",118); # access data "output.txt" << "range = " << getnumval(findvals(G(...
@NODES _ROOT @CHECK if (N("count",1) == G("max header")) succeed(); fail(); @POST "debug.txt" << "header: " << N("count",1) << " " << N("header",1) << "\n"; S("count") = N("count",1); S("header") = N("header",1); single(); @RULES _headerZone <- _header ### (1) _xWILD [fail=(_header _xEND)] ### (2) @@ @PO...
# Yucky way to get the semantics. Want to match the _humanName # once and get its piecy parts then. @PATH _ROOT _contactZone _LINE _humanName @CHECK if (!X("name found")) fail(); @POST X("prefixName",2) = N("$text"); @RULES _xNIL <- _prefixName @@ @CHECK if (!X("name found")) fail(); @POST X("firstName",2)...
# Count nouns with variable "number" with value "plural" @PRE <1,1> vareq("number","plural"); @POST ++G("count plural nouns"); @RULES _xNIL <- _noun @@
@PATH _ROOT _attrBlock _attr @POST X("attr",2) = N("$text",1); @RULES _xNIL <- _xALPHA \" _xEND @@
@NODES _ROOT @POST "output.txt" << "\n\n"; @RULES _xNIL <- _BLANKLINE ### (1) @@ @POST "output.txt" << "\n"; @RULES _xNIL <- _NEWLINE ### (1) @@ @POST "output.txt" << " ''"; @RULES _xNIL <- _italics ### (1) @@ @POST "output.txt" << " '''"; @RULES _xNIL <- _bold ### (1) @@ @POST...
@CODE sortchilds(G("caps")); DisplayKB(G("caps"),2); sortchilds(G("names")); DisplayKB(G("names"),2); DisplayKB(G("parse"),2); DisplayKB(G("verbs"),2); @@CODE
@NODES _LINE @PRE <1,1> cap(); <3,3> cap(); @RULES # Ex: Academic\_Publications _PublicationsHeaderPhrase [layer=(_header )] <- Academic [s] _xWHITE [star s] Publications [s] @@
# Add named node at end of con's phrase. L("return_con") = addcnode(L("con"), L("name"));
@NODES _LINE @POST S("text") = N("$text",3); single(); @RULES _link <- \[ ### (1) \[ ### (2) _xWILD [plus fail=(\])] ### (3) \] ### (4) \] ### (5) @@