🗝 KeyzHub
19Keys · community archive
4600 bytes raw
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
from aave_compress.rules import (
    MARKERS,
    completive_done,
    continuative_steady,
    habitual_be,
    prospective_finna,
    zero_copula,
)


def test_markers_registry():
    assert set(MARKERS) == {
        "zero_copula",
        "habitual_be",
        "completive_done",
        "prospective_finna",
        "continuative_steady",
    }
    assert MARKERS["zero_copula"] is zero_copula


def test_zero_copula_adjective_predicate():
    assert zero_copula("He is tired") == "He tired"


def test_zero_copula_verbing_predicate():
    assert zero_copula("She is working") == "She working"


def test_zero_copula_adjective_after_article_subject():
    assert zero_copula("The server is down") == "The server down"


def test_zero_copula_locative_predicate():
    assert zero_copula("They are here") == "They here"


def test_zero_copula_gonna():
    assert zero_copula("He is gonna crash") == "He gonna crash"


def test_zero_copula_sentence_final_unchanged():
    assert zero_copula("I don't know where he is") == "I don't know where he is"


def test_zero_copula_noun_phrase_predicate_unchanged():
    assert zero_copula("He is a doctor") == "He is a doctor"


def test_zero_copula_question_inversion_unchanged():
    assert zero_copula("Is he tired?") == "Is he tired?"


def test_zero_copula_equative_gerund_unchanged():
    assert zero_copula("The goal is finding bugs") == "The goal is finding bugs"


def test_habitual_be_third_person():
    assert (
        habitual_be("This endpoint usually times out when traffic is high")
        == "This endpoint be timin out when traffic is high"
    )


def test_habitual_be_typically():
    assert habitual_be("She typically works late") == "She be workin late"


def test_habitual_be_often():
    assert (
        habitual_be("The build often fails on Mondays")
        == "The build be failin on Mondays"
    )


def test_habitual_be_no_adverb_unchanged():
    assert habitual_be("He is working right now") == "He is working right now"


def test_habitual_be_copula_before_adverb_unchanged():
    assert habitual_be("He is usually tired") == "He is usually tired"


def test_completive_done_finished_gerund():
    assert (
        completive_done("I have already finished testing the auth flow")
        == "I done tested the auth flow"
    )


def test_completive_done_irregular_ambiguous():
    assert completive_done("She has already left") == "She done left"


def test_completive_done_regular_participle():
    assert (
        completive_done("They had already deployed the fix")
        == "They done deployed the fix"
    )


def test_completive_done_simple_past_unchanged():
    assert completive_done("I finished testing") == "I finished testing"


def test_completive_done_been_unchanged():
    assert (
        completive_done("You have already been notified")
        == "You have already been notified"
    )


def test_prospective_finna_first_person():
    assert (
        prospective_finna("I am about to deploy this to production")
        == "I'm finna deploy this to production"
    )


def test_prospective_finna_third_person():
    assert prospective_finna("He is about to leave") == "He finna leave"


def test_prospective_finna_getting_ready_to():
    assert (
        prospective_finna("They are getting ready to migrate the database")
        == "They finna migrate the database"
    )


def test_prospective_finna_going_to_verb():
    assert (
        prospective_finna("We are going to refactor this module")
        == "We finna refactor this module"
    )


def test_prospective_finna_plain_present_unchanged():
    assert prospective_finna("I deploy code every day") == "I deploy code every day"


def test_prospective_finna_going_to_noun_unchanged():
    assert (
        prospective_finna("She is going to the store")
        == "She is going to the store"
    )


def test_continuative_steady_combined_adverbs():
    assert (
        continuative_steady(
            "The API is constantly and persistently timing out under load"
        )
        == "The API steady timin out under load"
    )


def test_continuative_steady_single_adverb():
    assert (
        continuative_steady("He is constantly complaining about the linter")
        == "He steady complainin about the linter"
    )


def test_continuative_steady_plural():
    assert (
        continuative_steady("They are continuously refreshing the page")
        == "They steady refreshin the page"
    )


def test_continuative_steady_no_adverb_unchanged():
    assert continuative_steady("The API is timing out") == "The API is timing out"