Dictionary definition lookup and local vocabulary builder

Introduction

Many non-native English speakers frequently look up obscure words in Google. It would be great if there was a plugin that could do the lookup without leaving Obsidian.

Moreover, one of the best ways of getting better at a foreign language is building (and growing) your vocabulary based on the relationship between words; something like a Wordnet (Relevant to this topic, too.).

I have an idea for a plugin that looks up words and stores them in the vault as a note with internal links to other words.

How does it work

So the idea is that the user can query the dictionary with a command or hotkey and type in the word they are looking for, or select a word and invoke the plugin.

The plugin would first look into Dictionary folder to see if the definition note (e.g., hello.md) already exists. If not, it queries a dictionary API (like the unofficial Google Dictionary API).

The API returns the following for hello:

[
    {
        "word": "hello",
        "phonetics": [
            {
                "text": "/həˈloʊ/",
                "audio": "https://lex-audio.useremarkable.com/mp3/hello_us_1_rr.mp3"
            },
            {
                "text": "/hɛˈloʊ/",
                "audio": "https://lex-audio.useremarkable.com/mp3/hello_us_2_rr.mp3"
            }
        ],
        "meanings": [
            {
                "partOfSpeech": "exclamation",
                "definitions": [
                    {
                        "definition": "Used as a greeting or to begin a phone conversation.",
                        "example": "hello there, Katie!"
                    }
                ]
            },
            {
                "partOfSpeech": "noun",
                "definitions": [
                    {
                        "definition": "An utterance of “hello”; a greeting.",
                        "example": "she was getting polite nods and hellos from people",
                        "synonyms": [
                            "greeting",
                            "welcome",
                            "salutation",
                            "saluting",
                            "hailing",
                            "address",
                            "hello",
                            "hallo"
                        ]
                    }
                ]
            },
            {
                "partOfSpeech": "intransitive verb",
                "definitions": [
                    {
                        "definition": "Say or shout “hello”; greet someone.",
                        "example": "I pressed the phone button and helloed"
                    }
                ]
            }
        ]
    }
]

The plugin would then parse it to a note Dictionary/hello.md wherein the definition is bolded, examples are italicized, part of speech is tagged, and the synonyms/antonyms appear as internal links:

# Hello

#dictionary 
`/həˈloʊ/`, 
`/hɛˈloʊ/`

---
#exclamation

- **Used as a greeting or to begin a phone conversation.**
	-  *"hello there, Katie!"*

---
#noun

- **An utterance of “hello”; a greeting."**
	- "she was getting polite nods and hellos from people",
	- synonyms": [[greeting]], [[welcome]], [[salutation]], [[saluting]], [[hailing]], [[address]], [[hello]], [[hallo]]

---
#intransitive-verb

- **Say or shout “hello”; greet someone.**
	- *I pressed the phone button and helloed*

Which would look similar to Google Dictionary results:

image

Wrap up

After using it for a while, this will produce a nice graph of interconnected words. (I am not an Anki fan, but) The dictionary can be used as a deck of Anki flashcards, too.

I do not have enough programming knowledge to make Obsidian plugins (thus “lack the ability to can” :smile:) Though, this plugin—at least, a very simple version of it—does not seem to be hard to implement, right?

2 Likes

Hey! My Plugin Obsidian-Dictionary now supports this Feature! Just look up a Word in the Sidebar and click on New Note to create it locally.

5 Likes

Hey phibr0, Can we trigger the meaning automatically after double-clicking the double word?

Hmm… I will look into that but I am not sure if there is an event for that. You can enable the Custom Context Menu and right click on a Word to look it up though.

2 Likes

Hello, How do you add your own word and definition into the dictionary? I am a new user.

2 Likes