Created
September 30, 2010 12:52
-
-
Save ponzao/604520 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(reduce ; Kootaan yks mappi sanoista. | |
(partial merge-with +) ; Kahdessa mapissa olevien avainten arvot summataan. | |
(map ; Suorittaa alla olevan funktion kaikille tiedostoille ({"foo" 1} {"baz" 10}). | |
#(frequencies ; Frequencies palauttaa mapin esiintymistä {"foo" 1, "bar" 4}. | |
(re-seq #"\w+" (slurp %))) ; Lukee tiedoston ja luo sekvenssin sanoista. | |
files)) ; Lista tiedostoista. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment