mexico 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/.document +5 -0
- data/.gitmodules +3 -0
- data/.project +14 -0
- data/.rspec +2 -0
- data/Gemfile +31 -0
- data/LICENSE.txt +165 -0
- data/README.md +116 -0
- data/Rakefile +66 -0
- data/VERSION +1 -0
- data/assets/TESTCORPUS/Corpus.xml +26 -0
- data/assets/fiesta/b6/layer_connectors.fst +16 -0
- data/assets/fiesta/b6/match_jones_161_CM_neu_checked.parsed.xml +1225 -0
- data/assets/fiesta/elan/ElanFileFormat.eaf +76 -0
- data/assets/fiesta/elan/ElanFileFormat.pfsx +8 -0
- data/assets/fiesta/elan/ElanFileFormatComplexInterLayerLinks.eaf +107 -0
- data/assets/fiesta/elan/reflinks_example.eaf +270 -0
- data/assets/fiesta/elan/test_all_interlayerrelations.fst +43 -0
- data/assets/fiesta/head/head.fst +24 -0
- data/assets/fiesta/praat/mexico.ShortTextGrid +81 -0
- data/assets/fiesta/praat/mexico.TextGrid +104 -0
- data/assets/helpers/collection_ref_handler.rb +29 -0
- data/assets/helpers/id_ref_handler.rb +29 -0
- data/assets/helpers/roxml_attribute_handler.rb +57 -0
- data/assets/out_only/construct_and_write_spec.toe +99 -0
- data/assets/spec.html +554 -0
- data/bin/mexico +5 -0
- data/features/mexico.feature +9 -0
- data/features/step_definitions/mexico_steps.rb +0 -0
- data/features/support/env.rb +15 -0
- data/info/releasenotes/0.0.1.md +5 -0
- data/info/releasenotes/0.0.2.md +5 -0
- data/info/releasenotes/0.0.3.md +5 -0
- data/info/releasenotes/0.0.4.md +5 -0
- data/info/releasenotes/0.0.5.md +8 -0
- data/info/releasenotes/0.0.6.md +3 -0
- data/info/releasenotes/0.0.7.md +4 -0
- data/info/releasenotes/0.0.8.md +9 -0
- data/info/releasenotes/0.0.9.md +7 -0
- data/lib/mexico/cmd.rb +210 -0
- data/lib/mexico/constants.rb +82 -0
- data/lib/mexico/constraints/constraint.rb +85 -0
- data/lib/mexico/constraints/fiesta_constraints.rb +209 -0
- data/lib/mexico/constraints.rb +27 -0
- data/lib/mexico/core/corpus_core.rb +39 -0
- data/lib/mexico/core/design_core.rb +31 -0
- data/lib/mexico/core/media_type.rb +61 -0
- data/lib/mexico/core.rb +36 -0
- data/lib/mexico/fiesta/interfaces/b6_chat_game_interface.rb +222 -0
- data/lib/mexico/fiesta/interfaces/elan_interface.rb +143 -0
- data/lib/mexico/fiesta/interfaces/short_text_grid_interface.rb +99 -0
- data/lib/mexico/fiesta/interfaces/text_grid_interface.rb +103 -0
- data/lib/mexico/fiesta/interfaces.rb +31 -0
- data/lib/mexico/fiesta.rb +27 -0
- data/lib/mexico/file_system/bound_to_corpus.rb +37 -0
- data/lib/mexico/file_system/corpus.rb +207 -0
- data/lib/mexico/file_system/data.rb +96 -0
- data/lib/mexico/file_system/design.rb +75 -0
- data/lib/mexico/file_system/design_component.rb +78 -0
- data/lib/mexico/file_system/entry.rb +59 -0
- data/lib/mexico/file_system/fiesta_document.rb +344 -0
- data/lib/mexico/file_system/fiesta_map.rb +112 -0
- data/lib/mexico/file_system/head.rb +33 -0
- data/lib/mexico/file_system/id_ref.rb +46 -0
- data/lib/mexico/file_system/implicit_item_link.rb +19 -0
- data/lib/mexico/file_system/interval_link.rb +84 -0
- data/lib/mexico/file_system/item.rb +166 -0
- data/lib/mexico/file_system/item_link.rb +98 -0
- data/lib/mexico/file_system/item_links_proxy.rb +13 -0
- data/lib/mexico/file_system/layer.rb +89 -0
- data/lib/mexico/file_system/layer_connector.rb +74 -0
- data/lib/mexico/file_system/layer_link.rb +75 -0
- data/lib/mexico/file_system/local_file.rb +101 -0
- data/lib/mexico/file_system/participant.rb +69 -0
- data/lib/mexico/file_system/participant_role.rb +43 -0
- data/lib/mexico/file_system/point_link.rb +79 -0
- data/lib/mexico/file_system/property.rb +35 -0
- data/lib/mexico/file_system/property_map.rb +37 -0
- data/lib/mexico/file_system/resource.rb +174 -0
- data/lib/mexico/file_system/scale.rb +125 -0
- data/lib/mexico/file_system/section.rb +41 -0
- data/lib/mexico/file_system/static_collection_ref.rb +64 -0
- data/lib/mexico/file_system/template.rb +23 -0
- data/lib/mexico/file_system/trial.rb +87 -0
- data/lib/mexico/file_system/url.rb +65 -0
- data/lib/mexico/file_system.rb +62 -0
- data/lib/mexico/not_yet_implemented_error.rb +28 -0
- data/lib/mexico/util/fancy_container.rb +57 -0
- data/lib/mexico/util.rb +51 -0
- data/lib/mexico.rb +36 -0
- data/spec/constraints/constraints_spec.rb +306 -0
- data/spec/core/media_type_spec.rb +50 -0
- data/spec/fiesta/b6_spec.rb +43 -0
- data/spec/fiesta/elan_spec.rb +43 -0
- data/spec/fiesta/head_spec.rb +54 -0
- data/spec/fiesta/praat_spec.rb +54 -0
- data/spec/fiesta/read_spec.rb +76 -0
- data/spec/file_system_based/better_collection_spec.rb +142 -0
- data/spec/file_system_based/corpus_spec.rb +194 -0
- data/spec/file_system_based/design_spec.rb +100 -0
- data/spec/file_system_based/inter_links_spec.rb +100 -0
- data/spec/file_system_based/item_links_spec.rb +76 -0
- data/spec/file_system_based/rdf_spec.rb +177 -0
- data/spec/file_system_based/resource_spec.rb +111 -0
- data/spec/file_system_based/trial_spec.rb +129 -0
- data/spec/spec_helper.rb +14 -0
- data/spec/toe/construct_and_write_spec.rb +82 -0
- data/spec/toe/construction_spec.rb +110 -0
- data/spec/toe/item_spec.rb +58 -0
- data/spec/toe/layer_spec.rb +63 -0
- data/spec/toe/scale_spec.rb +89 -0
- data/spec/toe/toe_document_spec.rb +39 -0
- data/test/helper.rb +19 -0
- data/test/test_mexico.rb +7 -0
- metadata +357 -0
@@ -0,0 +1,104 @@
|
|
1
|
+
File type = "ooTextFile"
|
2
|
+
Object class = "TextGrid"
|
3
|
+
|
4
|
+
xmin = 0
|
5
|
+
xmax = 1.0120861678004536
|
6
|
+
tiers? <exists>
|
7
|
+
size = 4
|
8
|
+
item []:
|
9
|
+
item [1]:
|
10
|
+
class = "IntervalTier"
|
11
|
+
name = "silences"
|
12
|
+
xmin = 0
|
13
|
+
xmax = 1.0120861678004536
|
14
|
+
intervals: size = 2
|
15
|
+
intervals [1]:
|
16
|
+
xmin = 0
|
17
|
+
xmax = 0.13804308390022677
|
18
|
+
text = "silent"
|
19
|
+
intervals [2]:
|
20
|
+
xmin = 0.13804308390022677
|
21
|
+
xmax = 1.0120861678004536
|
22
|
+
text = "sounding"
|
23
|
+
item [2]:
|
24
|
+
class = "IntervalTier"
|
25
|
+
name = "phonemes"
|
26
|
+
xmin = 0
|
27
|
+
xmax = 1.0120861678004536
|
28
|
+
intervals: size = 8
|
29
|
+
intervals [1]:
|
30
|
+
xmin = 0
|
31
|
+
xmax = 0.13804308390022677
|
32
|
+
text = ""
|
33
|
+
intervals [2]:
|
34
|
+
xmin = 0.13804308390022677
|
35
|
+
xmax = 0.24419133996563067
|
36
|
+
text = "m"
|
37
|
+
intervals [3]:
|
38
|
+
xmin = 0.24419133996563067
|
39
|
+
xmax = 0.37770980345703364
|
40
|
+
text = "\ef"
|
41
|
+
intervals [4]:
|
42
|
+
xmin = 0.37770980345703364
|
43
|
+
xmax = 0.5203023372828038
|
44
|
+
text = "ks"
|
45
|
+
intervals [5]:
|
46
|
+
xmin = 0.5203023372828038
|
47
|
+
xmax = 0.6110430406264757
|
48
|
+
text = "\ic"
|
49
|
+
intervals [6]:
|
50
|
+
xmin = 0.6110430406264757
|
51
|
+
xmax = 0.745209651998905
|
52
|
+
text = "k"
|
53
|
+
intervals [7]:
|
54
|
+
xmin = 0.745209651998905
|
55
|
+
xmax = 0.9247466150431701
|
56
|
+
text = "o"
|
57
|
+
intervals [8]:
|
58
|
+
xmin = 0.9247466150431701
|
59
|
+
xmax = 1.0120861678004536
|
60
|
+
text = ""
|
61
|
+
item [3]:
|
62
|
+
class = "IntervalTier"
|
63
|
+
name = "syllables"
|
64
|
+
xmin = 0
|
65
|
+
xmax = 1.0120861678004536
|
66
|
+
intervals: size = 5
|
67
|
+
intervals [1]:
|
68
|
+
xmin = 0
|
69
|
+
xmax = 0.13804308390022677
|
70
|
+
text = ""
|
71
|
+
intervals [2]:
|
72
|
+
xmin = 0.13804308390022677
|
73
|
+
xmax = 0.37770980345703364
|
74
|
+
text = "me"
|
75
|
+
intervals [3]:
|
76
|
+
xmin = 0.37770980345703364
|
77
|
+
xmax = 0.6110430406264757
|
78
|
+
text = "xi"
|
79
|
+
intervals [4]:
|
80
|
+
xmin = 0.6110430406264757
|
81
|
+
xmax = 0.9247466150431701
|
82
|
+
text = "co"
|
83
|
+
intervals [5]:
|
84
|
+
xmin = 0.9247466150431701
|
85
|
+
xmax = 1.0120861678004536
|
86
|
+
text = ""
|
87
|
+
item [4]:
|
88
|
+
class = "IntervalTier"
|
89
|
+
name = "words"
|
90
|
+
xmin = 0
|
91
|
+
xmax = 1.0120861678004536
|
92
|
+
intervals: size = 3
|
93
|
+
intervals [1]:
|
94
|
+
xmin = 0
|
95
|
+
xmax = 0.13804308390022677
|
96
|
+
text = ""
|
97
|
+
intervals [2]:
|
98
|
+
xmin = 0.13804308390022677
|
99
|
+
xmax = 0.9247466150431701
|
100
|
+
text = "mexico"
|
101
|
+
intervals [3]:
|
102
|
+
xmin = 0.9247466150431701
|
103
|
+
xmax = 1.0120861678004536
|
104
|
+
text = ""
|
@@ -0,0 +1,29 @@
|
|
1
|
+
class CollectionRefHandler < YARD::Handlers::Ruby::AttributeHandler
|
2
|
+
|
3
|
+
handles method_call(:collection_ref)
|
4
|
+
namespace_only
|
5
|
+
|
6
|
+
def process
|
7
|
+
# push_state(:scope => :class) { super }
|
8
|
+
name = statement.parameters.first.jump(:tstring_content, :ident).source
|
9
|
+
get_object = YARD::CodeObjects::MethodObject.new(namespace, name)
|
10
|
+
register(get_object)
|
11
|
+
current_object_type = nil
|
12
|
+
get_object.dynamic = true
|
13
|
+
if get_object.docstring.to_s.strip =~ /type\s+(.*)/
|
14
|
+
current_object_type = $1
|
15
|
+
get_object.docstring = "Gets the #{name} object via the #{name}_id reference."
|
16
|
+
get_object.docstring.add_tag(YARD::Tags::Tag.new("return","The referenced #{name} object", current_object_type))
|
17
|
+
|
18
|
+
set_object = YARD::CodeObjects::MethodObject.new(namespace, "#{name}=")
|
19
|
+
register(set_object)
|
20
|
+
set_object.dynamic = true
|
21
|
+
set_object.parameters= [ ['new_value', nil] ]
|
22
|
+
set_object.docstring = "Sets the the #{name} object and updates the #{name}_id reference."
|
23
|
+
set_object.docstring.add_tag(YARD::Tags::Tag.new("return", "", "void"))
|
24
|
+
set_object.docstring.add_tag(YARD::Tags::Tag.new(:param, "The new value to be set", current_object_type, 'new_value'))
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
28
|
+
|
29
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
class IdRefHandler < YARD::Handlers::Ruby::AttributeHandler
|
2
|
+
|
3
|
+
handles method_call(:id_ref)
|
4
|
+
namespace_only
|
5
|
+
|
6
|
+
def process
|
7
|
+
# push_state(:scope => :class) { super }
|
8
|
+
name = statement.parameters.first.jump(:tstring_content, :ident).source
|
9
|
+
get_object = YARD::CodeObjects::MethodObject.new(namespace, name)
|
10
|
+
register(get_object)
|
11
|
+
current_object_type = nil
|
12
|
+
get_object.dynamic = true
|
13
|
+
if get_object.docstring.to_s.strip =~ /type\s+(.*)/
|
14
|
+
current_object_type = $1
|
15
|
+
get_object.docstring = "Gets the #{name} object via the #{name}_id reference."
|
16
|
+
get_object.docstring.add_tag(YARD::Tags::Tag.new("return","The referenced #{name} object", current_object_type))
|
17
|
+
|
18
|
+
set_object = YARD::CodeObjects::MethodObject.new(namespace, "#{name}=")
|
19
|
+
register(set_object)
|
20
|
+
set_object.dynamic = true
|
21
|
+
set_object.parameters= [ ['new_value', nil] ]
|
22
|
+
set_object.docstring = "Sets the the #{name} object and updates the #{name}_id reference."
|
23
|
+
set_object.docstring.add_tag(YARD::Tags::Tag.new("return", "", "void"))
|
24
|
+
set_object.docstring.add_tag(YARD::Tags::Tag.new(:param, "The new value to be set", current_object_type, 'new_value'))
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
28
|
+
|
29
|
+
end
|
@@ -0,0 +1,57 @@
|
|
1
|
+
class RoxmlAttributeHandler < YARD::Handlers::Ruby::AttributeHandler
|
2
|
+
|
3
|
+
ID_DESC = <<FOO
|
4
|
+
An identifier is a string compatible with common ID types
|
5
|
+
as in, for instance, XML Schema.
|
6
|
+
identifier fields must be unique throughout a corpus document
|
7
|
+
(or a corpus object tree).
|
8
|
+
FOO
|
9
|
+
|
10
|
+
handles method_call(:xml_accessor)
|
11
|
+
namespace_only
|
12
|
+
|
13
|
+
def process
|
14
|
+
# push_state(:scope => :class) { super }
|
15
|
+
|
16
|
+
name = statement.parameters.first.jump(:tstring_content, :ident).source
|
17
|
+
object = YARD::CodeObjects::MethodObject.new(namespace, name)
|
18
|
+
register(object)
|
19
|
+
|
20
|
+
setter_string = nil
|
21
|
+
current_object_type = nil
|
22
|
+
|
23
|
+
if object.docstring.to_s.strip =~ /identifier/
|
24
|
+
current_object_type = "String"
|
25
|
+
object.dynamic = true
|
26
|
+
object.docstring = "Gets the identifier of this object. #{ID_DESC}"
|
27
|
+
object.docstring.add_tag(YARD::Tags::Tag.new("return","The current value of the #{name} field.", current_object_type))
|
28
|
+
setter_string = "Sets the identifier for this object. #{ID_DESC}"
|
29
|
+
end
|
30
|
+
|
31
|
+
if object.docstring.to_s.strip =~ /.*type\s+(.*)/
|
32
|
+
current_object_type = $1
|
33
|
+
object.dynamic = true
|
34
|
+
object.docstring = "XML-bound getter method for the #{name} field."
|
35
|
+
object.docstring.add_tag(YARD::Tags::Tag.new("return","The current value of the #{name} field.", current_object_type))
|
36
|
+
setter_string = "XML-bound setter method for the #{name} field."
|
37
|
+
end
|
38
|
+
|
39
|
+
if object.docstring.to_s.strip =~ /.*collection of\s+(.*)/
|
40
|
+
object.dynamic = true
|
41
|
+
object.docstring = "XML-bound getter method for the #{name} collection of #{$1} objects."
|
42
|
+
current_object_type = "[#{$1}]"
|
43
|
+
object.docstring.add_tag(YARD::Tags::Tag.new("return","The current value of the #{name} field.", current_object_type))
|
44
|
+
setter_string = "XML-bound setter method for the #{name} collection of #{$1} objects."
|
45
|
+
end
|
46
|
+
|
47
|
+
setter_object = YARD::CodeObjects::MethodObject.new(namespace, "#{name}=")
|
48
|
+
register(setter_object)
|
49
|
+
setter_object.dynamic = true
|
50
|
+
setter_object.parameters= [ ['new_value', nil] ]
|
51
|
+
setter_object.docstring = setter_string || "Sets the XML-bound field '#{name}'."
|
52
|
+
setter_object.docstring.add_tag(YARD::Tags::Tag.new("return", "", "void"))
|
53
|
+
setter_object.docstring.add_tag(YARD::Tags::Tag.new(:param, "The new value to be set", current_object_type, 'new_value'))
|
54
|
+
|
55
|
+
end
|
56
|
+
|
57
|
+
end
|
@@ -0,0 +1,99 @@
|
|
1
|
+
<FiestaDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../xml/schema/fiesta.xsd">
|
2
|
+
<ScaleSet>
|
3
|
+
<Scale id="timeline01" name="Timeline" unit="s"/>
|
4
|
+
</ScaleSet>
|
5
|
+
<LayerSet>
|
6
|
+
<Layer id="layer01" name="Layer 1"/>
|
7
|
+
<Layer id="layer02" name="Layer 2"/>
|
8
|
+
<Layer id="layer03" name="Layer 3"/>
|
9
|
+
<Layer id="layer04" name="Layer 4"/>
|
10
|
+
</LayerSet>
|
11
|
+
<ItemSet>
|
12
|
+
<Item id="i1">
|
13
|
+
<Links>
|
14
|
+
<ItemLink role="successor" target="i2"/>
|
15
|
+
<LayerLink target="layer01"/>
|
16
|
+
<PointLink point="100.0" target="timeline01"/>
|
17
|
+
</Links>
|
18
|
+
<Data>
|
19
|
+
<String>yes</String>
|
20
|
+
</Data>
|
21
|
+
</Item>
|
22
|
+
<Item id="i2">
|
23
|
+
<Links>
|
24
|
+
<ItemLink role="predecessor" target="i1"/>
|
25
|
+
<ItemLink role="successor" target="i3"/>
|
26
|
+
<LayerLink target="layer01"/>
|
27
|
+
<PointLink point="200.0" target="timeline01"/>
|
28
|
+
</Links>
|
29
|
+
<Data>
|
30
|
+
<String>all</String>
|
31
|
+
</Data>
|
32
|
+
</Item>
|
33
|
+
<Item id="i3">
|
34
|
+
<Links>
|
35
|
+
<ItemLink role="predecessor" target="i2"/>
|
36
|
+
<ItemLink role="successor" target="i4"/>
|
37
|
+
<LayerLink target="layer01"/>
|
38
|
+
<PointLink point="300.0" target="timeline01"/>
|
39
|
+
</Links>
|
40
|
+
<Data>
|
41
|
+
<String>work</String>
|
42
|
+
</Data>
|
43
|
+
</Item>
|
44
|
+
<Item id="i4">
|
45
|
+
<Links>
|
46
|
+
<ItemLink role="predecessor" target="i3"/>
|
47
|
+
<ItemLink role="successor" target="i5"/>
|
48
|
+
<LayerLink target="layer01"/>
|
49
|
+
<PointLink point="400.0" target="timeline01"/>
|
50
|
+
</Links>
|
51
|
+
<Data>
|
52
|
+
<String>and</String>
|
53
|
+
</Data>
|
54
|
+
</Item>
|
55
|
+
<Item id="i5">
|
56
|
+
<Links>
|
57
|
+
<ItemLink role="predecessor" target="i4"/>
|
58
|
+
<ItemLink role="successor" target="i6"/>
|
59
|
+
<LayerLink target="layer02"/>
|
60
|
+
<IntervalLink min="500.0" max="600.0" target="timeline01"/>
|
61
|
+
</Links>
|
62
|
+
<Data>
|
63
|
+
<String>no</String>
|
64
|
+
</Data>
|
65
|
+
</Item>
|
66
|
+
<Item id="i6">
|
67
|
+
<Links>
|
68
|
+
<ItemLink role="predecessor" target="i5"/>
|
69
|
+
<ItemLink role="successor" target="i7"/>
|
70
|
+
<LayerLink target="layer02"/>
|
71
|
+
<IntervalLink min="600.0" max="700.0" target="timeline01"/>
|
72
|
+
</Links>
|
73
|
+
<Data>
|
74
|
+
<String>play</String>
|
75
|
+
</Data>
|
76
|
+
</Item>
|
77
|
+
<Item id="i7">
|
78
|
+
<Links>
|
79
|
+
<ItemLink role="predecessor" target="i6"/>
|
80
|
+
<ItemLink role="successor" target="i8"/>
|
81
|
+
<LayerLink target="layer02"/>
|
82
|
+
<IntervalLink min="700.0" max="800.0" target="timeline01"/>
|
83
|
+
</Links>
|
84
|
+
<Data>
|
85
|
+
<String>makes</String>
|
86
|
+
</Data>
|
87
|
+
</Item>
|
88
|
+
<Item id="i8">
|
89
|
+
<Links>
|
90
|
+
<ItemLink role="predecessor" target="i7"/>
|
91
|
+
<LayerLink target="layer02"/>
|
92
|
+
<IntervalLink min="800.0" max="900.0" target="timeline01"/>
|
93
|
+
</Links>
|
94
|
+
<Data>
|
95
|
+
<String>jack</String>
|
96
|
+
</Data>
|
97
|
+
</Item>
|
98
|
+
</ItemSet>
|
99
|
+
</FiestaDocument>
|