Created
December 9, 2016 13:36
-
-
Save minhlab/0379f030176e85f747c1d2f6e1232932 to your computer and use it in GitHub Desktop.
Print some statistics of ECB+ (Cybulska and Vossen, 2014)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import re | |
count = 0 | |
for root, dir_names, file_names in os.walk('ECB+'): | |
for fname in file_names: | |
if 'plus' in fname: | |
path = os.path.join(root, fname) | |
with open(path) as f: | |
content = f.read() | |
print list(m.group() for m in re.finditer('<token', content)) | |
count += sum(1 for _ in re.finditer('<token', content)) | |
# print path | |
print count |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment