Adjust __main__ to print term_category - wr - Translate a term via WordReference.com
(HTM) hg clone https://bitbucket.org/iamleot/wr
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
---
(DIR) changeset 3f94da648b75be39ecc885832ab4267e7c8ecf23
(DIR) parent 395bf3c1b7d4906b8b127e201dde50a8a65aabe0
(HTM) Author: Leonardo Taccari <iamleot@gmail.com>
Date: Thu, 21 Nov 2019 16:54:43
Adjust __main__ to print term_category
Patch from Rocky Hotas, thanks!
Diffstat:
wr.py | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
---
diff -r 395bf3c1b7d4 -r 3f94da648b75 wr.py
--- a/wr.py Thu Nov 21 16:43:53 2019 +0100
+++ b/wr.py Thu Nov 21 16:54:43 2019 +0100
@@ -221,7 +221,14 @@
dictionary = sys.argv[1]
term = sys.argv[2]
+ pcat = ''
for i, t in enumerate(translate(dictionary, term)):
if i > 0:
print()
+ if t.term_category != pcat:
+ pcat = t.term_category
+ if i > 0:
+ print()
+ print(pcat)
+ print()
print_term(t)