Giter Site home page Giter Site logo

hassuimmat-sanat's Introduction

hassuimmat-sanat

A solution to the first wundernut by Wunderdog:

Hassuimmat sanat / The Funniest Words http://wunder.dog/hassuimmat-sanat

The wundernut's explanation text (in Finnish):

"Koodauspähkinä: Hassuimmat sanat

Monet ulkomaalaiset pitävät suomen kieltä hassun kuuloisena vokaalien runsauden vuoksi. Erityisen hassulta kuulostaa, jos vokaaleja on monta peräkkäin, kuten kuuluisassa sanassa "hääyöaie", jossa on seitsemän peräkkäistä vokaalia.

Kehitämme tieteellisen tavan sanojen hassuuden pisteytykseen.

Jokainen vokaaliketju saa n×2^n pistettä, jossa n on vokaalien määrä ketjussa. Sanan vokaaliketjujen saamat pisteet lasketaan yhteen, jolloin saadaan sanan hassuuspisteet.

Esimerkiksi sana "koira" saa 10 pistettä, koska "koira" sisältää vokaaliketjut "oi" (2×22 = 8 pistettä) ja "a" (1×21 = 2 pistettä), ja 8 + 2 = 10.

Sana "hääyöaie" saa 896 pistettä, koska vokaaliketju "ääyöaie" saa (7×27 = 896 pistettä).

Jotta hauskuus ei loppuisi kesken, käytämme esimerkkiteoksena Volter Kilven romaania Alastalon salissa, jota pidetään suomalaisen kirjallisuuden mestarinäytteenä hassuuden saralla.

Mikä on Alastalon salissa -romaanin hassuin sana, tai hassuimmat sanat, jos useampi sana saa korkeimmat hassuuspisteet?"

English tl;dr: Words with long vowel sequences are funny. Each vowel sequence in a word gets funny points with formula n×2^n, n being the length of the sequence. Sum up the points to get the word's points. Find the word(s) with the highest funny points in a book.

The solution uses text file containing "Alastalon salissa" by Volter Kilpi. The book is public domain.

Usage

Run: lein run

Test: lein midje

Can be run in AWS Lambda. See the doc directory for a screenshot of a successful AWS Lambda test output.

License

Copyright © 2017 Tomi Piri

Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.

hassuimmat-sanat's People

Contributors

tomspeed avatar

Watchers

James Cloos avatar  avatar

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.