Files
kdp_generator/__pycache__/csv_reader.cpython-313.pyc
T

46 lines
7.2 KiB
Plaintext
Raw Normal View History

2026-03-24 19:36:04 +02:00
ó
ÀÂiÛã
ó<•SSKrSSKrSSKrSSKJr SSKJr SSKJr \R"\
5r Sr SS1r
SS 1r"S
S \5rS \S
\4SjrS\S
\\4SjrSS\\-S\S\\S
\\4SjjrS\\S
\\\\44SjrS\\S
\\\\44Sjrg)éN)ÚPath)ÚOptional)ÚWordClueéÚwordÚclueÚ
difficultyÚcategorycó•\rSrSrSrSrg)ÚCSVValidationErroréz*Raised when the CSV file fails validation.©N)Ú__name__Ú
__module__Ú __qualname__Ú__firstlineno__Ú__doc__Ú__static_attributes__róÚO/Users/mihai.stefanescu/Projects/personal/crossword-kdp-generator/csv_reader.pyr r s†Ü4rr ÚtextÚreturncó`•[R"SU5nSRSU55$)z9Replace accented characters with their ASCII equivalents.ÚNFKDÚc3ó`# •UH$n[R"U5(aM Uv• M& g7f)N)Ú unicodedataÚ combining)Ú.0Úcs rÚ <genexpr>Ú!_strip_accents.<locals>.<genexpr>sé€ÐCšd˜¬+×*?Ò*?À×*B—1‘1šdùs‚.¥ .)rÚ normalizeÚjoin)rÚnfkds rÚ_strip_accentsr&s)€ä × Ò  ¨Ó .€DØ
�7‰7ÑC™dÓCÓ CÐCrÚrawcóÄ•[UR55R5nURSS5RSS5nUR 5(dgU$)z@Normalize a word to uppercase A-Z only. Returns None if invalid.Ú rÚ-N)r&ÚstripÚupperÚreplaceÚisalpha)r'rs rÚ_normalize_wordr/sK€ä ˜#Ÿ)™)›+Ó &× ,Ñ ,Ó .€DØ �<‰<˜˜RÓ × (Ñ (¨¨bÓ 1€DØ �<‰<�>‰>ØØ €KrÚfilepathÚ min_wordsÚmax_word_lengthc ó•[U5nUR5(d[SU35e[USSS9n[R
"U5nUR c [S5eUR Vs1sH ofR5R5iM" nn[U-
nU(aA[SSR[U55S SR[U5535eS
U;n S U;n
[5n /n S n
[US
S9GHÎupïURSS5R5nURSS5R5nU(aU(d[ R#SU5 U
S-
n
Mq[%U5nUc[ R#SUU5 U
S-
n
M�['U5[(:a#[ R#SUU[(5 U
S-
n
MÓU(a1['U5U:”a"[ R#SUU['U5U5 UU ;a[ R#SUU5 U
S-
n
GM0U R+U5 U (a7URS
S5R5R5=(d SOSnU
(a)URS S5R5=(d SOSnU R-[/UUUUS95 GMÑ SSS5 ['W 5U:a[S['U 5SUS35eW
(a"[ R1SU
['U 55 U $[ R1S['U 5UR25 U $s snf!,(df  N’=f)aÐRead and validate a CSV file of words and clues.
Args:
filepath: Path to the CSV file.
min_words: Minimum number of valid words required.
max_word_length: If set, words longer than this trigger a warning.
Returns:
A deduplicated, validated list of WordClue objects.
Raises: