forked from eniagreen/botml
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexpressions.bot
32 lines (22 loc) · 862 Bytes
/
expressions.bot
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
! BOTML 1
# A bot with natural language processing integration from CoreNLP.
#
# Example:
# > I like to move it or > I really need this
# < Do you really like it? > So you need this, huh?
# Using a basic expression
# This conversation doesn't always catch the Verb position correctly.
> I * (it|this)
< Do you really $?
< So you $, huh?
# Using a regular expression
# This conversation doesn't always catch the Verb position correctly either.
> /^I (?:.+\s)?(\w+) (?:.+\s)?(it|this)/
< Do you really $1 $2?
< So you $1 $2, huh?
# Using the Stanford TokensRegex syntax
# This one relies on natural language processing capabilities to query the right
# words and will catch the Verb correctly all the time.
> I [ !{ tag:/VB.*/ } ]* (?$verb [{ tag: /VB.*/ }]) []* (?$what /it|this/)
< Do you really $1 $2?
< So you $1 $2, huh?