mirror of
https://github.com/rsennrich/subword-nmt.git
synced 2024-11-27 02:53:55 +03:00
14 lines
288 B
Python
Executable File
14 lines
288 B
Python
Executable File
#! /usr/bin/env python
|
|
from __future__ import print_function
|
|
import sys
|
|
from collections import Counter
|
|
|
|
c = Counter()
|
|
|
|
for line in sys.stdin:
|
|
for word in line.split():
|
|
c[word] += 1
|
|
|
|
for key,f in sorted(c.items(), key=lambda x: x[1], reverse=True):
|
|
print(key+" "+ str(f))
|