Skip to content
David-Apps edited this page Apr 30, 2024 · 8 revisions

These functions make it easier to search Wiktionary.

# Search Wiktionary.
# usage: <wt <search terms>
function+wt {
db0
H-
js-
b en.wiktionary.org/wiki/~0
sw+
/^1\. /fX
if(*) {
?^h\d ?f
/^\(\d+\. \|h\d \)/
} else {
/^</ i3*
/^There were no results matching the query\.$/f
if(?) {
/^-/fX
/^* /
}
}
}

# Search Wiktionary for a word on the current line.
# usage: <wwt [word number]
function+wwt {
db0
H-
js-
etmp
r+1@.
s/\s+/\n/g
if(?) {
}
,s/^[^\w'-]*\(.*[\w']-?\)[^\w'-]*$/$1/
~0X
s/^/https:\/\/en.wiktionary.org\/wiki\//
nostack g
sw+
/^1\. /fX
if(*) {
?^h\d ?f
/^\(\d+\. \|h\d \)/
} else {
/^</ i3*
/^There were no results matching the query\.$/f
if(?) {
/^-/fX
/^* /
}
}
}