Code

Find and replace

The last few days, I’ve been working on a function to replace elements in a list. Apparently, the standard Haskell library does not include such a function. Data.List.Utils does, but I wanted to do it the hard way and build my own. For the time being, I came up with the function below. I still...

Fortune-telling

The second chapter in “Natural Language Processing for the Working Programmer” (nlpwp.org) deals with bigrams, n-grams and collocations. So what are these weird things? Bigrams are pairs of words that follow each other in a sentence. Chomsky’s sentence “Colorless green ideas sleep furiously” can be split up in the following list of bigrams: [["Colorless","green"],["green","ideas"],["ideas","sleep"],["sleep","furiously"]] N-grams...

Broken promises

The cute little program “brown” worked, but it had some problems: When I used it on the complete Brown Corpus, it created a stack place overflow because of lazy evaluation. In human language: it crashed. It did everything at once. I want to be able to pass commands and arguments to the application. The frequency...

First post!

The big test… In order to do something with Haskell and linguistics, I figured that I had to get my fundamentals right. Just to get going, I tried to write an application to: open a file use its contents for some easy computations send the interesting results to the screen/Terminal. I based my little program...