Linux command
wn 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Look up synonyms
wn [word] -synsn
Display the hypernym tree
wn [word] -hypen
Find antonyms
wn [word] -antsa
Show an overview
wn [word] -over
Display definitions
wn [word] -g -synsn
Find hyponyms
wn [word] -hypon
Search for compound words
wn [word] -grepn
说明
wn provides a command-line interface to the WordNet lexical database, displaying synsets (sets of synonyms) and semantic relations as formatted text. For each word, different searches are available based on syntactic category (noun, verb, adjective, adverb) and relation type. Search options end with a letter indicating the part of speech: n for nouns, v for verbs, a for adjectives, r for adverbs. Multiple searches can be combined in a single command. The tool automatically performs morphological analysis, so inflected forms (e.g., "running") are resolved to their base form.
参数
- -g
- Show textual glosses (definitions)
- -s
- Show sense numbers in output
- -o
- Display synset offset numbers
- -a
- Show all synsets related to the search string
- -n _#_
- Restrict results to a specific sense number
- -h
- Display help text
- -l
- Display license and copyright information
FAQ
What is the wn command used for?
wn provides a command-line interface to the WordNet lexical database, displaying synsets (sets of synonyms) and semantic relations as formatted text. For each word, different searches are available based on syntactic category (noun, verb, adjective, adverb) and relation type. Search options end with a letter indicating the part of speech: n for nouns, v for verbs, a for adjectives, r for adverbs. Multiple searches can be combined in a single command. The tool automatically performs morphological analysis, so inflected forms (e.g., "running") are resolved to their base form.
How do I run a basic wn example?
Run `wn [word] -synsn` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -g do in wn?
Show textual glosses (definitions)