Libraryless. Click here for Pure Java version (5720L/39K).
1 | static L<WordNet> wordNet(S word, O... _) { |
2 | optPar bool verbose; |
3 | new L<WordNet> out; |
4 | for (LS li : html_contentsOfLIs(wordNet_rawPage(word))) { |
5 | new WordNet w; |
6 | w.word = htmlDecode(stringContentsOfFirstContainerTag(li, "b")); |
7 | w.wordType = deRoundBracket(trimJoin(contentsOfContainerTag(first(findContainerTagWithParams(li, "a", class := "pos"))))); |
8 | w.examples = htmlDecode(deRoundBracket(trim(stringContentsOfFirstContainerTag(li, "i")))); |
9 | S raw = join(dropContainerTags(cloneList(li))); |
10 | w.description = htmlDecode(deRoundBracket(dropLeadingCommas(trim(raw)))); |
11 | w.synonyms = new L; |
12 | for (LS a : findContainerTag(li, "a")) |
13 | if (nempty(tagParam(a, "href"))) |
14 | addUnlessEqualTo(w.synonyms, htmlDecode(trimJoin(contentsOfContainerTag(a))), "S:"); |
15 | |
16 | if (verbose) print(w); |
17 | out.add(w); |
18 | } |
19 | ret out; |
20 | } |
download show line numbers debug dex old transpilations
Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, whxojlpjdney
No comments. add comment
Snippet ID: | #1023879 |
Snippet name: | wordNet - download & parse a WordNet entry [OK] |
Eternal ID of this version: | #1023879/10 |
Text MD5: | b58322467a365e5a715a9ee9388470f9 |
Transpilation MD5: | ca752b113cf985b16cb3577aff0fe74c |
Author: | stefan |
Category: | javax / networking |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2019-07-11 16:40:45 |
Source code size: | 871 bytes / 20 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 256 / 397 |
Version history: | 9 change(s) |
Referenced in: | [show references] |