diff --git a/lib/propbank_analyzer.py b/lib/propbank_analyzer.py new file mode 100644 index 0000000000000000000000000000000000000000..0d5ae2388a28542a592c76d7c87b00d75d39b2f2 --- /dev/null +++ b/lib/propbank_analyzer.py @@ -0,0 +1,72 @@ +#!/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]) + + + + +