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

Re: Calculating groups of repeating elements

Subject: Re: Calculating groups of repeating elements
From: Michael Ludwig <mlu@xxxxxxxxxxxxx>
Date: Thu, 11 Dec 2008 18:58:30 +0100
Re:  Calculating groups of repeating elements
Wendell Piez schrieb:

It seems to me that if you are wanting to collect groups of 2+ words that appear in 2+ places, a useful first step would be to collect the set of intersections of words occuring in every pairing of places. This would be a large number, n(n-1)/2 for n places, but not the huge exponent of 2 cited by Michael, and hence possibly a more direct route to your goal.

Great! This looks like a much more useful approach to the problem!


yields this result:

<?xml version="1.0" encoding="UTF-8"?>
<collection>
   <common_words>
      <place_number>2</place_number>
      <place_number>1</place_number>
      <words>
         <word>Aa</word>
         <word>C</word>
      </words>
   </common_words>
   <common_words>
      <place_number>3</place_number>
      <place_number>1</place_number>
      <words>
         <word>Aa</word>
         <word>C</word>
         <word>Qqq</word>
      </words>
   </common_words>
   [...]

Now, generating all interesting subsets of "words/word/string()" can be done far more efficiently, as the input sets are probably *much* smaller on average.

While this isn't quite what you want, the results you want could be
derived by grouping these lists further, skipping pairings that
contain less than two 'word' elements, and collecting together those
have have the same sets (and thus represent sets of words that occur
in more than two places).

Yes. But I think you must still generate the subsets, because if you have, say, three occurrences of (a,b,c) and two of (a,b,d), you have five occurrences of (a,b), which is interesting, if my understanding of the requirement is correct.

This continues to be interesting.

Michael Ludwig

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-2011 All Rights Reserved.