Comments (6)
You are correct that this is not yet possible. And also that the error message is not very helpful.
That said, the docs indicate that there are restrictions in the use of names of quantifiers:
https://annotation.github.io/text-fabric/about/searchusage.html#restrictions
But these restrictions are stated in difficult language.
A bit later the reasons why are explained: https://annotation.github.io/text-fabric/about/searchusage.html#implementation
from text-fabric.
It is a pity that the kind of query that you give here as an example is not supported by Text-Fabric.
It would make the query language much more expressive.
Unfortunately, I do not know at the moment how to implement that in full generality, and then the challenge is to implement it efficiently as well.
from text-fabric.
However, you could also remove the /with/ and /-/ from your query.
In this case you get what you want.
Indeed, there are other cases where what you point out here is a real limitation.
from text-fabric.
You are correct that this is not yet possible. And also that the error message is not very helpful.
That said, the docs indicate that there are restrictions in the use of names of quantifiers:
https://annotation.github.io/text-fabric/about/searchusage.html#restrictions
But these restrictions are stated in difficult language.
A bit later the reasons why are explained: https://annotation.github.io/text-fabric/about/searchusage.html#implementation
from text-fabric.
Ok. It seems that TF has the same limitations as MQL's "UnorderedGroup" it is also not possible to use the "AS" operator for elements within "UnorderedGroup".
And yes, I am aware that I could have written the query without /where/ - /-/
but sometimes it is necessary to use this if there are other object types involved whose relation to each other need to be defined.
from text-fabric.
For those cases, you could run a relaxed query and then filter out the unwanted results by a snippet of Python code, e.g.
results = [r for r in A.search(relaxedQuery) if r[3] == r[5]]
In TF queries are a way to circumvent a lot of Python programming, but it is not the exclusive way to get at your data, as in SQL or MySQL.
There is a balancing act between wrestling with the query language and hand-coding.
from text-fabric.
Related Issues (20)
- Feature comparison for TF-Query HOT 7
- Non-matching template lines HOT 3
- Comments starting after whitespace HOT 1
- Update Software Heritage badge HOT 1
- Add option to manually upload new features HOT 5
- Over-Zealous TF Rate Limit Warning HOT 7
- feature request: plain text show HOT 3
- Better economy with GitHub API requests HOT 2
- bug in defining relations between elements HOT 12
- bug in Recorder.read() HOT 2
- Use of Python 3.8 method breaks backwards compatibility by using removeprefix() HOT 7
- Bug in fabric.py when trying to load Tischendorf text HOT 4
- Bug in loading text-fabric 9.0 HOT 4
- bug with the relational operators `<` and `>` when doing feature comparisons `.f<g.` or `.f>g.` HOT 1
- No more app-xxx repositories HOT 4
- EOF error when loading app with Python 3.11 HOT 2
- Undeclared dependency on pandas HOT 3
- internal server error in NER browser when deleting an annotation set HOT 2
- Issue with api HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from text-fabric.