Skip to content

Commit ee5392e

Browse files
committed
6.0.0
1 parent e02940f commit ee5392e

File tree

5 files changed

+10
-19
lines changed

5 files changed

+10
-19
lines changed

Diff for: .github/workflows/test_macos.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ jobs:
1313
with:
1414
python-version: 3.10.11
1515

16-
- name: Install pytest
17-
run: |
18-
python3 -m pip install pytest
1916
- name: Install kss locally
2017
run: |
2118
pip3 install -e .
19+
- name: Install pytest
20+
run: |
21+
python3 -m pip install pytest
2222
- name: Run the test suite
2323
run: |
2424
cd tests && pytest -v

Diff for: .github/workflows/test_ubuntu.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ jobs:
1313
with:
1414
python-version: 3.10.11
1515

16-
- name: Install pytest
17-
run: |
18-
python3 -m pip install pytest
1916
- name: Install kss locally
2017
run: |
2118
pip3 install -e .
19+
- name: Install pytest
20+
run: |
21+
python3 -m pip install pytest
2222
- name: Run the test suite
2323
run: |
2424
cd tests && pytest -v

Diff for: .github/workflows/test_windows.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ jobs:
1313
with:
1414
python-version: 3.10.11
1515

16-
- name: Install pytest
17-
run: |
18-
python3 -m pip install pytest
1916
- name: Install kss locally
2017
run: |
2118
pip3 install -e .
19+
- name: Install pytest
20+
run: |
21+
python3 -m pip install pytest
2222
- name: Run the test suite
2323
run: |
2424
cd tests && pytest -v

Diff for: kss/_modules/augmentation/augment.py

-8
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
from functools import partial
22
from typing import Union, List, Tuple
33

4-
from kss._modules.spacing.correct_spacing import correct_spacing
54
from kss._modules.augmentation.replacement import SynonymReplacement
65
from kss._modules.augmentation.utils import correct_josa
76
from kss._utils.logger import highlight_diffs, logger
@@ -12,7 +11,6 @@
1211
def augment(
1312
text: Union[str, List[str], Tuple[str]],
1413
replacement_ratio: float = 0.3,
15-
space_normalization: bool = True,
1614
josa_normalization: bool = True,
1715
num_workers: Union[int, str] = "auto",
1816
backend: str = "auto",
@@ -48,7 +46,6 @@ def augment(
4846
return text
4947

5048
replacement_ratio = _check_type(replacement_ratio, "replacement_ratio", float)
51-
space_normalization = _check_type(space_normalization, "space_normalization", bool)
5249
josa_normalization = _check_type(josa_normalization, "josa_normalization", bool)
5350
verbose = _check_type(verbose, "verbose", bool)
5451
num_workers = _check_num_workers(text, num_workers)
@@ -65,7 +62,6 @@ def augment(
6562
func=partial(
6663
_augment,
6764
replacement_ratio=replacement_ratio,
68-
space_normalization=space_normalization,
6965
josa_normalization=josa_normalization,
7066
backend=backend,
7167
verbose=verbose,
@@ -78,7 +74,6 @@ def augment(
7874
def _augment(
7975
text: str,
8076
replacement_ratio: float = 0.3,
81-
space_normalization: bool = True,
8277
josa_normalization: bool = True,
8378
backend: str = "auto",
8479
verbose: bool = False,
@@ -90,9 +85,6 @@ def _augment(
9085
if josa_normalization:
9186
text = correct_josa(text)
9287

93-
if space_normalization:
94-
text = correct_spacing(text)
95-
9688
if verbose:
9789
print()
9890
print(highlight_diffs(orig_text, text).replace("\n", "\\n"))

Diff for: tests/test_augmentation.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ def test_augment():
55
augment = Kss("augment")
66
input_text = """앞서 지난해 11월, 보이저 1호는 명령을 수신하고 수행하는 데엔 문제가 없었지만 통신 장치에 문제가 생겨 과학·엔지니어링 데이터가 지구로 전송되지 않았던 바 있다. 당시 그들은 컴퓨터 시스템을 재시작하고 문제의 근본적인 원인을 파악하기 위해 명령을 보내려고 시도했고, 이달 1일 '포크'라는 명령을 보냈다."""
77
output = augment(input_text)
8-
assert output == """앞서 지난해 11월, 보이저 1호는 명령을 수신하고 시행하는 데엔 문제가 없었지만 송신 장비에 문제가 생겨 과학·엔지니어링 데이터가 지구로 전송되지 않았던 바 있다. 당시 그들은 컴퓨터 시스템을 재시작하고 문제의 근본적인 원인을 파악하기 위해 명령을 보내려고 시도했고, 이달 1일'포크'라는 명령을 보냈다."""
9-
8+
assert output == "앞서 지난해 11월, 보이저 1호는 명령을 수신하고 시행하는 데엔 문제가 없었지만 송신 장비에 문제가 생겨 과학·엔지니어링 데이터가 지구로 전송되지 않았던 바 있다. 당시 그들은 컴퓨터 시스템을 재시작하고 문제의 근본적인 원인을 파악하기 위해 명령을 보내려고 시도했고, 이달 1일 '포크'라는 명령을 보냈다."
109

1110
if __name__ == '__main__':
1211
test_augment()

0 commit comments

Comments
 (0)