Hi Linas,

Okay, I started adding the StarNode variable, but I have a question. So 
StarNode should work exactly like GlobNode except that it can accept a 
zero, right? What about something that will match zero or more but not 
necessarily in order? For example to match all the nodes in the pattern, 
and throw all the unmatched nodes (in any location) on that level in the 
target side to this variable. It's kind of "AllUnmatchedStuffNode" (for 
lacking a better name).

On Saturday, 29 October 2016 02:11:28 UTC+9, linas wrote:
>
> Hi Tareq,
>
> Currently, the only way to do this is is to write two different patterns, 
> one that searches for three words, and one that searches for two.
>
> Another possibility is to use a GlobNode instead of a VariableNode, this 
> will accept sequences of neighboring words, as one.  However, this might 
> not be what you want: the output of a glob is a list.
>
> You do ask an interesting question: it would be nice to have this kind of 
> matching.  Currently, VariableNode must match exactly one item, and 
> GlobNode must match one or more.   A "MaybeNode" that matches zero or one, 
> and a "StarNode" that matches zero or more could be useful.  .. But these 
> don't exist, yet.  Might not be hard to add ... 
>
> --linas
>
>
>
> On Fri, Oct 28, 2016 at 2:47 AM, Tareq Alkhaldi <[email protected] 
> <javascript:>> wrote:
>
>> Hi all,
>>
>> Is there a way to use the PM to match a partial list as the following?
>>
>> Atomspace has this:
>>
>> (EvaluationLink
>>     (PredicateNode "pulled@463a5d30-1733-48bc-b188-cb1fcd1d3ee0")
>>     (ListLink
>>         (ConceptNode "James@c597a7ec-60ab-429d-b003-4782200c7a91")
>>         (ConceptNode "pudding@f797c773-b58a-4136-8bad-74b4ad399c63")
>>         (ConceptNode "all@3f71ac77-ef99-4499-883d-2ae3332fdb6a")  ;;;;; 
>> This may or may not exist
>>     )
>> )
>>
>> Pattern I want to match is:
>>
>> (BindLink
>>   (VariableList
>>      (VariableNode "$X")
>>      (VariableNode "$Y")
>>   )
>>
>>   (EvaluationLink
>>      (VariableNode "$X")
>>      (ListLink
>>         (ConceptNode "James@6c0671a2-1b11-4dd9-a787-d27d7779a0c8")
>>         (VariableNode "$Y")
>>      )
>>   )
>>   (VariableNode "$Y")
>> )
>>
>> How can I match that without having to add another variable after "$Y" in 
>> the list, knowing that the (ConceptNode "all@...") may not always be there.
>>
>> Can this be done?
>>
>> Thanks
>>
>> -- 
>> 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] <javascript:>.
>> To post to this group, send email to [email protected] 
>> <javascript:>.
>> 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/764c3a00-c443-46ed-9d05-7aa11ddb4cb8%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/opencog/764c3a00-c443-46ed-9d05-7aa11ddb4cb8%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/1348cacd-a75b-4094-b31e-54a273c9e149%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to