This repository was archived by the owner on Feb 8, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +24
-21
lines changed Expand file tree Collapse file tree 2 files changed +24
-21
lines changed Original file line number Diff line number Diff line change @@ -230,25 +230,6 @@ class IntentMatcher {
230
230
throw new Error ( "No matching intent class found." ) ;
231
231
}
232
232
}
233
- }
233
+ } ;
234
234
235
- // Example usage:
236
- const intentsFilePath = "./intents.json" ;
237
- const matcher = new IntentMatcher ( intentsFilePath ) ;
238
-
239
- const rl = readline . createInterface ( {
240
- input : process . stdin ,
241
- output : process . stdout ,
242
- } ) ;
243
-
244
- rl . question ( "You: " , ( input ) => {
245
- // Use the input here
246
- console . log ( "User input:" , input ) ;
247
-
248
- // Close the readline interface
249
- rl . close ( ) ;
250
-
251
- const intentClass = matcher . patternCompare ( input ) ;
252
- const response = matcher . responseCompare ( input , intentClass ) ;
253
- console . log ( response ) ;
254
- } ) ;
235
+ module . exports = IntentMatcher ;
Original file line number Diff line number Diff line change
1
+ const readline = require ( "readline" ) ;
2
+ const IntentMatcher = require ( "./Janex.js" ) ;
3
+
4
+ const intentsFilePath = "./intents.json" ;
5
+ const matcher = new IntentMatcher ( intentsFilePath ) ;
6
+
7
+ const rl = readline . createInterface ( {
8
+ input : process . stdin ,
9
+ output : process . stdout ,
10
+ } ) ;
11
+
12
+ rl . question ( "You: " , ( input ) => {
13
+ // Use the input here
14
+ console . log ( "User input:" , input ) ;
15
+
16
+ // Close the readline interface
17
+ rl . close ( ) ;
18
+
19
+ const intentClass = matcher . patternCompare ( input ) ;
20
+ const response = matcher . responseCompare ( input , intentClass ) ;
21
+ console . log ( response ) ;
22
+ } ) ;
You can’t perform that action at this time.
0 commit comments