Libraryless. Click here for Pure Java version (9235L/67K/217K).
1 | sS ai_simplifyNP_2(S s) { |
2 | loop: for (S pat, pat2 : mechMap("Noun simplification patterns")) { |
3 | SS map = matchDollarVarsIC_plusBrackets(pat, s); |
4 | if (map == null) continue; |
5 | for (S var, val : map) { |
6 | if (startsWith(var, "$noun") && !isNoun(val)) continue loop; |
7 | } |
8 | ret replaceVars(pat2, map); |
9 | } |
10 | ret s; |
11 | } |
Began life as a copy of #1011195
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: | #1021340 |
Snippet name: | ai_simplifyNP_2 - simplify noun phrase |
Eternal ID of this version: | #1021340/2 |
Text MD5: | dd8693bbb260c05f59a13677817e2e37 |
Transpilation MD5: | 2da053e8268358954a40aed51ae19470 |
Author: | stefan |
Category: | javax / a.i. |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2019-02-08 20:28:17 |
Source code size: | 338 bytes / 11 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 279 / 361 |
Version history: | 1 change(s) |
Referenced in: | [show references] |