From 6ee7b1e4c85b61dd8cdb956bd9c3195ab139036f Mon Sep 17 00:00:00 2001 From: Sampo Silvennoinen Date: Mon, 25 Jul 2022 19:21:30 +0300 Subject: [PATCH] Readme: add usage example --- README.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/README.md b/README.md index 6d26243..23e7964 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,33 @@ Related projects: `yarn add viking-language-dictionary-abbreviations` +##### Usage + +Find abbreviations from text content: + +```javascript +import { findAbbreviations } from 'viking-language-dictionary-abbreviations' + +// Example content from dictionary, from definition of 'alla' +const content = 'str m acc pl, f acc sg; wk m acc/dat/gen sg, f acc sg, n all sg of allr'; + +// Returns map of abbreviations to meanings. +const result = findAbbreviations(content); + +console.log(result); +// acc => accusative +// dat => dative +// f => feminine +// gen => genitive +// m => masculine +// n => neuter +// pl => plural +// sg => singular +// str => strong (adj or verb) +// wk => weak (adjective or verb) + +``` + ### About "Viking Language"