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

Add full_orth function #565

Merged
merged 4 commits into from
Dec 18, 2024
Merged

Add full_orth function #565

merged 4 commits into from
Dec 18, 2024

Conversation

Icemole
Copy link
Collaborator

@Icemole Icemole commented Dec 10, 2024

Function to get the full orthographhy from the segment.

This function should be used from now on instead of accessing orth directly. We can also name the function orth() to minimize the impact of the change.

Function to get the full orth from the segment, to be used from now on instead of accessing orth directly
@Icemole Icemole requested review from curufinwe, albertz and michelwi and removed request for curufinwe and albertz December 10, 2024 08:19
@Icemole
Copy link
Collaborator Author

Icemole commented Dec 10, 2024

Question: should we add this as a property of orth instead? But then we'd have to create a self._orth variable, which implies also doing some kind of setter:

@property
def orth(self):
    # Same as current full_orth()

@orth.setter
def orth(self, text):
    self._orth = text

But then this would be super misleading:

s = Segment()
s.left_context_orth = "Hello"
s.orth = "world"
print(s.orth)  # 'Hello world', instead of the potentially expected 'world'.

lib/corpus.py Outdated Show resolved Hide resolved
lib/corpus.py Outdated Show resolved Hide resolved
Co-authored-by: Albert Zeyer <[email protected]>
@albertz
Copy link
Member

albertz commented Dec 10, 2024

Question: should we add this as a property of orth instead?

No.

@michelwi
Copy link
Contributor

Question: should we add this as a property of orth instead?

No.. as you already noticed this would be a terrible interface.

Also all Jobs that interact with the lib would need special logic to handle the optionality of the *_context_orth.

@Icemole Icemole merged commit 75d0bc2 into main Dec 18, 2024
4 checks passed
@Icemole Icemole deleted the use-orth-function branch December 18, 2024 08:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants