mirror of
https://github.com/explosion/spaCy.git
synced 2025-06-04 05:03:06 +03:00
encoding UTF8
This commit is contained in:
parent
3fa30a7f2d
commit
64d90039a1
|
@ -114,6 +114,6 @@ def project_document(
|
||||||
content = f"{before}{content}{after}"
|
content = f"{before}{content}{after}"
|
||||||
else:
|
else:
|
||||||
msg.warn("Replacing existing file")
|
msg.warn("Replacing existing file")
|
||||||
with output_file.open("w") as f:
|
with output_file.open("w", encoding="utf8") as f:
|
||||||
f.write(content)
|
f.write(content)
|
||||||
msg.good("Saved project documentation", output_file)
|
msg.good("Saved project documentation", output_file)
|
||||||
|
|
|
@ -700,7 +700,7 @@ from pathlib import Path
|
||||||
@spacy.registry.loggers("my_custom_logger.v1")
|
@spacy.registry.loggers("my_custom_logger.v1")
|
||||||
def custom_logger(log_path):
|
def custom_logger(log_path):
|
||||||
def setup_logger(nlp: "Language") -> Tuple[Callable, Callable]:
|
def setup_logger(nlp: "Language") -> Tuple[Callable, Callable]:
|
||||||
with Path(log_path).open("w") as file_:
|
with Path(log_path).open("w", encoding="utf8") as file_:
|
||||||
file_.write("step\\t")
|
file_.write("step\\t")
|
||||||
file_.write("score\\t")
|
file_.write("score\\t")
|
||||||
for pipe in nlp.pipe_names:
|
for pipe in nlp.pipe_names:
|
||||||
|
|
|
@ -1256,7 +1256,7 @@ def main(template_path, output=None, data_path=None):
|
||||||
data_str = f"export const DATA = {data}"
|
data_str = f"export const DATA = {data}"
|
||||||
result = compiler.get_output()
|
result = compiler.get_output()
|
||||||
if output is not None:
|
if output is not None:
|
||||||
with output.open("w") as f:
|
with output.open("w", encoding="utf8") as f:
|
||||||
f.write(f"{header}\n{result}\n{data_str}")
|
f.write(f"{header}\n{result}\n{data_str}")
|
||||||
print(f"Updated {output.parts[-1]}")
|
print(f"Updated {output.parts[-1]}")
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user