Skip to content

Commit 26db1fa

Browse files
committed
0.3
Stdin Version
1 parent df75fe9 commit 26db1fa

File tree

3 files changed

+26
-1
lines changed

3 files changed

+26
-1
lines changed

CHANGELOG

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Yoficator
2+
https://github.com/zvezdochiot/python-yoficator
3+
4+
0.3
5+
6+
Stdin Version
7+
8+
0.2
9+
10+
WordForm Version
11+
12+
0.1
13+
14+
Simplify Version

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ Or just use it with a file or string:
2323
```bash
2424
yoficator.py russianfile.txt # prints to STDOUT
2525
yoficator.py russianfile.txt > russianfile-yoficated.txt
26+
zcat russianfile.txt.gz | yoficator.py - # input 0f STDIN
27+
zcat russianfile.txt.gz | yoficator.py - | gzip > russianfile-yoficated.txt.gz
2628
yoficator.py "Где ее книга?"
2729
```
2830

@@ -31,3 +33,7 @@ yoficator.py "Где ее книга?"
3133
* Prone to wrongly yoficate other Cyrillic-based languages, such as Bulgarian, Ukrainian, Belarussian.
3234
* It's not the fastest thing in the world, mind you. But does the job.
3335

36+
---
37+
2018
38+
zvezdochiot
39+
https://github.com/zvezdochiot/python-yoficator

yoficator.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,12 @@
8080
text = codecs.open(sys.argv[1].decode("utf-8"), "r", "utf-8").read()
8181
# Else we will assume it's a string
8282
else:
83-
text = sys.argv[1].decode("utf-8")
83+
if sys.argv[1] == "-":
84+
text = ""
85+
for line in sys.stdin:
86+
text = text + line.decode("utf-8")
87+
else:
88+
text = sys.argv[1].decode("utf-8")
8489
else:
8590
# We will assume using textFile as input filename above
8691
text = "(Tests the parsing)\nAmbiguous, stays е: все\nUnambiguous, changes: щетка, произнес, еще, ее\n"

0 commit comments

Comments
 (0)