linkparser 1.1.4 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/.simplecov +9 -0
- data/ChangeLog +40 -3
- data/History.md +55 -0
- data/Manifest.txt +6 -4
- data/{README.rdoc → README.md} +56 -53
- data/Rakefile +53 -21
- data/ext/dictionary.c +60 -65
- data/ext/extconf.rb +6 -3
- data/ext/linkage.c +117 -368
- data/ext/linkparser.c +56 -27
- data/ext/linkparser.h +14 -16
- data/ext/parseoptions.c +209 -680
- data/ext/sentence.c +62 -149
- data/lib/linkparser.rb +14 -7
- data/lib/linkparser/dictionary.rb +13 -0
- data/lib/linkparser/linkage.rb +277 -166
- data/lib/linkparser/mixins.rb +2 -2
- data/lib/linkparser/parseoptions.rb +58 -0
- data/lib/linkparser/sentence.rb +21 -34
- data/spec/bugfixes_spec.rb +23 -36
- data/spec/helpers.rb +35 -0
- data/spec/linkparser/dictionary_spec.rb +29 -48
- data/spec/linkparser/linkage_spec.rb +199 -268
- data/spec/linkparser/mixins_spec.rb +9 -24
- data/spec/linkparser/parseoptions_spec.rb +45 -59
- data/spec/linkparser/sentence_spec.rb +36 -56
- data/spec/linkparser_spec.rb +6 -25
- metadata +97 -85
- metadata.gz.sig +0 -0
- data/History.rdoc +0 -41
- data/examples/basic-api.rb +0 -65
- data/examples/readme-example.rb +0 -14
metadata.gz.sig
CHANGED
Binary file
|
data/History.rdoc
DELETED
@@ -1,41 +0,0 @@
|
|
1
|
-
== v1.1.4 [2012-01-31] Michael Granger <ged@FaerieMUD.org>
|
2
|
-
|
3
|
-
- Packaging fixes, dependency update
|
4
|
-
|
5
|
-
|
6
|
-
== v1.1.3 [2011-05-16] Michael Granger <ged@FaerieMUD.org>
|
7
|
-
|
8
|
-
- Use a relative path for path constants (Alessandro Berardi), update
|
9
|
-
deps
|
10
|
-
|
11
|
-
|
12
|
-
== v1.1.2 [2011-05-12] Michael Granger <ged@FaerieMUD.org>
|
13
|
-
|
14
|
-
- Fixes package configuration options concatenation bug (see
|
15
|
-
http://goo.gl/G49Y8) (Alessandro Berardi <berardialessandro@gmail.com>)
|
16
|
-
- De-Yard, build cleanup, added gem-testers support
|
17
|
-
- Removed unnecessary (and non-existant on Ruby < 1.9) include.
|
18
|
-
- Fixing some shadowed variables for 1.9.2.
|
19
|
-
- Avoid circular requires.
|
20
|
-
|
21
|
-
|
22
|
-
== v1.1.1 [2010-12-30] Michael Granger <ged@FaerieMUD.org>
|
23
|
-
|
24
|
-
* Updated for link-grammar 4.7.1.
|
25
|
-
* Fixed some specs that were doing nothing, using old RSpec syntax, etc.
|
26
|
-
* Converted to Hoe.
|
27
|
-
|
28
|
-
|
29
|
-
== v1.1.0 [2010-11-30] Michael Granger <ged@FaerieMUD.org>
|
30
|
-
|
31
|
-
* Updated to support link-grammar 4.7.0. Note that this breaks compatibility with
|
32
|
-
earlier versions, as the model for sentences with conjunctions has changed
|
33
|
-
significantly.
|
34
|
-
* Use pkgconfig if available.
|
35
|
-
* Various memory-management and 1.9.2 fixes.
|
36
|
-
|
37
|
-
|
38
|
-
== v1.0.6 [2009-10-16] Michael Granger <ged@FaerieMUD.org>
|
39
|
-
|
40
|
-
[TODO]
|
41
|
-
|
data/examples/basic-api.rb
DELETED
@@ -1,65 +0,0 @@
|
|
1
|
-
#!/usr/bin/ruby
|
2
|
-
|
3
|
-
# The C equivalent:
|
4
|
-
# opts = parse_options_create();
|
5
|
-
# dict = dictionary_create("4.0.dict", "4.0.knowledge", NULL, "4.0.affix");
|
6
|
-
# sent = sentence_create(input_string[i], dict);
|
7
|
-
# num_linkages = sentence_parse(sent, opts);
|
8
|
-
# linkage = linkage_create(0, sent, opts);
|
9
|
-
# printf("%s\n", diagram = linkage_print_diagram(linkage));
|
10
|
-
# string_delete(diagram);
|
11
|
-
# linkage_delete(linkage);
|
12
|
-
# dictionary_delete(dict);
|
13
|
-
# parse_options_delete(opts);
|
14
|
-
|
15
|
-
|
16
|
-
opts = {
|
17
|
-
:verbosity => 0,
|
18
|
-
:linkage_limit => 10000,
|
19
|
-
:min_null_count => 0,
|
20
|
-
:max_null_count => 0,
|
21
|
-
:null_block => 1,
|
22
|
-
:islands_ok => false,
|
23
|
-
:short_length => 6,
|
24
|
-
:all_short => false,
|
25
|
-
:display_short => true,
|
26
|
-
:display_word_subscripts => true,
|
27
|
-
:display_link_subscripts => true,
|
28
|
-
:display_walls => false,
|
29
|
-
:display_union => false,
|
30
|
-
:allow_null => true,
|
31
|
-
:echo_on => false,
|
32
|
-
:batch_mode => false,
|
33
|
-
:panic_mode => false,
|
34
|
-
:screen_width => 79,
|
35
|
-
:display_on => true,
|
36
|
-
:display_postscript => false,
|
37
|
-
:display_bad => false,
|
38
|
-
:display_links => false,
|
39
|
-
}
|
40
|
-
|
41
|
-
paths = [
|
42
|
-
dict_name,
|
43
|
-
pp_name,
|
44
|
-
cons_name,
|
45
|
-
affix_name
|
46
|
-
]
|
47
|
-
|
48
|
-
dict = LinkParser::Dict.create( opts )
|
49
|
-
dict = LinkParser::Dict.create( paths )
|
50
|
-
dict = LinkParser::Dict.create( "en" )
|
51
|
-
dict = LinkParser::Dict.create( "en", opts )
|
52
|
-
|
53
|
-
sentence = dict.parse( input_string, :verbosity => 3, :islands_ok => true )
|
54
|
-
# -or-
|
55
|
-
sentence = LinkParser::Sentence.new( input_string, dict )
|
56
|
-
linkage_count = sentence.parse( :verbosity => 3, :islands_ok => true )
|
57
|
-
|
58
|
-
sentence.linkages.each do |linkage|
|
59
|
-
puts linkage.diagram
|
60
|
-
end
|
61
|
-
sentence.each_linkage do |linkage|
|
62
|
-
puts linkage.diagram
|
63
|
-
end
|
64
|
-
|
65
|
-
|
data/examples/readme-example.rb
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
#!/usr/bin/env irb --prompt-mode xmp
|
2
|
-
|
3
|
-
require 'linkparser'
|
4
|
-
|
5
|
-
dict = LinkParser::Dictionary.new( :screen_width => 100 )
|
6
|
-
sent = dict.parse( "People use Ruby for all kinds of nifty things." )
|
7
|
-
|
8
|
-
sent.subject
|
9
|
-
sent.verb
|
10
|
-
sent.object
|
11
|
-
|
12
|
-
puts sent.constituent_tree_string
|
13
|
-
|
14
|
-
puts sent.diagram
|