Skip to content

Commit

Permalink
[feat] expand knowledge bases
Browse files Browse the repository at this point in the history
  • Loading branch information
pingpingy1 committed Dec 14, 2023
1 parent 0d659bc commit ba1d5b1
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 7 deletions.
5 changes: 3 additions & 2 deletions hopre/context_kb/similar.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@
{"jump": "frog"},
{"jump": "car"},
{"windows": "computer"},
{"windows open": "cold"},
{"windows": "cold"},
{"virus": "computer"},
{"virus": "doctor"},
{"peeling": "banana"},
{"not feeling well": "doctor"},
{"hole": "two pairs"},
{"hole in one": "two pairs"},
{"hole-in-one": "golfer"},
{"byte": "computer"},
{"bite": "doctor"}
Expand Down
5 changes: 5 additions & 0 deletions hopre/englishAnalysis/englishGrammar.pl
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@
s([coord:no,sem:S]),
{combine(t:T,[s:S])}.

t([sem:T])-->
[in,case],
s([coord:no,sem:S]),
{combine(t:T,[s:S])}.


/*========================================================================
Sentences
Expand Down
55 changes: 55 additions & 0 deletions hopre/englishAnalysis/englishLexicon.pl
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,15 @@
lexEntry(noun,[symbol:doctor,syntax:[doctor]]).
lexEntry(noun,[symbol:bite,syntax:[bite]]).
lexEntry(noun,[symbol:byte,syntax:[byte]]).
lexEntry(noun,[symbol:frog,syntax:[frog]]).
lexEntry(noun,[symbol:insurancecompany,syntax:[insurance,company]]).
lexEntry(noun,[symbol:jump,syntax:[jump]]).
lexEntry(noun,[symbol:car,syntax:[car]]).
lexEntry(noun,[symbol:virus,syntax:[virus]]).
lexEntry(noun,[symbol:golfer,syntax:[golfer]]).
lexEntry(noun,[symbol:hole,syntax:[hole]]).
lexEntry(noun,[symbol:book,syntax:[book]]).
lexEntry(noun,[symbol:windows,syntax:[windows]]).


/*========================================================================
Expand All @@ -105,6 +114,10 @@
lexEntry(pn,[symbol:vincent,syntax:[vincent,vega]]).
lexEntry(pn,[symbol:yolanda,syntax:[yolanda]]).

lexEntry(pn,[symbol:twopairsofpants,syntax:[two,pairs,of,pants]]).
lexEntry(pn,[symbol:one,syntax:[one]]).
lexEntry(pn,[symbol:toomanyprobs,syntax:[too,many,problems]]).


/*========================================================================
Quantified Noun Phrases
Expand Down Expand Up @@ -251,6 +264,46 @@
lexEntry(tv,[symbol:goto,syntax:[went,to],inf:fin,num:pl]).


lexEntry(tv,[symbol:call,syntax:[call],inf:inf,num:sg]).
lexEntry(tv,[symbol:call,syntax:[call],inf:fin,num:sg]).
lexEntry(tv,[symbol:call,syntax:[calls],inf:fin,num:sg]).
lexEntry(tv,[symbol:call,syntax:[calls],inf:fin,num:pl]).
lexEntry(tv,[symbol:call,syntax:[called],inf:inf,num:sg]).
lexEntry(tv,[symbol:call,syntax:[called],inf:inf,num:pl]).
lexEntry(tv,[symbol:call,syntax:[called],inf:fin,num:sg]).
lexEntry(tv,[symbol:call,syntax:[called],inf:fin,num:pl]).


lexEntry(tv,[symbol:bring,syntax:[bring],inf:inf,num:sg]).
lexEntry(tv,[symbol:bring,syntax:[bring],inf:fin,num:sg]).
lexEntry(tv,[symbol:bring,syntax:[brings],inf:fin,num:sg]).
lexEntry(tv,[symbol:bring,syntax:[brings],inf:fin,num:pl]).
lexEntry(tv,[symbol:bring,syntax:[brought],inf:inf,num:sg]).
lexEntry(tv,[symbol:bring,syntax:[brought],inf:inf,num:pl]).
lexEntry(tv,[symbol:bring,syntax:[brought],inf:fin,num:sg]).
lexEntry(tv,[symbol:bring,syntax:[brought],inf:fin,num:pl]).


lexEntry(tv,[symbol:get,syntax:[get],inf:inf,num:sg]).
lexEntry(tv,[symbol:get,syntax:[get],inf:fin,num:sg]).
lexEntry(tv,[symbol:get,syntax:[gets],inf:fin,num:sg]).
lexEntry(tv,[symbol:get,syntax:[gets],inf:fin,num:pl]).
lexEntry(tv,[symbol:get,syntax:[got],inf:inf,num:sg]).
lexEntry(tv,[symbol:get,syntax:[got],inf:inf,num:pl]).
lexEntry(tv,[symbol:get,syntax:[got],inf:fin,num:sg]).
lexEntry(tv,[symbol:get,syntax:[got],inf:fin,num:pl]).


lexEntry(tv,[symbol:open,syntax:[open],inf:inf,num:sg]).
lexEntry(tv,[symbol:open,syntax:[open],inf:fin,num:sg]).
lexEntry(tv,[symbol:open,syntax:[opens],inf:fin,num:sg]).
lexEntry(tv,[symbol:open,syntax:[opens],inf:fin,num:pl]).
lexEntry(tv,[symbol:open,syntax:[opened],inf:inf,num:sg]).
lexEntry(tv,[symbol:open,syntax:[opened],inf:inf,num:pl]).
lexEntry(tv,[symbol:open,syntax:[opened],inf:fin,num:sg]).
lexEntry(tv,[symbol:open,syntax:[opened],inf:fin,num:pl]).


/*========================================================================
Copula
========================================================================*/
Expand Down Expand Up @@ -288,6 +341,8 @@
lexEntry(adj,[symbol:tall,syntax:[tall]]).

lexEntry(adj,[symbol:dressing,syntax:[dressing]]).
lexEntry(adj,[symbol:cold,syntax:[cold]]).
lexEntry(adj,[symbol:math,syntax:[math]]).


/*========================================================================
Expand Down
14 changes: 9 additions & 5 deletions hopre/punTestSuite.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
{
"input": [
"Why was the math book sad?",
"Because it had too many problems."
"Because the book had too many problems."
],
"joke": true
},
Expand All @@ -23,7 +23,7 @@
{
"input": [
"Why was the computer cold?",
"Because the computer left the Windows open."
"Because the computer opened the Windows."
],
"joke": true
},
Expand All @@ -34,6 +34,13 @@
],
"joke": true
},
{
"input": [
"Why did the banana go to the doctor?",
"Because the banana was not feeling well."
],
"joke": true
},
{
"input": [
"Why did the golfer bring two pairs of pants?",
Expand All @@ -48,9 +55,6 @@
],
"joke": true
},



{
"input": [
"A man walks."
Expand Down

0 comments on commit ba1d5b1

Please sign in to comment.