Skip to content
This repository has been archived by the owner on Aug 15, 2020. It is now read-only.

Commit

Permalink
updated readme, made read_config check if paths are actually correct
Browse files Browse the repository at this point in the history
  • Loading branch information
kwaco committed Dec 2, 2015
1 parent 3373a5d commit 68ddfad
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
8 changes: 7 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 <path to genia executable>".

This command will do that: sed -i ``sed -i 's|GENIA.*|GENIA '<path of dir containing genia exe>/geniatagger'|g' $CLINER_DIR/config.txt``


(3) UMLS tables

Expand Down Expand Up @@ -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 <path to dir containing tables>". 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 <path to dir containing tables>".

This command will do that: ``sed -i 's|UMLS.*|UMLS '<path of dir containing umls tables>'|g' $CLINER_DIR/config.txt``

**The database will be built from the tables when CliNER is run for the first time.**

Expand Down
13 changes: 12 additions & 1 deletion cliner/features_dir/read_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@


import os

import sys

def enabled_modules():
"""
Expand Down Expand Up @@ -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__":
Expand Down
3 changes: 2 additions & 1 deletion config.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
GENIA None
UMLS None
UMLS None

0 comments on commit 68ddfad

Please sign in to comment.