sinonym 0.2.3__tar.gz → 0.2.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {sinonym-0.2.3 → sinonym-0.2.4}/PKG-INFO +1 -1
- {sinonym-0.2.3 → sinonym-0.2.4}/pyproject.toml +1 -1
- {sinonym-0.2.3 → sinonym-0.2.4}/sinonym/detector.py +9 -0
- {sinonym-0.2.3 → sinonym-0.2.4}/sinonym/services/batch_analysis.py +9 -0
- {sinonym-0.2.3 → sinonym-0.2.4}/.gitignore +0 -0
- {sinonym-0.2.3 → sinonym-0.2.4}/LICENSE +0 -0
- {sinonym-0.2.3 → sinonym-0.2.4}/README.md +0 -0
- {sinonym-0.2.3 → sinonym-0.2.4}/scripts/README.md +0 -0
- {sinonym-0.2.3 → sinonym-0.2.4}/sinonym/__init__.py +0 -0
- {sinonym-0.2.3 → sinonym-0.2.4}/sinonym/chinese_names_data.py +0 -0
- {sinonym-0.2.3 → sinonym-0.2.4}/sinonym/coretypes/__init__.py +0 -0
- {sinonym-0.2.3 → sinonym-0.2.4}/sinonym/coretypes/config.py +0 -0
- {sinonym-0.2.3 → sinonym-0.2.4}/sinonym/coretypes/results.py +0 -0
- {sinonym-0.2.3 → sinonym-0.2.4}/sinonym/data/README.md +0 -0
- {sinonym-0.2.3 → sinonym-0.2.4}/sinonym/data/acl_2025_authors.txt +0 -0
- {sinonym-0.2.3 → sinonym-0.2.4}/sinonym/data/chinese_japanese_classifier.joblib +0 -0
- {sinonym-0.2.3 → sinonym-0.2.4}/sinonym/data/chinese_japanese_classifier.skops +0 -0
- {sinonym-0.2.3 → sinonym-0.2.4}/sinonym/data/familyname_orcid.csv +0 -0
- {sinonym-0.2.3 → sinonym-0.2.4}/sinonym/data/givenname_orcid.csv +0 -0
- {sinonym-0.2.3 → sinonym-0.2.4}/sinonym/data/model_features.json +0 -0
- {sinonym-0.2.3 → sinonym-0.2.4}/sinonym/ml_model_components.py +0 -0
- {sinonym-0.2.3 → sinonym-0.2.4}/sinonym/patterns/__init__.py +0 -0
- {sinonym-0.2.3 → sinonym-0.2.4}/sinonym/patterns/compiled_patterns.py +0 -0
- {sinonym-0.2.3 → sinonym-0.2.4}/sinonym/patterns/regex_builders.py +0 -0
- {sinonym-0.2.3 → sinonym-0.2.4}/sinonym/resources.py +0 -0
- {sinonym-0.2.3 → sinonym-0.2.4}/sinonym/services/__init__.py +0 -0
- {sinonym-0.2.3 → sinonym-0.2.4}/sinonym/services/cache.py +0 -0
- {sinonym-0.2.3 → sinonym-0.2.4}/sinonym/services/ethnicity.py +0 -0
- {sinonym-0.2.3 → sinonym-0.2.4}/sinonym/services/formatting.py +0 -0
- {sinonym-0.2.3 → sinonym-0.2.4}/sinonym/services/initialization.py +0 -0
- {sinonym-0.2.3 → sinonym-0.2.4}/sinonym/services/normalization.py +0 -0
- {sinonym-0.2.3 → sinonym-0.2.4}/sinonym/services/parsing.py +0 -0
- {sinonym-0.2.3 → sinonym-0.2.4}/sinonym/services/process_pool.py +0 -0
- {sinonym-0.2.3 → sinonym-0.2.4}/sinonym/text_processing/__init__.py +0 -0
- {sinonym-0.2.3 → sinonym-0.2.4}/sinonym/text_processing/compound_detector.py +0 -0
- {sinonym-0.2.3 → sinonym-0.2.4}/sinonym/text_processing/text_normalizer.py +0 -0
- {sinonym-0.2.3 → sinonym-0.2.4}/sinonym/text_processing/text_preprocessor.py +0 -0
- {sinonym-0.2.3 → sinonym-0.2.4}/sinonym/utils/__init__.py +0 -0
- {sinonym-0.2.3 → sinonym-0.2.4}/sinonym/utils/string_manipulation.py +0 -0
- {sinonym-0.2.3 → sinonym-0.2.4}/sinonym/utils/thread_cache.py +0 -0
- {sinonym-0.2.3 → sinonym-0.2.4}/tests/_fail_log.py +0 -0
- {sinonym-0.2.3 → sinonym-0.2.4}/tests/conftest.py +0 -0
- {sinonym-0.2.3 → sinonym-0.2.4}/tests/test_acl.py +0 -0
- {sinonym-0.2.3 → sinonym-0.2.4}/tests/test_all_chinese_inputs.py +0 -0
- {sinonym-0.2.3 → sinonym-0.2.4}/tests/test_basic_chinese_names.py +0 -0
- {sinonym-0.2.3 → sinonym-0.2.4}/tests/test_batch.py +0 -0
- {sinonym-0.2.3 → sinonym-0.2.4}/tests/test_compound_names.py +0 -0
- {sinonym-0.2.3 → sinonym-0.2.4}/tests/test_compound_surname_formats.py +0 -0
- {sinonym-0.2.3 → sinonym-0.2.4}/tests/test_middle_names.py +0 -0
- {sinonym-0.2.3 → sinonym-0.2.4}/tests/test_misc.py +0 -0
- {sinonym-0.2.3 → sinonym-0.2.4}/tests/test_mixed_production_cases.py +0 -0
- {sinonym-0.2.3 → sinonym-0.2.4}/tests/test_mixed_scripts.py +0 -0
- {sinonym-0.2.3 → sinonym-0.2.4}/tests/test_ml_japanese_detection.py +0 -0
- {sinonym-0.2.3 → sinonym-0.2.4}/tests/test_multiprocess_pool.py +0 -0
- {sinonym-0.2.3 → sinonym-0.2.4}/tests/test_name_formatting.py +0 -0
- {sinonym-0.2.3 → sinonym-0.2.4}/tests/test_non_chinese_rejection.py +0 -0
- {sinonym-0.2.3 → sinonym-0.2.4}/tests/test_performance.py +0 -0
- {sinonym-0.2.3 → sinonym-0.2.4}/tests/test_regional_variants.py +0 -0
- {sinonym-0.2.3 → sinonym-0.2.4}/tests/test_regression_proposals.py +0 -0
|
@@ -495,6 +495,15 @@ class ChineseNameDetector:
|
|
|
495
495
|
is_surname_first_in_this_order = list(order_tokens[:k]) == surname_tokens
|
|
496
496
|
is_surname_last_in_this_order = list(order_tokens[-k:]) == surname_tokens
|
|
497
497
|
|
|
498
|
+
# Compound surname fallback: surname_tokens may be sub-tokens
|
|
499
|
+
# of a single original token (e.g. ['Ou','yang'] from 'Ouyang')
|
|
500
|
+
if not is_surname_first_in_this_order and not is_surname_last_in_this_order:
|
|
501
|
+
joined_surname = "".join(surname_tokens).lower()
|
|
502
|
+
if order_tokens[0].lower() == joined_surname:
|
|
503
|
+
is_surname_first_in_this_order = True
|
|
504
|
+
elif order_tokens[-1].lower() == joined_surname:
|
|
505
|
+
is_surname_last_in_this_order = True
|
|
506
|
+
|
|
498
507
|
if used_original:
|
|
499
508
|
original_is_given_first = is_surname_last_in_this_order
|
|
500
509
|
else:
|
|
@@ -253,6 +253,15 @@ class BatchAnalysisService:
|
|
|
253
253
|
if surname_tokens[-1] == original_tokens[-1]:
|
|
254
254
|
return NameFormat.GIVEN_FIRST
|
|
255
255
|
|
|
256
|
+
# Compound surname: surname_tokens may be sub-tokens of a single
|
|
257
|
+
# original token (e.g. ['Ou','yang'] from 'Ouyang').
|
|
258
|
+
# Reconstruct and check against original tokens.
|
|
259
|
+
joined_surname = "".join(surname_tokens).lower()
|
|
260
|
+
if original_tokens[0].lower() == joined_surname:
|
|
261
|
+
return NameFormat.SURNAME_FIRST
|
|
262
|
+
if original_tokens[-1].lower() == joined_surname:
|
|
263
|
+
return NameFormat.GIVEN_FIRST
|
|
264
|
+
|
|
256
265
|
# Default to surname-first for unclear cases
|
|
257
266
|
return NameFormat.SURNAME_FIRST
|
|
258
267
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|