Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

# search operator for features #3

Closed
camilstaps opened this issue Oct 19, 2017 · 4 comments
Closed

# search operator for features #3

camilstaps opened this issue Oct 19, 2017 · 4 comments
Projects

Comments

@camilstaps
Copy link
Contributor

Is it possible to extend the search template language to allow # for features?

For example, I want to find sentences where אמר is followed by some ל+infinitive construct, but want to exclude the infinitive construct of אמר. I would then like to use the query below (or is there an easier way to do this with the current search template syntax?):

sentence
    clause
        word lex=>MR[
    < clause
        word lex=L
        <: word vt=infc lex#>MR[
@codykingham
Copy link
Contributor

codykingham commented Oct 19, 2017

I second the need for a != operator in TF search.

@dirkroorda
Copy link
Member

There are now new possibilities:

  • nodetype feature : feature is present and not None
  • nodetype feature! : feature is not present or None
  • nodetype feature>val : feature has value greater than val (numerical features only)
  • nodetype feature<val : feature has value less than val (numerical features only)
  • nodetype feature~regexp : feature matches regular expression (string features only)

So: word vt=infc lex~(?!^>MR[)

@dirkroorda
Copy link
Member

Actually, this was an embarrasingly good suggestion. Regular expressions are nice, but clumsy when you just want to use them for the non-equality of values. So I have implemented the # after all. And saying word vt# means: feature vt has no value for word.

It will be included in the next release.

@dirkroorda dirkroorda reopened this May 30, 2018
@camilstaps
Copy link
Contributor Author

Excellent, thanks!

@dirkroorda dirkroorda added this to Done in evolution Dec 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
evolution
  
Done
Development

No branches or pull requests

3 participants