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

Removing words starting with 0 #20

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/pylangacq/_clean_utterance.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
re.compile(r"\[>\d?\]"),
re.compile(r"\((\d+?:)?\d+?\.?\d*?\)"),
re.compile(r"\[%act: [^\[]+?\]"),
re.compile(r"\b0\w+"),
)

_REGEX_REPLACE = (
Expand Down Expand Up @@ -284,3 +285,6 @@ def _clean_utterance(utterance: str) -> str:
new_words.append(word)

return " ".join(new_words).strip()


print(_clean_utterance("I 0am done."))
1 change: 1 addition & 0 deletions tests/test__clean_utterance.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
("⌈ foo bar ⌉", "foo bar"), # overlapping markers
("foo.", "foo ."),
("+...", "+..."),
("I 0am done.", "I done ."), # CHILDES -> Biling -> Perez -> Shelia
],
)
def test__clean_utterance(original, expected):
Expand Down