Created
September 19, 2017 14:18
-
-
Save minhlab/d5e514472c03a60c5b0a21188509050d to your computer and use it in GitHub Desktop.
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 | |
num_sg = 0 | |
num_files = 0 | |
for root, _, fnames in os.walk('.'): | |
for fname in fnames: | |
if '.parse' in fname: | |
with open(os.path.join(root, fname)) as f: | |
s = f.read() | |
num_sg += len(re.findall(r'\(\s*SG\b', s)) | |
num_files += 1 | |
print('Examined %d files' %num_files) | |
print('Found %d instances of SG' %num_sg) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
On OntoNotes: