re: line delimiter?
[EMAIL PROTECTED] suggested (thank you): Why don't you try useing a hard space character instead of just a normal space to delimit sentences. A hard space is a blank ascii character of fixed width that wont wrap at the end of a line. At least on the mac you make them by typing option-spacebar. Any ideas on what the win equivalent is? Cheers. -- Nicolas R Cueto Takakura JHS/SHS Nagoya, Japan This is the MetaCard mailing list. Archives: http://www.mail-archive.com/metacard%40lists.best.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm
line delimiter?
Hello. When a user clicks on a word in a sentence (not a cr-line but a grammatical sentence), how could I find out the number of that sentence? I'd like to create sound files for each of the sentences in a paragraph, and then label each sound file with a corresponding number. For example, I'd want sound file "2.au" to be played when the user clicks anywhere within the second sentence of this paragraph: This is the first sentence. "However this," she said, "is the second sentence." Is this, then, the third sentence? I've consulted clickChunk, clickChar, etc., and thought about playing with the itemDelimiter (there's no such thing as a lineDelimiter, is there?) but can't figure out anything, elegant or ugly. Thank you in advance. -- Nicolas R Cueto Takakura JHS/SHS Nagoya, Japan This is the MetaCard mailing list. Archives: http://www.mail-archive.com/metacard%40lists.best.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm
line delimiter?
Hello. When a user clicks on a word in a sentence (not a cr-line but a grammatical sentence), how could I find out the number of that sentence? I'd like to create sound files for each of the sentences in a paragraph, and then label each sound file with a corresponding number. For example, I'd want sound file "2.au" to be played when the user clicks anywhere within the second sentence of this paragraph: This is the first sentence. "However this," she said, "is the second sentence." Is this, then, the third sentence? I've consulted clickChunk, clickChar, etc., and thought about playing with the itemDelimiter (there's no such thing as a lineDelimiter, is there?) but can't figure out anything, elegant or ugly. Thank you in advance. -- Nicolas R Cueto Takakura JHS/SHS Nagoya, Japan This is the MetaCard mailing list. Archives: http://www.mail-archive.com/metacard%40lists.best.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm
Re: line delimiter?
At 8:16 PM +0900 1/2/2000, Nicolas R Cueto wrote: Hello. When a user clicks on a word in a sentence (not a cr-line but a grammatical sentence), how could I find out the number of that sentence? I'd like to create sound files for each of the sentences in a paragraph, and then label each sound file with a corresponding number. For example, I'd want sound file "2.au" to be played when the user clicks anywhere within the second sentence of this paragraph: This is the first sentence. "However this," she said, "is the second sentence." Is this, then, the third sentence? I've consulted clickChunk, clickChar, etc., and thought about playing with the itemDelimiter (there's no such thing as a lineDelimiter, is there?) but can't figure out anything, elegant or ugly. Hi Nicolas Some sweat and tears are needed I think. I'm sure there's no way to accurately identify an English sentence through a script unless you can doctor your text in some way with your own delimeters. (Double spaces between sentences and only between sentences, for example.) Failing that, I think you will have to manually record the character positions of the ends (and possibly starts if not all text in the field is linked to a sound) of all the sentences. You could then store these positions, one per line, in a custom property and have a parallel custom property that stores a reference to the corresponding sound. Then use the clickChunk to get the clicked character position, and run down the custom property until you find the first stored position higher than the clicked character. Then play the corresponding sound. Possible gotcha: If memory serves correctly, a click on a space between words does not return the character position of the space. (I think it returns char 0 to 0, or something like that.) To include clicking on spaces, you need to apply the group style to all the text in the sentence (more work). The clickChunk then returns the entire group. If you do this, be sure the space between sentences does not have the group style applied, otherwise the clickchunk will return the same wherever you click. If you have a lot to do, it may be worth making a little tool that automates this a little. For example, select the sentence, click a button that records the relevant chracter positions and sets the group style all in one go. Hope that helps some. Cheers Dave Cragg _ The LACS Centre (Business English Training Resources) 29 Falcon Gardens (1F2), Edinburgh EH10 4AR, UK Tel/fax +44 131 466 5227 mailto:[EMAIL PROTECTED] http://www.lacscentre.co.uk _ This is the MetaCard mailing list. Archives: http://www.mail-archive.com/metacard%40lists.best.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm
Re: line delimiter?
Here's an approach that handles text where all sentences end with a period (.) - admittedly not very real-world, but maybe it will stir some thoughts. This handler converts the user's click on a word to a sentence number: on mouseUp set the itemDelimiter to "." put the clickChunk into tTextChunk put 1 into word 2 of tTextChunk put the number of items in (value(tTextChunk)) end mouseUp HTH. Phil Nicolas R Cueto wrote: Hello. When a user clicks on a word in a sentence (not a cr-line but a grammatical sentence), how could I find out the number of that sentence? I'd like to create sound files for each of the sentences in a paragraph, and then label each sound file with a corresponding number. For example, I'd want sound file "2.au" to be played when the user clicks anywhere within the second sentence of this paragraph: This is the first sentence. "However this," she said, "is the second sentence." Is this, then, the third sentence? I've consulted clickChunk, clickChar, etc., and thought about playing with the itemDelimiter (there's no such thing as a lineDelimiter, is there?) but can't figure out anything, elegant or ugly. Thank you in advance. -- Nicolas R Cueto Takakura JHS/SHS Nagoya, Japan This is the MetaCard mailing list. Archives: http://www.mail-archive.com/metacard%40lists.best.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm -- Phil Davis -- [EMAIL PROTECTED] This is the MetaCard mailing list. Archives: http://www.mail-archive.com/metacard%40lists.best.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm
Re: line delimiter?
Dave Cragg wrote: I'm sure there's no way to accurately identify an English sentence through a script unless you can doctor your text in some way with your own delimeters. (Double spaces between sentences and only between sentences, for example.) The text is already delimited, with a "/". And though I'd prefer to use double spaces as you suggest (more clean visually), I don't know how to "set itemDelimiter to" double-spaces since itemDelimiter can only be set to a single character, right? (You aren't suggesting that I use the double-space to delimit the paragraph into sentence-long items and then apply group style to each item so as to make the sentences numberable, are you?) In the meantime, working with the "/" as the itemDelimiter I did a 'set textstyle of item x to "group"' and then pasted each item (sentence) after another field. As I thought, the "/" char disappears from the sentence, but so does the group textstyle! So, back to square one. -- Nicolas R Cueto Takakura JHS/SHS Nagoya, Japan This is the MetaCard mailing list. Archives: http://www.mail-archive.com/metacard%40lists.best.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm
Re: line delimiter?
Nicolas R Cueto [EMAIL PROTECTED] asked. Hello. When a user clicks on a word in a sentence (not a cr-line but a grammatical sentence), how could I find out the number of that sentence? I'd like to create sound files for each of the sentences in a paragraph, and then label each sound file with a corresponding number. For example, I'd want sound file "2.au" to be played when the user clicks anywhere within the second sentence of this paragraph: This is the first sentence. "However this," she said, "is the second sentence." Is this, then, the third sentence? I've consulted clickChunk, clickChar, etc., and thought about playing with the itemDelimiter (there's no such thing as a lineDelimiter, is there?) but can't figure out anything, elegant or ugly. Thank you in advance. -- Nicolas R Cueto Takakura JHS/SHS Nagoya, Japan I have a suggestion. You can group the text. Here is a little handler I made up. on mouseUp put 1 into x repeat with i = 1 to -1+the number of words in char 1 to word 2 of clickcharchunk() of me if "group" is not in the textstyle of word i to i+1 of me then add 1 to x end repeat answer x end mouseUp This should allow you to get the group. Be sure you have a space after each sentence, even when you put in a different paragraph. Also be careful not to include that space in the grouped text. The next handler is admittedly messy, but it did the job in my field without resorting to grouped text. on mouseUp put 1 into x repeat with i = 1 to -1+the number of words in char 1 to word 2 of clickcharchunk() of me if char -1 of word i of me is in ".!" or (char -1 of word i of me is quote \ and (char -2 of word i of me is "." or (char -2 of word i of me is "!" and \ chartonum(char 1 of word(i+1) of me)97))) then add 1 to x end repeat answer x end mouseUp I may have forgotten some punctuation marks that delimit sentences, but I hope this helps. If you clean this up, please post it! Hope this helps, Raymond This is the MetaCard mailing list. Archives: http://www.mail-archive.com/metacard%40lists.best.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm