Skip to content
/ frominto Public
forked from banistr/frominto_fi

Finnish human-understandable translation lib for "from/to/in a city"

License

Notifications You must be signed in to change notification settings

petja/frominto

 
 

Repository files navigation

frominto

npm

🇫🇮 Finnish language is hard. We come from "Mäntyharjulta" or "Hiekkaharjusta". We spend our time "Lahdessa" or "Kesälahdella". This library features more than 90 conjugation rules (elative, inessive, illative and genitive cases), 132 automated tests and pinch of awesomeness ✨

This project is based on the work of Antti Kosonen which haven't updated since 2016. Many new features have been added in this fork!

Usage

import { strictEqual } from 'assert/strict'
import { From, In, To, Via, frominto } from 'frominto'

// Method 1
strictEqual(From('Helsinki'), 'Helsingistä')
strictEqual(In('Helsinki'), 'Helsingissä')
strictEqual(To('Helsinki'), 'Helsinkiin')
strictEqual(Via('Helsinki'), 'Helsingin')

// Method 2
const cityConjugations = frominto('Helsinki')
strictEqual(cityConjugations.from, 'Helsingistä')
strictEqual(cityConjugations.in, 'Helsingissä')
strictEqual(cityConjugations.to, 'Helsinkiin')
strictEqual(cityConjugations.via, 'Helsingin')

Contributions

Contributions are welcome and greatly appreciated ☺️

  1. Write a test case in test/index.ts
  2. Write a rule in index.ts in the appropriate line
  3. Make the pull request! 💪

About

Finnish human-understandable translation lib for "from/to/in a city"

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 99.5%
  • JavaScript 0.5%