Open German WordNet (Dart)

Dart library and simple CLI app for Open German WordNet.

Uses deWordNet.xml from hdaSprachtechnologie/odenet in the WordNet XML schema.

The file is cached using xdg_directories thus only works on Linux.

Usage

To use the wordnet.dart library:

import 'package:odenet_wordnet_de/odenet_wordnet_de.dart';

void main() async {
  await updateCachedDeWordNet();
  final resource = await loadDeWordNetLexicalResource();
  print('Number of lexical entries: ${resource.lexicalEntries.length}');

  // Accessing lexical entries and synsets
  print('Lexical entries: ${resource.lexicalEntries.length}');
  print('Synsets: ${resource.synsets.length}');

  // Finding lexical entries by part of speech
  final nouns = resource.findLexicalEntries(PartOfSpeech.n);
  print('Number of nouns: ${nouns.length}');

  // Extract the lemma string (word)
  final firstLemma = resource.lexicalEntries.map(toLemmaWrittenForm).first;
}

LexicalResource methods

  • lexicalEntries: Returns an Iterable<XmlElement> of all lexical entries.
  • synsets: Returns an Iterable<XmlElement> of all synsets.
  • findLexicalEntries(PartOfSpeech partOfSpeech): Returns an Iterable<XmlElement> of lexical entries filtered by part of speech.

License

The Open German WordNet is openly licensed under the Creative Commons Attribution-ShareAlike 4.0 International License.

Citation

The canonical citation(s) are in citation.bib, in bibtex format. Please cite them when you write a paper that uses (or refers to) OdeNet.

Libraries

odenet_wordnet_de