[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Building a Trie

Subject: Re: Building a Trie
From: "Michael Mueller-Hillebrand michael.mueller-hillebrand@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 22 Jun 2023 11:33:57 -0000
Re:  Building a Trie
Well, putting 5 minutes DemoJam in a mail...

The "problem" I challenged myself with, was the solution to a puzzle presented
in a magazine: Find the longest word in a 16x16 square of (seemingly random)
letters. (This is more fun in German than in English.)
To solve this, I got myself a word list of possible solution words (from a
Wikipedia word list, in case you are interested:
https://wortschatz.uni-leipzig.de/de/download/English).
Next, I created a recursive XSLT function that was started for each square and
crawled from each start letter to the next four candidates (top, right,
bottom, left square) and so on, always comparing the growing substrings
against the list of words.

And that last step is (in every programming language) expensive if done like
this: $words[starts-with(., $start)]
For my personal satisfaction, I am looking for a better way, and a prefix
index (Trie) seemed to be a good fit.

Best regards,
- Michael


-----Original Message-----
From: Norm Tovey-Walsh ndw@xxxxxxxxxx
<xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Thursday, June 22, 2023 8:53 AM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re:  Building a Trie

> Now I learned about Tries https://en.wikipedia.org/wiki/Trie which is
> possibly a helpful method to tackle the left-over problem with my
> DemoJam contribution at Markup UK (thanks a lot for the applause!).

I expect only a small minority of readers on this list were able to see your
demo jam presentation. Could you give us a quick explanation of the problem
youbre trying to solve?

                                        Be seeing you,
                                          norm

--
Norm Tovey-Walsh <ndw@xxxxxxxxxx>
https://norm.tovey-walsh.com/

> A man must have grown old and lived long in order to see how short
> life is.--Schopenhauer

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.