You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+13Lines changed: 13 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -160,6 +160,19 @@ jupyter notebook examples/
160
160
161
161
See [`examples/README.md`](examples/README.md) for more details.
162
162
163
+
## Experimental features
164
+
165
+
**String-based search** (`hed.models.string_search` and `hed.models.schema_lookup`) is a middle-ground search facility that operates on raw HED strings without requiring pre-parsed `HedString` objects or a loaded schema. It supports the full `QueryHandler` query syntax (logical operators, grouping, wildcards) and optionally accepts a pre-generated schema lookup dictionary to enable ancestor-aware matching on short-form strings.
166
+
167
+
> **This facility is still experimental.** Its API — including class names, function signatures, and module structure — may change in future releases without notice. These modules are **not** exported from the top-level `hed` package; import them directly:
See the [search details documentation](https://www.hedtags.org/hed-python/search_details.html) for a full comparison of all three search implementations and performance benchmarks.
Located in {mod}`hed.models.string_search`, `StringQueryHandler` is a new middle-ground implementation that inherits from `QueryHandler` and reuses the full expression-tree compiler, but operates on raw strings rather than pre-parsed `HedString` objects.
56
+
```{warning}
57
+
This facility is **experimental**. The API of `hed.models.string_search` and
58
+
`hed.models.schema_lookup` may change in future releases without notice.
59
+
These modules are **not** part of the stable public interface exported from
60
+
the top-level `hed` package. Import directly from the sub-modules.
61
+
```
62
+
63
+
Located in {mod}`hed.models.string_search`, `StringQueryHandler` is a middle-ground implementation that inherits from `QueryHandler` and reuses the full expression-tree compiler, but operates on raw strings rather than pre-parsed `HedString` objects.
57
64
58
65
It parses each raw HED string into a lightweight {class}`~hed.models.string_search.StringNode` tree that duck-types the `HedGroup`/`HedTag` interfaces expected by the existing expression evaluators — so all `QueryHandler` query syntax works unchanged.
59
66
@@ -71,11 +78,16 @@ Use `StringQueryHandler` when you have raw strings (not `HedString` objects), ne
71
78
72
79
#### Generating a schema lookup
73
80
81
+
```{note}
82
+
`hed.models.schema_lookup` is part of the experimental string-search facility.
83
+
Its interface may change in future releases.
84
+
```
85
+
74
86
If you want `StringQueryHandler` to resolve ancestors for short-form strings (e.g. query `Event` matching `Sensory-event`) without a full schema parse per row, you can pre-generate a lookup dictionary from a `HedSchema`:
75
87
76
88
```python
77
89
from hed import load_schema_version
78
-
from hed import generate_schema_lookup, save_schema_lookup, load_schema_lookup
90
+
from hed.models.schema_lookupimport generate_schema_lookup, save_schema_lookup, load_schema_lookup
0 commit comments