wHi Roman,

if the text has more than 2 or 3 constructions of the form

"is a quantity of/is made of chalk from source"

then it is easier to "fix this by hand" not in the final output, but in the
middle of the script:  look for all patterns that start with "is" and end
in "of", and peel off everything after the "of" into it's own token, before
you distribute.

What makes perl both good and bad was that it was  designed (optimized) for
creating this kind of single-use, throw-away code: to solve some task that
you only had to do once or twice, so that hackery and sloppy quick code is
acceptable, adequate, and especially easy to write.  This is the reason for
some of the cryptic short-hand: its simply less typing, less stuff you have
to type in.  No one else will ever maintain or read or use the code,  so
undocumented cryptic is OK.

--linas

On Sat, Nov 19, 2016 at 12:32 AM, Roman Treutlein <[email protected]>
wrote:

> Linas if i understand your code correctly it would do this.
>
> x1 is a quantity of/is made of chalk from source x2 in form x3.
> => split on X
> ["x1", "is a quantity of/is made of chalk from source" , "x2" , "in form"
> , "x3"]
> => split on / and distribute
> ["x1", "is a quantity of" , "x2" , "in form" , "x3"]
> ["x1", "is made of chalk from source" , "x2" , "in form" , "x3"]
> => join again
> x1 is a quantity of x2 in form x3                         // WRONG should
> be "x1 is a quantity of chalk from source x2 in form x3"
> x1 is mad of chalk from source x2 in form x3
>
> So it's not that easy. Of course, it seems I am going to use something
> like this anyway and then fix the errors by hand.
>
> /roman
>
> On Friday, November 18, 2016 at 6:53:11 PM UTC+1, linas wrote:
>>
>> This is still very easy:  modify the script to split on the x's, instead
>> of splitting on whitespace, and only then split on the slashes.
>>
>> I assume the x's really are the letter x. If the x's are just some
>> strings of random words, then the problem is not really solvable
>> deterministically by any algorithm.
>>
>> --linas
>>
>> On Fri, Nov 18, 2016 at 2:21 AM, Roman Treutlein <[email protected]>
>> wrote:
>>
>>> Maybe I should have given more examples. Because while your script might
>>> work for this example it won't work for this:
>>>
>>> *x1 comes/goes to destination x2 from origin x3 via route x4 using
>>> means/vehicle x5.*
>>>
>>> This would at least have the advantage of the alternatives consisting of
>>> only 1 word, but as in the first example and the following this is not
>>> always the case.
>>>
>>> *x1 is a quantity of/is made of chalk from source x2 in form x3.*
>>>
>>> But I probably will have to use a simple solution like the one you
>>> provided and then just fix everything it gets wrong by hand.
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "opencog" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to [email protected].
>>> To post to this group, send email to [email protected].
>>> Visit this group at https://groups.google.com/group/opencog.
>>> To view this discussion on the web visit https://groups.google.com/d/ms
>>> gid/opencog/8e577a5c-e978-402a-8e90-161e522656a4%40googlegroups.com
>>> <https://groups.google.com/d/msgid/opencog/8e577a5c-e978-402a-8e90-161e522656a4%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"opencog" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/opencog.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/opencog/CAHrUA34xAqBp1mSQ-zMRjytq6kLT3LzyQE_sco7LPjSrpPJmqw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to