rbbt-text 0.6.0 → 0.6.2
Sign up to get free protection for your applications and to get access to all the features.
data/lib/rbbt/corpus/corpus.rb
CHANGED
@@ -34,10 +34,12 @@ class Corpus
|
|
34
34
|
|
35
35
|
def document(namespace, id, type, hash)
|
36
36
|
docid = [namespace, id, type, hash] * ":"
|
37
|
+
raise "Document '#{ docid }' was not found." unless @document_repo.include? docid
|
37
38
|
Document.new(persistence_for(docid), docid, @document_repo[docid], @global_annotations)
|
38
39
|
end
|
39
40
|
|
40
41
|
def docid(docid)
|
42
|
+
raise "Document '#{ docid }' was not found." unless @document_repo.include? docid
|
41
43
|
Document.new(persistence_for(docid), docid, @document_repo[docid], @global_annotations)
|
42
44
|
end
|
43
45
|
|
data/lib/rbbt/nlp/nlp.rb
CHANGED
@@ -16,10 +16,10 @@ module NLP
|
|
16
16
|
#Rbbt.software.opt.StanfordParser.define_as_install Rbbt.share.install.software.StanfordParser.find
|
17
17
|
#Rbbt.software.opt.StanfordParser.produce
|
18
18
|
|
19
|
-
Rbbt.software.opt.Geniass
|
19
|
+
Rbbt.claim Rbbt.software.opt.Geniass, :install, Rbbt.share.install.software.Geniass.find
|
20
20
|
Rbbt.software.opt.Geniass.produce
|
21
21
|
|
22
|
-
Rbbt.software.opt.Gdep
|
22
|
+
Rbbt.claim Rbbt.software.opt.Gdep, :install, Rbbt.share.install.software.Gdep.find
|
23
23
|
Rbbt.software.opt.Gdep.produce
|
24
24
|
|
25
25
|
NEW_LINE_MASK = "\t\t \t \t"
|
@@ -5,7 +5,7 @@ RBBT_SOFTWARE_DIR="$2"
|
|
5
5
|
source "$INSTALL_HELPER_FILE"
|
6
6
|
|
7
7
|
name='ChemicalTagger'
|
8
|
-
url="https://bitbucket.org/
|
8
|
+
url="https://bitbucket.org/wwmm/chemicaltagger/downloads/chemicalTagger-1.0.2-jar-with-dependencies.jar"
|
9
9
|
|
10
10
|
PKG_DIR=`opt_dir $name`
|
11
11
|
[ -d $PKG_DIR ] || mkdir -p $PKG_DIR
|
@@ -41,12 +41,14 @@ class RbbtChemicalTagger{
|
|
41
41
|
ArrayList tokens = new ArrayList();
|
42
42
|
ArrayList molecules = new ArrayList();
|
43
43
|
ArrayList new_tokens = new ArrayList();
|
44
|
+
|
44
45
|
tokens.add(tree);
|
45
46
|
while (tokens.size() > 0){
|
46
47
|
for(int tree_i = 0; tree_i < tokens.size(); tree_i++){
|
47
48
|
Tree subtree = (Tree) tokens.get(tree_i);
|
48
49
|
int type = subtree.getType();
|
49
|
-
|
50
|
+
|
51
|
+
if (type == 84){
|
50
52
|
molecules.add(subtree.getChild(0));
|
51
53
|
}else{
|
52
54
|
for(int tree_j = 0; tree_j < subtree.getChildCount(); tree_j++){
|
@@ -75,7 +77,6 @@ class RbbtChemicalTagger{
|
|
75
77
|
|
76
78
|
EOF
|
77
79
|
|
78
|
-
env |grep JAVA
|
79
|
-
|
80
|
+
env | grep JAVA
|
80
81
|
|
81
|
-
(env CLASSPATH="$OPT_JAR_DIR/ChemicalTagger.jar:$CLASSPATH"
|
82
|
+
(env CLASSPATH="$OPT_JAR_DIR/ChemicalTagger.jar:$CLASSPATH" javac /tmp/RbbtChemicalTagger.java && jar uf "$PKG_DIR/ChemicalTagger.jar" -C /tmp RbbtChemicalTagger.class) || (rm "$PKG_DIR/ChemicalTagger.jar" && rmdir $PKG_DIR)
|
@@ -10,7 +10,7 @@ class TestChemicalTagger < Test::Unit::TestCase
|
|
10
10
|
ner = ChemicalTagger.new
|
11
11
|
str = "Alternatively, rearrangement of O-(w-haloalkyl)esters 34 of 2-carboethoxy-N-hydroxypyridine-2-selone affords azonianaphthalenium halides 37 in 79% yield"
|
12
12
|
mentions = ner.match(str, "CM", false)
|
13
|
-
|
13
|
+
|
14
14
|
good_mentions = ["2-carboethoxy-N-hydroxypyridine-2-selone", "O-(w-haloalkyl)esters"]
|
15
15
|
|
16
16
|
good_mentions.each{|mention|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rbbt-text
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
5
|
-
prerelease:
|
4
|
+
hash: 3
|
5
|
+
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 6
|
9
|
-
-
|
10
|
-
version: 0.6.
|
9
|
+
- 2
|
10
|
+
version: 0.6.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Miguel Vazquez
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-10-03 00:00:00 +02:00
|
19
19
|
default_executable: get_ppis.rb
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -191,7 +191,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
191
191
|
requirements: []
|
192
192
|
|
193
193
|
rubyforge_project:
|
194
|
-
rubygems_version: 1.
|
194
|
+
rubygems_version: 1.6.2
|
195
195
|
signing_key:
|
196
196
|
specification_version: 3
|
197
197
|
summary: Text mining tools for the Ruby Bioinformatics Toolkit (rbbt)
|