text stringlengths 22 301k |
|---|
@PATH _ROOT _LINE
# flag that.
@CHECK
if (
(X("AfterResumeByItselfLine") || X("resumeOf"))
&& !X("Found cap already")
)
succeed();
fail();
@POST
N("name found") = 1;
++X("Found cap already");
# noop()
@RULES
_xNIL <- _humanName [s] @@
# Take the first cap phrase on the line following "Resume of... |
@CODE
if (G("$islastfile")) {
SaveKB("mykb.kbb",G("kb"),2);
}
@@CODE |
@PATH _ROOT _labelEntry
@POST
if ( N("$text", 2) ) {
L("con") = findconcept(G("adjMatrixData"), strtolower(N("$text", 2)));
if ( X("words", 2) ) {
X("words", 2)[arraylength(X("words", 2))] = numval(L("con"), "index");
}
else {
X("words", 2) = numval(L("con"), "index");
}
}
excise(1,1);
noop();
@RULES
_xNIL... |
@DECL
GetWordCodeMappings(L("pn_node")) {
L("this_node") = L("pn_node");
L("code") = pnvar(L("pn_node"), "code");
"test.txt" << L("code") << "\n";
L("child_node") = pndown(L("this_node"));
while (L("child_node")) {
if (strisalpha(pnvar(L("child_node"), "$text"))) {
L(... |
@CODE
G("kb") = getconcept(findroot(),"kb");
@@CODE |
@NODES _LINE
@PRE
<2,2> length(1);
@POST
L("text") = N("$text",2);
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=(_xCTR... |
# Execute commands in a knowledge base command file (.KB file)
take(L("file_str")); |
@NODES _header
@PRE
<1,1> uppercase();
@POST
S("key") = N("$text", 1);
S("value") = N("$text", 5);
single();
@RULES
_identifier <-
_xALPHA ### (1)
_xBLANK [opt] ### (2)
_xPUNCT [min=1 max=2] ### (3)
_xBLANK ### (4)
_xWILD ### (5)
_xWILD [one matches=(\n \r)] ### (6)
@@
|
# Fetch a row from the current database result
@CODE
dbopen("test","root","mypassword");
dballocstmt();
dbexecstmt("SELECT * FROM employee;");
dbbindcol(1,"varchar",50,&G("employee name"),&G("result1"));
while (dbfetch())
{
"output.txt" << "employee name: ";
if (G("result1"))
"output.txt" << G("employee na... |
@PATH _ROOT _textZone _headerZone _LINE
@POST X("pessoa",3) = N("pessoa");
@RULES _xNIL <- _pessoa @@
@POST X("numero",3) = N("numero");
@RULES _xNIL <- _numero @@
@POST X("tempo",3) = N("tempo");
@RULES _xNIL <- _tempo @@
@POST X("root",3) = N("root");
@RULES _xNIL <- _root @@ |
@DECL
########
# FUNC: CLEARPOS
# SUBJ: Mark as not receiving a part of speech.
# NOTE: Find parts-of-speech below this node, if any.
########
clearpos(
L("n"), # Node to clear.
L("ignorepos"), # If putting the ignore feature on.
L("bracket") # If putting noun phrase bracket on.
)
{
if (!L("n"))
return;
if (L("... |
@CODE
"test.txt" << "\nlength: " << arraylength(G("nodesToTraverse")) << "\n";
L("i") = 0;
"test.txt" << "\n";
while (L("i") < arraylength(G("nodesToTraverse"))) {
"test.txt" << conceptname(G("nodesToTraverse")[L("i")]) << "\n";
L("i") = L("i") + 1;
}
@@CODE
|
# Fetch entire path of given concept as a string
G("childConcept") = makeconcept(makeconcept(findroot(), "parent"), "child");
"output.txt" << conceptpath(G("childConcept")); |
@NODES _LINE
@POST
S("gender") = "male";
S("con") = AddPerson(X("con"),"Fred","male","noun");
single();
@RULES
_name <- Fred @@
@POST
S("gender") = "female";
S("con") = AddPerson(X("con"),"Sally","female","noun");
single();
@RULES
_name <- Sally @@
@POST
S("gender") = "male";
S("con") = AddPerson(X("con"),"he","mal... |
@NODES _ROOT
@RULES
_icdRoot <-
_xWILD [one matches=(\@)]
_xWILD [fails=(\n \r)]
_xWILD [one matches=(\n \r)]
@@
|
@MULTI _section _sentence _subsection
@POST
L("pn_iter") = N(1);
L("wrote") = 0;
while (L("pn_iter")) {
if (pnvar(L("pn_iter"), "keyword") == 1) {
AddUniqueCon(G("note_words"), pnname(L("pn_iter")));
"words.txt" << "\t" << pnname(L("pn_iter")) << "\n";
L("wrote") = 1;
}
L("pn_iter") = pnnext(L("pn_iter")... |
@DECL
PartOfSpeech(L("pos")) {
if (L("pos") == "noun") {
L("pos") = "n";
} else if (L("pos") == "verb") {
L("pos") = "v";
} else if (L("pos") == "adjective") {
L("pos") = "adj";
} else if (L("pos") == "adverb") {
L("pos") = "adv";
} else if (L("pos") == "pronoun") {
L("pos") = "pro";
} else if (L("pos... |
@NODES _LINE
@RULES
# Ex: ofc
_PostalUnit <- _xWILD [min=1 max=1 s match=("ofc" "apt" "basement" "bldg" "bsmt" "building" "department" "dept" "fl"
"floor" "frnt" "front" "hangar" "hngr" "lbby" "lobby" "lot" "lower" "lowr"
"apartment" "office" "penthouse" "ph" "pier" "rear" "rm" "room" "side" "slip"
"space" "spcsto... |
@PATH _ROOT _RULES
@RECURSE rulelt
@POST
rfanonlitelt(1)
single()
@RULES
_ELEMENT [base] <- _NONLIT @@
@POST
rfalitelt(1)
single()
@RULES
_ELEMENT [base] <- _LIT @@
_ELEMENT [base] <- _NUM @@
@@RECURSE rulelt
@RECURSE sugg
@POST
rfasugg(1)
single()
@RULES
_SUGG <- _ELEMENT @@
@@RECURSE sugg
@RECURSE elt
... |
@PATH _ROOT _LINE _Caps
@POST
++X("schoolroots");
if (N("$end"))
++X("end schoolroot");
@RULES
_xNIL <- _SchoolRoot [s] @@
_xNIL <- _SchoolType [s] @@ # 12/15/99 AM.
@POST
++X("schoolnames");
if (N("$end"))
++X("end schoolname");
@RULES
_xNIL <- _SchoolName [s] @@
_xNIL <- _CompleteSchoolName [s] @@
... |
@NODES _LINE
@RULES
# Ex: joe
_maleName [layer=(_humanNamepart )] <- _xWILD [min=1 max=1 s match=("joe" "john" "robert" "michael" "william" "david" "richard" "charles" "joseph"
"thomas" "christopher" "daniel" "paul" "mark" "donald" "george" "kenneth" "steven" "edward"
"brian" "ronald" "anthony" "kevin" "jason" "mat... |
@NODES _ROOT
@POST
S("header") = N("header",1);
S("count") = 2;
single();
@RULES
_headerZone <-
_headerTwo ### (1)
_xWILD [plus fails=(_headerTwo _xEND)] ### (2)
@@
|
@CODE
G("i") = 1;
G("reset") = 0;
@@CODE
@MULTI _ROOT
@CHECK
if (num(N("$text", 5)) == (G("i"))) {
G("reset") = 1;
succeed();
}
@POST
S("num") = num(N("$text", 5));
singler(4,7);
@RULES
_listItem <-
_xWILD [opt matches=(_xSTART _listItem)] ### (1)
_xWILD [min=0 fails=(\n \r _listItem _xEND)] ### (2)
_xWILD... |
@PATH _ROOT _experienceZone _experienceInstance _LINE
# skip single-char alphabetics, as they can be bullets!
@PRE
<1,1> length(1)
@RULES
_xNIL <- _xALPHA [s] @@
# Want all kinds of English stuff here.
# Make caps in English prose invisible.
# More generally, should characterize texty lines with lots of
# lowercase ... |
@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("concep... |
@CODE
# Open an output file for writing trend info.
G("trend file") = ofile("trend.txt");
# Get the root concept of the dictionary.
G("sys") = getconcept(G("root"), "sys" );
G("dict") = getconcept(G("sys" ), "dict");
G("dict alpha") = getconcept(G("dict"), "a" ); # Alphabetic dictionary hierarchy.
@@CODE
|
@PATH _ROOT _LINE _header
@POST
if (N("$end"))
++X("end experience hdr");
++X("experience hdrs");
@RULES
_xNIL <- _ExperienceHeaderWord [s] @@
_xNIL <- _ExperienceHeaderPhrase [s] @@
@POST
if (N("$end"))
++X("end education hdr");
++X("education hdrs");
@RULES
_xNIL <- _EducationHeaderWord [s] @@
_xNIL <- _... |
@NODES _term
@POST
AddPhrase(N(2));
"debug.txt" << N("$text", 2) << "\n";
@RULES
_xNIL <-
_xSTART ### (1)
_xWILD [one match=(_xALPHA _xNUM)] ### (2)
@@
|
@CODE
L("hello") = 0;
@@CODE
@NODES _sent
@CHECK
if (!N("noun",3) && !N("adj",3))
fail();
if (!N("noun",2) && !N("adj",2))
fail();
if (N(4))
{
if (!N("noun",4) && !N("adj",4))
fail();
}
@POST
L("tmp3") = N(3);
L("tmp2") = N(2);
if (N("noun",3))
{
group(3,3,"_noun");
pncopyvars(L... |
@CODE
# # G("eui_to_codes_root") = getconcept(findroot(), "eui_to_codes");
# # G("eui_to_codes") = getconcept(G("eui_to_codes_root"), "top");
# # G("parse") = getconcept(findroot(),"topconcept");
# # G("code_to_eui") = makeconcept(findroot(), "code_to_eui");
# # G("top") = makeconcept(G("code_to_eui"), "top");
# # G... |
# Fetch the next value in a list of values.
L("return_val") = nextval(L("val")); |
# Add the string valueString as a string value to the concept concept's attribute that has name nameString
G("Malibu") = makeconcept(findroot(), "Malibu");
addstrval(G("Malibu"),"Latitude Direction","North");
addstrval(G("Malibu"),"Longitude Direction","West");
addnumval(G("Malibu"),"Latitude value",33);
addnumval(G... |
@CODE
prlit("output.xml","<History>\n");
@@CODE
@RULES
_xNIL <- _xNIL @@ |
# Create a knowledge base with concept apple, adding attributes have=color, color=red, color=green, yellow, and weight=3
if (findconcept(findroot(),"apple"))
# kill them (to start fresh)
rmconcept(findconcept(findroot(),"apple"));
# Create the apple concept
G("apple") = makeconcept(findroot(),"apple");
# Apples have... |
@PATH _ROOT _paragraph _sentence
@POST
L("text") = phrasetext();
if (strendswith(L("text"),"s")) {
S("plural") = 1;
}
single();
@RULES
_title <- _xWILD [min=2 match=(
acting
administration
affairs
air
allen
analyst
army
asset
assets
assistance
assistant
associate
attaché
attorney
bis
border
busin... |
@CODE
G("format") = getconcept(findroot(),"format");
@@CODE |
@NODES _ROOT
@POST
"zone.txt" << N("$text",2) << "\n";
single();
@RULES
_bodyZone <-
_tbody ### (1)
_xWILD [fail=(_tbodyClose)] ### (2)
_tbodyClose ### (3)
@@
|
####################
####################
## NODE VARIABLES
####################
####################
# stem = The stemmed text, eg, of head of a phrase.
# sem = A semantic category.
# Not just some default stem of a word.
# ne text = Text for a named entity.
# ne = Flag that node is a named entity.
# name = Fla... |
@NODES _ROOT
@POST
if (N("pos num") > 1) {
pncopyvars(N(1));
single();
} else if (N("noun")) {
group(1,1,"_noun");
} else if (N("verb")) {
group(1,1,"_verb");
} else if (N("det")) {
group(1,1,"_det");
} else if (N("adj")) {
group(1,1,"_adj");
} else if (N("prep")) {
group(1,1,"_prep");
} else if ... |
@NODES _LINE
@POST
"complete_mimic_icd_terms.txt" << N("$text", 4) << "\n";
noop();
@RULES
_xNIL <-
_xNUM ### (1)
\, ### (2)
_xWILD [opt matches=(\")] ### (3)
_xWILD [fail=(\n \")] ### (4)
_xWILD [one matches=(\n)] ### (5)
@@
|
@NODES _td
@POST
excise(1,1);
noop();
@RULES
_xNIL <-
_xWHITE [s] ### (1)
@@
|
@NODES _LINE
@POST
excise(1,1);
noop();
@RULES
_xNIL <-
_xWHITE [s] ### (1)
@@
@POST
X("up",3) = 1;
"found.txt" << "this\n";
@RULES
_xNIL <-
_language [s] ### (1)
@@
|
@NODES _ROOT
@POST
NumberType(N(1),num(N("$text")));
@RULES
_xNIL <-
_xNUM ### (1)
@@
|
@NODES _LINE
@POST
"country.dict" << strtolower(N("$text",4)) << " country=1\n";
@RULES
_xNIL <-
_xSTART ### (1)
_xNUM ### (2)
\t ### (3)
_xWILD [fail=(\t)] ### (4)
@@
|
@DECL
DictionaryFilename(L("word"),L("ext")) {
L("path") = G("$apppath");
L("path") = strpiece(L("path"),0,strlength(L("path"))-2);
L("last") = strrchr(L("path"),"\\");
L("parent") = strpiece(L("path"),0,strlength(L("last"))) + "dict\\";
L("filename") = L("parent") + strpiece(L("word"),0,0) + "." + L("ext");
"p... |
# Get the entire path of dictionary concept wordString
@CODE
"output.txt" << "1 " << conceptname(addword("hello")) << "\n";
"output.txt" << "2 " << conceptname(wordindex("hello")) << "\n";
"output.txt" << "3 " << findwordpath("hello") << "\n";
"output.txt" << "4 " << findwordpath("olleh") << "\n";
"output.txt" << "5 ... |
@NODES _LINE
@RULES
_CompleteSchoolName [] <-
The
_xWHITE [star s]
_SchoolNamePhrase
@@
|
@PATH _ROOT _LINE
# Moving company pattern here. #
# If cap phrase is well formed, could suggest _company here.
# (May still need to extend, eg, "Ford Motor Co. of America").
@POST
N("glommed companyroot",1) = "true";
N("company conf",1) = N("company conf",1) %% 95;
++N("companyroots",1);
++N("end companyroot",1... |
@NODES _bodyZone
@POST
L("name") = "_" + N("$text",3) + "Close";
group(1,4,L("name"));
@RULES
_xNIL <-
\< ### (1)
\/ ### (2)
_xWILD [match=(tr td)] ### (3)
\> ### (4)
@@
@POST
L("name") = "_" + N("$text",2);
group(1,4,L("name"));
@RULES
_xNIL <-
\< ### (1)
_xWILD [one match=(tr td)] #... |
# Fetch the word after the given word in the KB dictionary hierarchy
@CODE
L("con") = dictfirst();
while (L("con"))
{
"output.txt" << conceptname(L("con") << "\n";
L("con") = dictnext(L("con"));
}
Prints a list of the dictionary entries, one per line. |
@CODE
L("hello") = 0;
@@CODE
#@PATH _ROOT _TEXTZONE _sent _clause
@NODES _clause
# Validate well-formed clause.
@POST
L("x3") = pnparent(X()); # 07/13/12 AM.
if (!N(3))
X("no subj") = 1;
X("vg node") = N(5);
L("nm") = pnname(N(7));
if (L("nm") == "_adjc")
{
if (N(3))
X("pattern") = "nvj";... |
@PATH _ROOT _derivedTerms _headerZone _LINE
@POST
S("con") = MakeCountCon(X("derivedTerms",2),"derived");
single();
@RULES
_derivedTerm <-
_xWILD [plus match=(_xALPHA)] ### (1)
@@
|
@PATH _ROOT _LINE _language
@POST
N("spoken",1) = 1;
@RULES
_xNIL <-
_lang
spoken
@@ |
@NODES _ROOT
@RULES
_noun <-
_xNUM ### (1)
\. ### (2)
_xNUM ### (3)
_xWHITE ### (4)
_xWILD [one match=(cm mm)] ### (5)
@@
|
# Replace named attribute's value(s) with concept con_val
replaceval(L("con"), L("name"), L("con_val")); |
@CODE
SaveKB("emojis.kbb",G("emojis"),2);
L("dict") = "emojis.dict";
L("group") = down(G("emojis"));
while (L("group")) {
L("dict") << "# GROUP: " << strval(L("group"),"description") << "\n";
L("subgroup") = down(L("group"));
while (L("subgroup")) {
L("dict") << "# SUBGROUP: " << strval(L("subgroup"),"descrip... |
@NODES _ROOT
@POST
if (N("con", 1)) {
L("text") = conceptname(N("con",1));
if (strcontains(",", L("text"))) {
# Split on comma, last split after comma should be specifier
# unless it starts with conjunction
L("specifier") = split(L("text"), ",");
L("specifier") = strclean(L("specifier")[arraylength(L("spec... |
# Check if first char of string1 is lowercase
@CHECK
if (strislower(N("$text",1)))
fail();
@RULES
_name <- will @@ |
@NODES _LINE
@RULES
_parens <-
\( ### (1)
_xWILD [fail=(\))] ### (2)
\) ### (3)
@@
|
@PATH _ROOT _posZone _defZone _example _headerZone _LINE
@POST
L("con") = MakeCountCon(X("con",3),"example");
addstrval(L("con"),"text",N("text",1));
@RULES
_xNIL <-
_item ### (1)
@@
|
@NODES _ROOT _addendum
@RULES
_identifier <-
_xWILD [min=3 max=3 matches=(\_)] ### (1)
@@
|
@CODE
G("words") = findconcept(findroot(),"words");
if (!G("words")) G("words") = makeconcept(findroot(),"words");
#rmchildren(G("words"));
@@CODE
|
@CODE
G("hello") = 0;
@@CODE
#@PATH _ROOT _TEXTZONE _sent _clause _seg
@NODES _seg
# dqan
@CHECK
L("x4") = pnparent(X()); # _clause # 07/10/12 AM.
# If verbs in clause, want a better look at parallel
# construction patterns , etc.
if (pnvar(L("x4"),"vg count")) # 07/10/12 AM.
fail();
if (X("seg type")... |
# Enable C++ source code debugging for VisualText developers
@POST
debug();
@RULES
_xNIL <- _xNIL @@ |
@PATH _ROOT _paragraph _sentence
@POST
S("region") = N("$text",2);
if (N("city",3)) S("city") = N("city",3);
if (N("state",3)) S("state") = N("state",3);
single();
@RULES
_ofRegion <-
_xWILD [match=(of for the)] ### (1)
_region ### (2)
_residentOf ### (3)
@@
|
@NODES _LINE
@RULES
# Ex: {
_openPunct <- _xWILD [min=1 max=1 s match=("\{" "\[" "\<" "\(")] @@
|
# Find the root concept of the knowledge base (named concept).
L("return_con") = findroot(L("")); |
@NODES _section
@POST
excise(1,1);
@RULES
_xNIL <-
_xWHITE ### (1)
@@
|
@CODE
if (!G("find html"))
exitpass();
@@CODE
@NODES _ROOT
@RULES
_commentTag <-
\<
\!
\-
\-
@@
_EcommentTag <-
\-
\-
\>
@@
|
@PATH _ROOT _paragraph _sentence
@RULES
_for <-
for ### (1)
_operator [opt] ### (2)
_money ### (3)
@@
|
@NODES _ROOT
@RULES
_rest <-
_xWILD [plus fail=(_headerZone)] ### (1)
@@
|
@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") <<... |
@CODE
L("hello") = 0;
@@CODE
@NODES _sent
# particle adj noun alpha
@CHECK
if (!N("noun",6))
fail();
if (N("verb",6))
fail();
dqaninfo(2,3,4,5);
@POST
L("tmp6") = N(6);
group(6,6,"_noun");
pncopyvars(L("tmp6"),N(6));
S("olast") = 6;
S("last") = S("lastn") = S("lastan") = N(6);
groupnp();
@... |
@NODES _posZone
@POST
N("con",1) = MakeCountCon(X("con"),"definition");
@RULES
_xNIL <-
_defZone ### (1)
@@
|
@PATH _ROOT _experienceZone
@RULES
_experienceInstance <-
_xWILD [s one match=( _xSTART _experienceBoundary )]
_xWILD [s star match=(_LINE _BLANKLINE) except=(_expStart)]
@@
_experienceInstance <-
_expStart [s]
_xWILD [s star match=(_LINE _BLANKLINE) except=(_expStart)]
@@
|
@NODES _NLPPP
# @RECURSE listarg
# @POST
# rfbarg(1) # Note this difference.
# single()
# @RULES
# _ARG [base] <- _NONLIT @@
# _ARG [base] <- _LIT @@
# _ARG [base] <- _STR @@
# _ARG [base] <- _NUM @@
# @@RECURSE listarg
# @POST
# rfalist(2)
# single()
# @RULES
# _LIST [base] <- \( _xWILD [match=(_LIT _NONLIT _S... |
@DECL
eclXMLTree(
L("out"),
L("n"),
L("parent id")
)
{
L("childs") = pndown(L("n"));
L("leaf") = 0;
while (L("childs")) {
L("name") = pnname(L("childs"));
if (strlength(L("name")) > 1) {
L("id") = G("id")++;
L("tag") = strtrim(strpiece(L("name"),0,strlength(L("name"))-1));
L("out") << "<vertice";
getA... |
@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)
@@
|
# Add numeric value num as a string to concept con's attribute called name.
addsval(L("con"), L("name"), L("num")); |
@PATH _ROOT _bodyZone
@POST
AddWord(N("value1"),N("value2"));
@RULES
_xNIL <-
_trZone
@@
|
@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)
@@
|
@NODES _LINE
@POST
X("header",2) = N("$text",3);
X("number",2) = NepaliNum(N("$text",4));
single();
@RULES
_header <-
_xSTART ### (1)
_xWILD [plus match=(\=)] ### (2)
अर्थ ### (3)
_xNUM ### (4)
_xWILD [plus match=(\=)] ### (5)
_xEND ### (6)
@@
|
@CODE
G("hello") = 0;
@@CODE
@NODES _sent
# Moved here from sent
@POST
splice(1,1);
@RULES
_xNIL <-
_clausesep
@@
# Merging clauses with split construct:
# vg to vg
@CHECK
if (!N("start to-vg",2))
fail();
if (N("last chunk",1) != "v")
fail();
if (N("voice",1))
fail();
@POST
if (X("vg count... |
@PATH _ROOT _paragraph _sentence
# @RULES
# _this <- _xSTART _person @@
###############################################
# Isaiah Worlow, Steven Fluharty, and Tiffany Kerekes are charged
###############################################
@POST
AddPeople(N(1),"event",N("$text",3));
single();
@RULES
_event <-
_xWILD [... |
@NODES _LINE
@POST
singler(3,3)
@RULES
_CompleteSchoolName [sealed] <-
_xWILD [s one match=( _xSTART The _xPUNCT)]
_xWHITE [star s]
_SchoolNamePhrase [s t]
@@
@RULES
# Adding this to finish the job.
_CompleteSchoolName [sealed] <- _SchoolNamePhrase [s] @@
|
@PATH _ROOT _translations _headerZone _LINE
@POST
X("language",3) = makeconcept(X("translation",2),N("$text",2));
single();
@RULES
_language <-
_xSTART ### (1)
_xWILD [plus match=(_xALPHA)] ### (2)
\: [trig] ### (3)
@@
|
@NODES _ROOT
@POST
singler(1,2);
@RULES
_emptyItem [base] <-
_enclosedBy ### (1)
_enclosedBy ### (2)
_xWILD [match=(_separator _lineTerminator _xEND)] ### (3)
@@
|
@CODE
# Sort
L("con") = down(G("funcs"));
while (L("con")) {
sortchilds(L("con"));
L("con") = next(L("con"));
}
L("con") = down(G("funcs"));
while (L("con")) {
L("pos") = conceptname(L("con"));
L("comments") = AttrValues(L("con"),"comment");
if (L("pos") != G("pos")) {
L("title") = Split... |
# Create "words", "noun", and "noun_book" concepts under kb root
G("words") = makeconcept(findroot(), "words");
G("noun") = makeconcept(findroot(),"noun");
G("noun_book") = makeconcept(G("words"),"book"); |
#@NODES _ROOT
@PATH _ROOT
#@POST
#singlex(2,2)
# NOTE: DON'T SEAL THESE, BECAUSE WE WANT TO SEARCH FOR
# PATTERNS IN THEM.
@RULES
_contactZone [unsealed] <- _contactBoundary [s] _REZZONE @@
_objectiveZone [unsealed] <- _objectiveBoundary [s] _REZZONE @@
_educationZone [unsealed] <- _educationBound... |
@CODE
L("lang") = G("lang");
L("iso") = findconcept(G("langs"),L("lang") );
if(L("iso")) {
L("lang") = strval(L("iso"),"language");
}
G("dictname") << "# " << L("lang") << " function words\n";
@@CODE
|
@NODES _contactZone _objectiveZone _educationZone _experienceZone _skillsZone _presentationsZone _publicationsZone _referencesZone _otherZone
@POST
splice(1,1); # Zap the REZZONE node!
@RULES
_xNIL <- _REZZONE [s] @@
|
# Sort concept's immediate children alphabetically.
sortchilds(L("con")); |
@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("concep... |
@NODES _split
@POST
L("code") = N("code", 1);
L("term") = N("term", 1);
if (strcontains(".", L("code"))) {
L("codes") = split(L("code"), ".");
L("code_2") = L("codes")[1];
if (strlength(L("code_2")) == 1) {
addEntryToHier(X("con"), L("code"), L("term"));
}
}
noop();
@RULES
_xNIL <-
_entry ### (1)
@@
|
@DECL
WordPOS(L("word")) {
L("word") = strtolower(L("word"));
if (
strendswith(L("word"),"genic") ||
strendswith(L("word"),"itic") ||
strendswith(L("word"),"nal")
) {
SavePOS(L("word"),"adj");
}
else if (
strendswith(L("word"),"itis") ||
strendsw... |
@POST
excise(1, 1)
@RULES
_xNIL <- \ @@
_xNIL <- \n @@
_xNIL <- \t @@
|
@NODES _LINE
@PRE
<1,1> cap()
@RULES
# Ex: Jul
_Month [] <-
_xWILD [min=1 max=1 s match=(Jul Jan February Feb March Mar April Apr May June Jun July January August Aug September Sept Sep October Oct November Nov December Dec)]
@@
@RULES
# Ex: 02
_Month [] <-
_xWILD [min=1 max=1 s match=(02 2 3 4 5 6 7 8 9 01 1 ... |
@NODES _LINE
@RULES
_date <-
_xNUM ### (1)
\/ ### (2)
_xNUM ### (3)
@@
|
@CODE
fileout("zexp.txt");
prlit("zexp.txt", "\nCharacterizing General Cap Phrases\n");
prlit("zexp.txt", "----------------------------------\n");
@@CODE
@PATH _ROOT _experienceZone _experienceInstance _LINE
@POST
ndump("zexp.txt",1);
prlit("zexp.txt", "-------\n");
@RULES
_xNIL <- _Caps @@
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.