Libraryless. Click here for Pure Java version (6934L/46K).
1 | sclass AI_CategorizerBot > AttractorBot {
|
2 | Long now; |
3 | |
4 | public void run {
|
5 | say("I can categorize things for you");
|
6 | } |
7 | |
8 | // CONFIG |
9 | |
10 | class Attractor1 > Attractor {
|
11 | S category; |
12 | |
13 | public bool matches(S s) {
|
14 | if (parseEnglishMonthName(s) > 0) |
15 | ret true with category = "month name"; |
16 | if (isInteger(s)) |
17 | ret true with category = "integer"; |
18 | false; |
19 | } |
20 | |
21 | public void run {
|
22 | say(category); |
23 | } |
24 | } |
25 | |
26 | *() {
|
27 | standardAttractors(new Attractor1); |
28 | } |
29 | } |
Began life as a copy of #1022834
download show line numbers debug dex old transpilations
Travelled to 7 computer(s): bhatertpkbcr, cfunsshuasjs, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
| Snippet ID: | #1022843 |
| Snippet name: | AI_CategorizerBot |
| Eternal ID of this version: | #1022843/1 |
| Text MD5: | 0b99bb16d1aeed4db47cbaf72e27f42a |
| Transpilation MD5: | 7e1d6149d0b83ab25ef08e4fe28bc7ec |
| Author: | stefan |
| Category: | javax / a.i. |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2019-04-10 00:30:36 |
| Source code size: | 544 bytes / 29 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 475 / 1001 |
| Referenced in: | [show references] |