Skip to content

Commit

Permalink
Improve formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
insolor committed Aug 4, 2024
1 parent 7c93b14 commit d400042
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions src/py_classes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ pub struct PyParsedWord {
impl PyParsedWord {
fn __repr__(&self) -> PyResult<String> {
Ok(format!(
"ParsedWord(word=\"{}\", tags=[{}], normal_form=\"{}\", method={:?})",
"ParsedWord(word={:?}, tags=[{}], normal_form={:?}, method={:?})",
self.word,
self.tags.join(", "),
self.tags.iter().map(|tag| format!("{:?}", tag)).collect::<Vec<String>>().join(", "),
self.normal_form,
self.method
))
Expand All @@ -85,9 +85,9 @@ pub struct PyInflectWord {
impl PyInflectWord {
fn __repr__(&self) -> PyResult<String> {
Ok(format!(
"InflectWord(word=\"{}\", tags=[{}], method={:?})",
"InflectWord(word={:?}, tags=[{}], method={:?})",
self.word,
self.tags.join(", "),
self.tags.iter().map(|tag| format!("{:?}", tag)).collect::<Vec<String>>().join(", "),
self.method
))
}
Expand Down
14 changes: 7 additions & 7 deletions test.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,12 @@
{
"data": {
"text/plain": [
"[ParsedWord(word=\"стали\", tags=[NOUN, inan, nomn, femn, plur], normal_form=\"сталь\", method=\"Dictionary\"),\n",
" ParsedWord(word=\"стали\", tags=[NOUN, inan, gent, femn, sing], normal_form=\"сталь\", method=\"Dictionary\"),\n",
" ParsedWord(word=\"стали\", tags=[NOUN, inan, datv, femn, sing], normal_form=\"сталь\", method=\"Dictionary\"),\n",
" ParsedWord(word=\"стали\", tags=[NOUN, inan, accs, femn, plur], normal_form=\"сталь\", method=\"Dictionary\"),\n",
" ParsedWord(word=\"стали\", tags=[NOUN, inan, loct, femn, sing], normal_form=\"сталь\", method=\"Dictionary\"),\n",
" ParsedWord(word=\"стали\", tags=[VERB, perf, indc, plur, intr, past], normal_form=\"стать\", method=\"Dictionary\")]"
"[ParsedWord(word=\"стали\", tags=[\"NOUN\", \"inan\", \"nomn\", \"femn\", \"plur\"], normal_form=\"сталь\", method=\"Dictionary\"),\n",
" ParsedWord(word=\"стали\", tags=[\"NOUN\", \"inan\", \"gent\", \"femn\", \"sing\"], normal_form=\"сталь\", method=\"Dictionary\"),\n",
" ParsedWord(word=\"стали\", tags=[\"NOUN\", \"inan\", \"datv\", \"femn\", \"sing\"], normal_form=\"сталь\", method=\"Dictionary\"),\n",
" ParsedWord(word=\"стали\", tags=[\"NOUN\", \"inan\", \"accs\", \"femn\", \"plur\"], normal_form=\"сталь\", method=\"Dictionary\"),\n",
" ParsedWord(word=\"стали\", tags=[\"NOUN\", \"inan\", \"loct\", \"femn\", \"sing\"], normal_form=\"сталь\", method=\"Dictionary\"),\n",
" ParsedWord(word=\"стали\", tags=[\"VERB\", \"perf\", \"indc\", \"plur\", \"intr\", \"past\"], normal_form=\"стать\", method=\"Dictionary\")]"
]
},
"execution_count": 3,
Expand All @@ -90,7 +90,7 @@
{
"data": {
"text/plain": [
"[InflectWord(word=\"стали\", tags=[NOUN, inan, nomn, femn, plur], method=\"Dictionary\")]"
"[InflectWord(word=\"стали\", tags=[\"NOUN\", \"inan\", \"nomn\", \"femn\", \"plur\"], method=\"Dictionary\")]"
]
},
"execution_count": 4,
Expand Down

0 comments on commit d400042

Please sign in to comment.