diff --git a/README.rst b/README.rst index 0289221..86b434a 100644 --- a/README.rst +++ b/README.rst @@ -125,6 +125,10 @@ Good luck! **reference** http://www.nactem.ac.uk/tsujii/GENIA/tagger/ + You must edit the file "$CLINER_DIR/config.txt" and change the line saying "GENIA None" to "GENIA ". + + This command will do that: sed -i ``sed -i 's|GENIA.*|GENIA '/geniatagger'|g' $CLINER_DIR/config.txt`` + (3) UMLS tables @@ -174,7 +178,9 @@ These are resources that require login credentials to access secure data, so we **Put these tables in the $CLINER_DIR/umls_tables directory.** - In order to tell CliNER that the tables are there, you must edit the file "$CLINER_DIR/config.txt" and change the line saying "UMLS None" to "UMLS ". This command will do that ``sed -i "s/UMLS None/UMLS example/umls_tables_dir/g" $CLINER_DIR/config.txt`` + In order to tell CliNER that the tables are there, you must edit the file "$CLINER_DIR/config.txt" and change the line saying "UMLS None" to "UMLS ". + + This command will do that: ``sed -i 's|UMLS.*|UMLS ''|g' $CLINER_DIR/config.txt`` **The database will be built from the tables when CliNER is run for the first time.** diff --git a/cliner/features_dir/read_config.py b/cliner/features_dir/read_config.py index a95731d..96edb57 100644 --- a/cliner/features_dir/read_config.py +++ b/cliner/features_dir/read_config.py @@ -10,7 +10,7 @@ import os - +import sys def enabled_modules(): """ @@ -42,6 +42,17 @@ def enabled_modules(): else: specs[words[0]] = os.path.expandvars(words[1]).strip('\"').strip('\'') + # check if paths are actually valid + if specs["GENIA"] is not None: + + if os.path.isfile(specs["GENIA"]) is False: + sys.exit("Invalid path to genia executable.") + + if specs["UMLS"] is not None: + + if os.path.isdir(specs["UMLS"]) is False: + sys.exit("Invalid path to directory containing UMLS database tables") + return specs if __name__ == "__main__": diff --git a/config.txt b/config.txt index 65cfcba..0b22ba3 100644 --- a/config.txt +++ b/config.txt @@ -1,2 +1,3 @@ GENIA None -UMLS None +UMLS None +