Alignment¶
bcql_py.models.alignment
¶
Alignment queries use the ==> operator to find cross-field alignments
between versions of a parallel corpus (e.g. English -> Dutch).
Similar to models/relation but with different operators and semantics.
AlignmentOperator
¶
Bases: BCQLNode
The operator in an alignment query: =type=>field or ==>field?.
See https://github.com/instituutnederlandsetaal/BlackLab/blob/dev/site/docs/guide/040_query-language/030_parallel.md
Attributes:
| Name | Type | Description |
|---|---|---|
target_field |
str
|
The target field name (e.g. |
optional |
bool
|
|
relation_type |
str | None
|
Optional type filter (e.g. |
capture_name |
str | None
|
Override for the capture group name (default |
to_bcql
¶
Return this alignment operator in BCQL syntax.
View source on GitHub: src/bcql_py/models/alignment.py lines 47–52
AlignmentConstraint
¶
Bases: BCQLNode
One alignment constraint: operator target
Multiple alignment constraints are separated by ;.
Attributes:
| Name | Type | Description |
|---|---|---|
operator |
AlignmentOperator
|
The AlignmentOperator. |
target |
BCQLNodeUnion
|
The target sub-query. |
to_bcql
¶
Return this alignment constraint in BCQL syntax.
View source on GitHub: src/bcql_py/models/alignment.py lines 69–71
AlignmentNode
¶
Bases: BCQLNode
A parallel alignment query: source ==>field target [; ==>field target]*.
Attributes:
source: The source query in the primary field
alignments: One or more alignment constraints.
to_bcql
¶
Return this alignment query in BCQL syntax.
View source on GitHub: src/bcql_py/models/alignment.py lines 87–93