clause_extractor 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/clause_extractor.rb +7 -3
- metadata +2 -2
data/lib/clause_extractor.rb
CHANGED
@@ -34,6 +34,8 @@ class ClauseExtractor
|
|
34
34
|
'gerund' => {
|
35
35
|
"conditional perfect progressive" => [/\b(#{pronouns}\s+)*would\s+(not\s+)*have\s+(not\s+)*been\s+search/i], #I would have been searching
|
36
36
|
"present perfect progressive" => [/\b(#{pronouns}\s+)*([a-z]{1,4}'ve|have|has)(n't)*\s+(#{pronouns}\s+)*(not\s+)*(#{present_perfect}\s+)*been\s+search/i], #I have been searching
|
37
|
+
"past perfect progressive" => [/\b(#{pronouns}\s+)*([a-z]{1,4}'d|had)(n't)*\s+(#{pronouns}\s+)*(not\s+)*(#{present_perfect}\s+)*been\s+search/i], #I have been searching, had he not been searching
|
38
|
+
|
37
39
|
"conditional progressive" => [/\b(#{pronouns}\s+)*(would|[a-z]{1,4}'d)\s+(not\s+)*be\s+search/i], #I would be searching (I'd)
|
38
40
|
"future progressive" => [
|
39
41
|
/\b((#{pronouns})\s+)*(will|[a-z]{1,4}'ll)\s+(not\s+)*be\s+search/i,
|
@@ -85,7 +87,6 @@ class ClauseExtractor
|
|
85
87
|
regex_array.each do |regex|
|
86
88
|
regex = regex.to_s.gsub("search", "#{a[i]}")
|
87
89
|
phrase, list, ranges = scan_phrase(phrase, list, regex, a[i], tense, i, ranges)
|
88
|
-
|
89
90
|
end
|
90
91
|
end
|
91
92
|
end
|
@@ -95,7 +96,9 @@ class ClauseExtractor
|
|
95
96
|
list.each do |k, v|
|
96
97
|
list.delete(k) unless ranges.include?(v)
|
97
98
|
end
|
98
|
-
|
99
|
+
list.each do |k,v|
|
100
|
+
print "#{k}\n"
|
101
|
+
end
|
99
102
|
list
|
100
103
|
end
|
101
104
|
|
@@ -105,7 +108,8 @@ class ClauseExtractor
|
|
105
108
|
lo, hi = get_match_start_index(verb, match, index)
|
106
109
|
ranges = prioritize_ranges(ranges, lo, hi,match)
|
107
110
|
list[@tense_id["#{tense_label}"].to_s+":" + match.to_s + ":" + @verbs[verb].to_s] = (lo..hi) if @format.match(/audioverb/)
|
108
|
-
list["#{tense_label}
|
111
|
+
list["#{tense_label}:" + match.to_s + ":" + (lo..hi).to_s] = (lo..hi) unless @format.match(/audioverb/)
|
112
|
+
#list["#{tense_label}:" + match.to_s] = (lo..hi) unless @format.match(/audioverb/)
|
109
113
|
end
|
110
114
|
return phrase, list, ranges
|
111
115
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: clause_extractor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -19,7 +19,7 @@ extra_rdoc_files: []
|
|
19
19
|
files:
|
20
20
|
- lib/clause_extractor.rb
|
21
21
|
- lib/conjugations.rb
|
22
|
-
homepage:
|
22
|
+
homepage: https://github.com/mikefab/clause_extractor
|
23
23
|
licenses: []
|
24
24
|
post_install_message:
|
25
25
|
rdoc_options: []
|