Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
CreatureChat
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Jobs
Commits
Open sidebar
Public
CreatureChat
Commits
7c08e1fb
Commit
7c08e1fb
authored
Jun 13, 2024
by
Jonathan Thomas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixing regex to only match our specified behaviors, and ignore others.
parent
69fff9b7
Pipeline
#12453
passed with stages
in 6 minutes 33 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
CHANGELOG.md
CHANGELOG.md
+1
-1
MessageParser.java
src/main/java/com/owlmaddie/message/MessageParser.java
+1
-1
No files found.
CHANGELOG.md
View file @
7c08e1fb
...
@@ -12,7 +12,7 @@ All notable changes to **CreatureChat** are documented in this file. The format
...
@@ -12,7 +12,7 @@ All notable changes to **CreatureChat** are documented in this file. The format
### Changed
### Changed
-
**Huge improvements**
to
**chat prompt**
for more
*balanced*
dialog and
*predictable*
behaviors
-
**Huge improvements**
to
**chat prompt**
for more
*balanced*
dialog and
*predictable*
behaviors
-
Improved
**Behavior regex**
to include both
`<BEHAVIOR arg>`
and
`*BEHAVIOR arg*`
syntax
-
Improved
**Behavior regex**
to include both
`<BEHAVIOR arg>`
and
`*BEHAVIOR arg*`
syntax
, and ignore unknown behaviors.
-
Improved
**message cleaning**
to remove any remaining
`**`
and
`<>`
after parsing behaviors
-
Improved
**message cleaning**
to remove any remaining
`**`
and
`<>`
after parsing behaviors
-
Privacy Policy updated
-
Privacy Policy updated
...
...
src/main/java/com/owlmaddie/message/MessageParser.java
View file @
7c08e1fb
...
@@ -19,7 +19,7 @@ public class MessageParser {
...
@@ -19,7 +19,7 @@ public class MessageParser {
LOGGER
.
info
(
"Parsing message: {}"
,
input
);
LOGGER
.
info
(
"Parsing message: {}"
,
input
);
StringBuilder
cleanedMessage
=
new
StringBuilder
();
StringBuilder
cleanedMessage
=
new
StringBuilder
();
List
<
Behavior
>
behaviors
=
new
ArrayList
<>();
List
<
Behavior
>
behaviors
=
new
ArrayList
<>();
Pattern
pattern
=
Pattern
.
compile
(
"[<*](
\\w+
)(?:\\s+(-?\\d+))?[>*]"
);
Pattern
pattern
=
Pattern
.
compile
(
"[<*](
FOLLOW|FLEE|ATTACK|FRIENDSHIP|UNFOLLOW
)(?:\\s+(-?\\d+))?[>*]"
);
Matcher
matcher
=
pattern
.
matcher
(
input
);
Matcher
matcher
=
pattern
.
matcher
(
input
);
while
(
matcher
.
find
())
{
while
(
matcher
.
find
())
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment