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

RE: How to parse text into words, phrases, clauses, s

Subject: RE: How to parse text into words, phrases, clauses, sentences, and paragraphs
From: mark bordelon <markcbordelon@xxxxxxxxx>
Date: Thu, 7 Jun 2007 07:25:08 -0700 (PDT)
RE:  How to parse text into words
Michael, That was all I needed. Thanks for your help.
This list is great.


Mark, Getty Trust.

--- Michael Kay <mike@xxxxxxxxxxxx> wrote:

> > This is my first problem. How to apply a template
> match ysing 
> > the tokenize() function. And which order to apply
> (from 
> > paragraph -> word or word -> paragraph).
> It's generally easiest to do it top-down, I think.
> Something like this:
> <xsl:for-each select="tokenize(.,
> $sentence-delimiter)">
>   <sentence id="{position()}">
>     <xsl:for-each select="tokenize(.,
> $phrase-delimiter)">
>       <phrase id="{position()}">
>         <xsl:for-each select="tokenize(.,
> $word-delimiter)">
>           <word id="{position()}">
>             <xsl:value-of select="."/>
> > 
> > > (d) doing the output numbering.
> > 
> I think you just need position() as shown above.
> Sometimes you need to work bottom-up if the
> "sentences" can't be recognized
> until you've identified the "words", for example if
> you want to avoid
> treating "." as ending a sentence if it appears in a
> number. You're then
> sometimes in the domain of positional grouping:
> create a long flat list of
> words, and then group it into sentences using some
> kind of test applied to
> the individual words.
> Michael Kay
> http://www.saxonica.com/

Boardwalk for $500? In 2007? Ha! Play Monopoly Here and Now (it's updated for today's economy) at Yahoo! Games.

Current Thread


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.
First Name
Last Name
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.