Skip to content
Snippets Groups Projects
Commit 431c7279 authored by Aurélien Lamercerie's avatar Aurélien Lamercerie
Browse files

New module: propbank_analyzer

parent 621e1b4d
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/python3.10
# -*-coding:Utf-8 -*
#==============================================================================
# C.M. Tool: prop
#------------------------------------------------------------------------------
# Module to analyze PropBank frames
#==============================================================================
#==============================================================================
# Importing required modules
#==============================================================================
import sys
import glob
#==============================================================================
# Parameters
#==============================================================================
# Input/Output Directories
INPUT_DIR = "../inputData/"
OUTPUT_DIR = "../outputData/"
# Data
PROPBANK_FRAMES_DIR = "../propbankFrames/"
#==============================================================================
# Functions to find the XML description corresponding to a roleset
#==============================================================================
def find_frame_filepath(lemma):
""" Find the Frame XML filepath corresponding to a given lemma
"""
target_file = PROPBANK_FRAMES_DIR + lemma + '.xml'
filepath = glob.glob(target_file, recursive=True)
return filepath
#==============================================================================
# Main function
#==============================================================================
def main(lemma):
# -- Prepare the sentences to be converted
print("\n" + "[CMT] Finding frame")
print("-- lemma: " + lemma)
filepath = find_frame_filepath(lemma)
print(filepath)
# -- Ending print
print("\n" + "[SSC] Done")
if __name__ == "__main__":
main(sys.argv[1])
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment