[Tutor] could someone break this down

dn PythonList at DancesWithMice.info
Sat Apr 9 19:17:59 EDT 2022


On 10/04/2022 10.56, Nathan Smith wrote:
> I've been working with a module recently called TWL-06 python scrabble
> dictionary, found here:
> https://github.com/fogleman/TWL06


Took a look at TWL. From the examples given, it looks straightforward to
me - but that doesn't help you one iota!


> in this module, the creator packaged a dictionary of words into a DAWG,
> Directed Acyclic Word Graph, which was then packaged into a binary
> lookup table ...
> Once unpackaged from that though (done by the module) it still does not
> look like words to me (presumably because it is in a DAWG). I don't

It is *not* meant to look like words! (this is actually described in the
ReadMe) It is a series of letters linked together in a fashion that will
'construct' ('legal') words.

Thus, in the example, wrt 'legal words', the letter "b" may only be
followed by the letters a, d, e, ... So, there are NO words beginning bc...


> entirely understand how to create these though and fear it's because I
> don't understand the termonology perhaps? ...
> but don't want to use tit without knowing 1, what I'm talking about and
> 2, if it will even work.
> Any help anyone can provide is appreciated.

No "perhaps" <grin>.

Try removing the word "Word" and researching "Directed Acyclic
Graph[s]". Wikipedia's description is rather mathematical in nature
(https://en.wikipedia.org/wiki/Directed_acyclic_graph). Hazelcast's
description (towards the top of my search/hits) might be easier to
follow (https://hazelcast.com/glossary/directed-acyclic-graph/) NB
remember, acyclic graphing is a technique that can be applied in areas
other than letters and words!

Then, turn your search-engine to the full term. It's quite topical given
the current/recent fad for Wordle!

Fire-up your REPL (Python in terminal) and duplicate/work-through the
examples the TWL-folk have given.

By which time, you will have absorbed some of the terminology, and
hopefully be able to decide if TWL will 'work' in your application...

-- 
Regards,
=dn


More information about the Tutor mailing list