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

Re: enumerating combination

Subject: Re: enumerating combination
From: "Mukul Gandhi" <gandhi.mukul@xxxxxxxxx>
Date: Thu, 28 Jun 2007 23:46:59 +0530
Re:  enumerating combination
Sometime back, I had written a combination generator in Java. The
programs are available at:

http://gandhimukul.tripod.com/comb.java   (this is the starting point,
and uses the 2nd file below)
http://gandhimukul.tripod.com/CombinationGenerator.java

If you find it interesting, you could adapt it in XSLT (perhaps use it
via extension mechanism).

On 6/28/07, Matthieu Ricaud <matthieu.ricaud@xxxxxxxxx> wrote:
Hello,

I'm searching for hours for a solution to my problem, but didn't find a
solution ...

It's about a spellchecker. When searching for an experssion with say N words,
I want to list every combinations of suggested words.
I get the list of suggested words in an xml file, if the word exists (is well
spelled) than I don't get any suggestions for it, if not I get as many
suggestions as there are in the "spell base" .
The xml file could look like that for example :

<?xml version="1.0" encoding="UTF-8"?>
<spellchecker date="Wed Jun 27 17:13:12 CEST 2007">
       <word valeur="a" exist="false">
               <suggest value="a1"/>
               <suggest value="a2"/>
               <suggest value="a3"/>
               <suggest value="a4"/>
               <suggest value="a5"/>
       </word>

<word value="b" exist="true"></word>

       <word value="c" exist="false">
               <suggest value="c1"/>
               <suggest value="c2"/>
               <suggest value="c3"/>
               <suggest value="c4"/>
               <suggest value="c5"/>
       </word>

       <word value="d" exist="false">
               <suggest value="d1"/>
               <suggest value="d2"/>
               <suggest value="d3"/>
       </word>
</spellchecker>

So what I like for result is :
a1 *b* c1 d1
a1 *b* c1 d2
a1 *b* c1 d3

a1 *b* c2 d1
a1 *b* c2 d2
a1 *b* c2 d3

a1 *b* c3 d1
a1 *b* c3 d2
a1 *b* c3 d3

a2 *b* c1 d1
a2 *b* c1 d2
a2 *b* c1 d3

a2 *b* c2 d1
a2 *b* c2 d2
a2 *b* c2 d3

a2 *b* c3 d1
a2 *b* c3 d2
a2 *b* c3 d3

Any idea of an xslt able to do that or any suggestions would be really
welcome !

Matthieu


--
Regards,
Mukul Gandhi

http://gandhimukul.tripod.com/

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.