Coder Social home page Coder Social logo

stscoundrel / old-norse-dictionary-scala Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 4.93 MB

Old Norse Dictionary for Scala / Java. From The Cleasby & Vigfusson Old Norse to English Dictionary.

License: MIT License

Scala 100.00%
dictionary java maven medieval-languages medieval-studies norse old-icelandic old-norse scala jvm

old-norse-dictionary-scala's Introduction

Old Norse Dictionary

Old Norse to English Dictionary for Scala / Java. The dictionary consists of 35 000+ Old Norse words with English translations.

Based on the classic dictionary by Richard Cleasby and Gudbrand Vigfusson. If you find this one too abbreviated, academic or hard to read, you might want to check out A Concise Dictionary of Old Icelandic (Java)

Install

As Maven dependency.

<dependency>
  <groupId>io.github.stscoundrel</groupId>
  <artifactId>oldnorse</artifactId>
  <version>0.2.1</version> <!-- Note! Check latest release number -->
</dependency>

For alternative install methods, see the Maven Central Repo

Usage

The dictionary comes in two variants:

  • Markup dictionary has HTML markup <i> and <b> to match look of the original book.
  • No-markup version has the same content without any additional formatting tags.

Dictionary defaults to "no markup".

import io.github.stscoundrel.oldnorse.Dictionary
import io.github.stscoundrel.oldnorse.DictionaryEntry

val dictionary = new Dictionary()

// Both dictionaries return entries that consist of headword and definitions list.
val noMarkupResult = dictionary.getNoMarkupDictionary() // also aliased as getDictionary()
val markupResult = dictionary.getMarkupDictionary()

// Headwords wont differ between dictionaries.
println(noMarkupResult(1989).headword)  // át-frekr
println(markupResult(1989).headword)    // át-frekr

// But definition markup does differ.
println(noMarkupResult(14).definitions(0))   // adj. <i>greedy, voracious,</i> Hkv. 2. 41.
println(markupResult(14).definitions(0))     // adj. greedy, voracious, Hkv. 2. 41.

Individual words are returned in format of:

{
    headword: String
    definitions: Array[String]
}

Java interop

Should you use this library with Java, you may need to make some minor adjustements. For example, Java may consider fields case class DictionaryEntry to be "private". You can get around this by calling them as getters, like myEntry.headword() instead of myEntry.headword

About Cleasby & Vigfusson Dictionary

"Icelandic-English" dictionary was started by Richard Cleasby and finished by Gudbrand Vigfusson. It was published in 1874, which leads to there being many public domain versions of the book available.

old-norse-dictionary-scala's People

Contributors

dependabot[bot] avatar stscoundrel avatar

Watchers

 avatar  avatar

old-norse-dictionary-scala's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.