File Syntax

One of the best things about Nihongopedia is how easy it is to add your own data, examples, and flash cards to the app.

Nihongopedia has two registered filetypes, .npdata and .npdeck, both of which are simply plain text files (UTF-8 encoding) with a different extension. You can create or modify them in your favorite text editor. Nihongopedia recommends freeware Notepad++ for Windows (be sure to switch encoding to UTF-8) and TextWrangler for Mac.

Tip: when using “Import from URL” from within the app, the file extension doesn’t need to be .npdata or .npdeck; .txt will work exactly the same.

Topic Data (.npdata) File Syntax

syntax1Precautions and considerations when editing .npdata in a text editor:

  • All Topics data should come together before all the examples.
  • Breaklines are ignored by the app.
  • Example key numbers are relevant only within a file, so there’s no need to worry about overlap with other files or examples already in the app.
  • A single example key number may be used by multiple topics.
  • Topics have a hard limit of 12 examples each (any more than that and the pagination becomes too unwieldy).
  • All syntax characters (including the space after topic field keys) must be half-width (ie. <>_:|# are recognized as syntax whereas <>_:|#) are not.
    • When switching between Japanese and English input it is easy to mix characters accidentally so please be particularly cautious about this.
  • Among furigana in an example, the kanji upon which they are based must be unique. For example, you may not set two different furigana for 大 like this in the same sentence: <大:おお:5>きい and <大:たい:4>した
    • However, this is okay: <大:おお:5>きい and <大学:だいがく:5>.

Flashcard Data (.npdeck) Syntax

(this will be updated soon!)