Direkt zum Seiteninhalt springen

Seite bearbeiten Autoren/Versionen Neue Seite Letzte Änderungen

Heinzelnisse REST-API

License

Heinzelnisse supports a REST-API which can be used free of charge. Usage terms are covered under: GPL-v2 or CC-BY-NC-SA. The API is used internally in the App and therefore considered stable. To be informed about usage changes, e.g. over-usage countermeasures (API-keys), please write an email to heiko.klein@gmx.net .

Usage

The Heinzelnisse REST-API can be called under https://heinzelnisse.info/searchResults? The API support the following options:

  • searchItem=* the word to search for
  • dictExactSearch=on| only search for the complete word
  • dictDeNoSearch=on| search from German (DE) to Norwegian (NO). Corresponds to the deTrans attribute in the response.
  • dictNoDeSearch=on| search from Norwegian (NO) to German (DE). Corresponds to the noTrans attribute in the response.
  • dictPhoneticSearch=on| find suggestions for phonetically similar words (e.g. fandom=phantom), or conjugated/declinated words (e.g vergas=vergessen). Corresponds to the dePhonetics and noPhonetics attribute in the response.
  • wikiSearch=on| find results from the wiki. Corresponds to the wikiPageNames attribute in the response.
  • forumKeywordSearch=on| find results in the forum. Corresponds to the forumQuestions attribute in the response.
  • dictNynorskSearch=on| find similar words in the nynorsk dictionary
  • dictBokmaalSearch=checked| find similar words in the bokmål dictionary
  • type=json return json (only option)
  • setOption=on| use these options (or use defaults)

The response of a typical query like https://heinzelnisse.info/searchResults?searchItem=test&dictExactSearch=on&type=json&setOptions=&dictDeNoSearch=on&dictNoDeSearch=on&dictPhoneticSearch=on&wikiSearch=on&dictNynorskSearch=on&dictBokmaalSearch=checked&forumKeywordSearch=on looks like:

{

"bookmaalWords": [ "teste"
),
"dePhonetics": [
"testen"
),
"deTrans": [
{
"article": "m", "bokmaalLink": "test",
"category": "",
"grade": "",
"id": 0,
"lang": {},
"other": "",
"t_article": "m",
"t_other": "",
"t_word": "test",
"word": "Test"
}
), "forumQuestions": [),
"noPhonetics": [
"teste"
),
"noTrans": [
{
"article": "m", "bokmaalLink": "test",
"category": "",
"grade": "",
"id": 0,
"lang": {},
"other": "",
"t_article": "m",
"t_other": "",
"t_word": "Test",
"word": "test"
}
), "nynorskWords": [
"test",
"teste"
),
"searchItem": "test",
"wikiPageNames": [
"BergenTest",
"OldNews"
) }

The most important attributes are noTrans and deTrans with lists of the following objects:

{

"word": "Test", "article": "m",
"other": "",
"t_article": "m",
"t_other": "",
"t_word": "test"
}

This describes (among others) the word in the original language de or no with article and additional information other and the translation t_word, t_article, t_other.

Examples

A fast and typical query to find the translations from a german text, e.g. to find the word vergessen would be:

https://heinzelnisse.info/searchResults?searchItem=vergessen&dictExactSearch=on&type=json&setOptions=on&dictDeNoSearch=on&dictNoDeSearch=&dictPhoneticSearch=off&wikiSearch=&dictNynorskSearch=&dictBokmaalSearch=&forumKeywordSearch=

Resulting in:

{

"dePhonetics": [ "in Vergessenheit geraten",
"Vergessenheit",
"vergesslich",
"Vergesslichkeit"
),
"deTrans": [
{
"article": "adj", "other": "",
"t_article": "adj",
"t_other": "",
"t_word": "glemt",
"word": "vergessen"
},
{
"article": "v", "other": "",
"t_article": "v",
"t_other": "",
"t_word": "glemme",
"word": "vergessen"
},
{
"article": "v", "other": "",
"t_article": "v",
"t_other": "",
"t_word": "skrinlegge",
"word": "vergessen"
},
) }

The list of words dePhonetics are in particularly useful, when the given word can not be found, or does not give the desired results. In these cases, the desired word in the dePhonetics list should be used as searchItem. Example: https://heinzelnisse.info/searchResults?searchItem=vergas&dictExactSearch=on&type=json&setOptions=on&dictDeNoSearch=on&dictNoDeSearch=&dictPhoneticSearch=off&wikiSearch=&dictNynorskSearch=&dictBokmaalSearch=&forumKeywordSearch= will not give any deTrans but:

{

"dePhonetics": [ "Vergaser",
"vergessen"
),
}

which should lead to the query in the first example.