top | item 35825341

(no title)

ChancyChance | 2 years ago

What’s nostalgic to me is that this is such a classic Perl pattern: hashing manipulated strings to find relationships. Prior to Perl doing this was painful. Boost wasn’t a thing. Python was in its cradle and Java was still struggling with beans. Perl removed the barriers between complex coding ideas and an implementation that C wasn’t ready for. The time from thought to prototype was near instant compared to current compiled languages.

discuss

order

eesmith|2 years ago

Ummm, the author used awk for the first version in the 1990s.

> This was easy to do, even at the time, when the word list itself, at 2.5 megabytes, was a file of significant size. Perl and its cousins were not yet common; in those days I used Awk. But the task is not very different in any reasonable language:

ChancyChance|2 years ago

I know. I’m talking about Perl. Try to keep up.

hnfong|2 years ago

You don't _need_ to hash anything.

The simplest way to do it, is to convert all the words to (normal_form, orig_word) pairs, write the list to a file, then sort it.

It will be trivial to find the words with common normal form after the sort.

(Of course, you wouldn't catch me trying to implement that with C if perl is an option...)

avereveard|2 years ago

But the normal form as defined by the article is an hash, even if you then use sorting instead of bucketing

ChancyChance|2 years ago

Go try your method and spot the bug. If you can’t, then respond and I’ll tell you. hint: you need one more manipulation to find the answer before or after the sort, there’s a command line version of it but it uses .. a hash.

zeroonetwothree|2 years ago

Even in C it’s not that hard to make a basic hash table. It’s probably like 20 lines of code or something.