tbx_importer 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/tbx_importer/version.rb +1 -1
- data/lib/tbx_importer.rb +3 -3
- data/spec/sample_files/sample_1(utf-8).tbx +1 -1
- data/spec/tbx_importer_spec.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2033921597c1fc81b125a26dc8ad32a3163c83b2
|
4
|
+
data.tar.gz: 4dfa3659ed1715b06d6e71e2dd12354aad1951a3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7b43b05258e4d44f46360b1aba60c01bc36b4509b333918f232ccbf40b36b84acf5c62feb7d6c2bcf03bf7e23966d430148a826f5584554c35f4d4fc67ed1130
|
7
|
+
data.tar.gz: 89a329fa3c63b9a6e6e1ace78f92f0d04391c029425889d03c9cc56ce80949b5b30b7299352d8327189abd63058ac1cb8759d9f2b75b4e44b81a2e997570050b
|
data/lib/tbx_importer/version.rb
CHANGED
data/lib/tbx_importer.rb
CHANGED
@@ -121,11 +121,11 @@ module TbxImporter
|
|
121
121
|
when [116, 101, 114, 109] #term
|
122
122
|
write_term(reader)
|
123
123
|
when [116, 101, 114, 109, 78, 111, 116, 101] #termNote
|
124
|
-
@doc[:term][:part_of_speech] = PrettyStrings::Cleaner.new(reader.read_string.downcase).pretty.gsub("
|
124
|
+
@doc[:term][:part_of_speech] = PrettyStrings::Cleaner.new(reader.read_string.downcase).pretty.gsub("\\","\").gsub("'",%q(\\\')) if reader.get_attribute("type").eql?("partOfSpeech")
|
125
125
|
@doc[:term][:vals].pop
|
126
126
|
write_term(reader)
|
127
127
|
when [100, 101, 115, 99, 114, 105, 112] #descrip
|
128
|
-
@doc[:tc][:definition] = PrettyStrings::Cleaner.new(reader.read_string).pretty.gsub("
|
128
|
+
@doc[:tc][:definition] = PrettyStrings::Cleaner.new(reader.read_string).pretty.gsub("\\","\").gsub("'",%q(\\\')) if reader.get_attribute("type").eql?("definition")
|
129
129
|
@doc[:tc][:vals].pop
|
130
130
|
write_tc
|
131
131
|
end
|
@@ -138,7 +138,7 @@ module TbxImporter
|
|
138
138
|
|
139
139
|
def write_term(reader)
|
140
140
|
return if reader.read_string.nil?
|
141
|
-
text = PrettyStrings::Cleaner.new(reader.read_string).pretty.gsub("
|
141
|
+
text = PrettyStrings::Cleaner.new(reader.read_string).pretty.gsub("\\","\").gsub("'",%q(\\\'))
|
142
142
|
word_count = text.gsub("\s+", ' ').split(' ').length
|
143
143
|
@doc[:term][:vals] << [@doc[:tc][:id], @doc[:term][:lang], @doc[:term][:part_of_speech], text]
|
144
144
|
end
|
@@ -30,7 +30,7 @@
|
|
30
30
|
</ntig>
|
31
31
|
</langSet>
|
32
32
|
</termEntry>
|
33
|
-
<termEntry id="3_106184"><langSet xml:lang="en-US"><descripGrp><descrip type="definition">To shorten the fractional part of a number, increasing the last remaining (rightmost) digit or not, according to whether the deleted portion was over or under five.</descrip></descripGrp><ntig><termGrp><term id="106184">round</term><termNote type="partOfSpeech">Verb</termNote></termGrp></ntig></langSet><langSet xml:lang="fr-fr"><ntig><termGrp><term id="106187">arrondir</term><termNote type="partOfSpeech">Verb</termNote></termGrp></ntig></langSet></termEntry><termEntry id="4_156085"><langSet xml:lang="en-US"><descripGrp><descrip type="definition">Personally identifiable information (PII) that is protected in special ways by law or policy.</descrip></descripGrp><ntig><termGrp><term id="156085">sensitive data</term><termNote type="partOfSpeech">Noun</termNote></termGrp></ntig></langSet><langSet xml:lang="fr-fr"><ntig><termGrp><term id="156096">données sensibles</term><termNote type="partOfSpeech">Noun</termNote></termGrp></ntig></langSet></termEntry><termEntry id="5_182425"><langSet xml:lang="en-US"><descripGrp><descrip type="definition">A business unit that is immediately under another business unit in the business hierarchy of an organization.</descrip></descripGrp><ntig><termGrp><term id="182425">child business unit</term><termNote type="partOfSpeech">Noun</termNote></termGrp></ntig></langSet><langSet xml:lang="fr-fr"><ntig><termGrp><term id="182429">sous-division</term><termNote type="partOfSpeech">Noun</termNote></termGrp></ntig></langSet></termEntry><termEntry id="7_96886"><langSet xml:lang="en-US"><descripGrp><descrip type="definition">The mode of a command-line application where it does not display confirmation messages or any other user interface items that normally appear on screen. The switch for quiet mode is typically
|
33
|
+
<termEntry id="3_106184"><langSet xml:lang="en-US"><descripGrp><descrip type="definition">To shorten the fractional part of a number, increasing the last remaining (rightmost) digit or not, according to whether the deleted portion was over or under five.</descrip></descripGrp><ntig><termGrp><term id="106184">round</term><termNote type="partOfSpeech">Verb</termNote></termGrp></ntig></langSet><langSet xml:lang="fr-fr"><ntig><termGrp><term id="106187">arrondir</term><termNote type="partOfSpeech">Verb</termNote></termGrp></ntig></langSet></termEntry><termEntry id="4_156085"><langSet xml:lang="en-US"><descripGrp><descrip type="definition">Personally identifiable information (PII) that is protected in special ways by law or policy.</descrip></descripGrp><ntig><termGrp><term id="156085">sensitive data</term><termNote type="partOfSpeech">Noun</termNote></termGrp></ntig></langSet><langSet xml:lang="fr-fr"><ntig><termGrp><term id="156096">données sensibles</term><termNote type="partOfSpeech">Noun</termNote></termGrp></ntig></langSet></termEntry><termEntry id="5_182425"><langSet xml:lang="en-US"><descripGrp><descrip type="definition">A business unit that is immediately under another business unit in the business hierarchy of an organization.</descrip></descripGrp><ntig><termGrp><term id="182425">child business unit</term><termNote type="partOfSpeech">Noun</termNote></termGrp></ntig></langSet><langSet xml:lang="fr-fr"><ntig><termGrp><term id="182429">sous-division</term><termNote type="partOfSpeech">Noun</termNote></termGrp></ntig></langSet></termEntry><termEntry id="7_96886"><langSet xml:lang="en-US"><descripGrp><descrip type="definition">The mode of a command-line application where it does not display confirmation messages or any other user interface items that normally appear on screen. The switch for quiet mode is typically q.</descrip></descripGrp><ntig><termGrp><term id="96886">quiet mode</term><termNote type="partOfSpeech">Noun</termNote></termGrp></ntig></langSet><langSet xml:lang="fr-fr"><ntig><termGrp><term id="212192">mode silencieux</term><termNote type="partOfSpeech">Noun</termNote></termGrp></ntig></langSet></termEntry><termEntry id="9_179350"><langSet xml:lang="en-US"><descripGrp><descrip type="definition">A virtual hard disk that points to and uses an entire physical disk for the purpose of converting a data disk to a virtual hard disk. You cannot turn on a virtual machine if a linked disk is attached to the virtual machine.</descrip></descripGrp><ntig><termGrp><term id="179350">linked virtual hard disk</term><termNote type="partOfSpeech">Noun</termNote></termGrp></ntig></langSet><langSet xml:lang="fr-fr"><ntig><termGrp><term id="179352">disque dur virtuel lié</term><termNote type="partOfSpeech">Noun</termNote></termGrp></ntig></langSet></termEntry><termEntry id="10_307453"><langSet xml:lang="en-US"><descripGrp><descrip type="definition">An interface that is used to navigate the menus of a Unified Messaging (UM) system using DTMF or touchtone inputs.</descrip></descripGrp><ntig><termGrp><term id="307453">Telephone User Interface</term><termNote type="partOfSpeech">Proper Noun</termNote></termGrp></ntig></langSet><langSet xml:lang="fr-fr"><ntig><termGrp><term id="318298">interface utilisateur de téléphonie</term><termNote type="partOfSpeech">Noun</termNote></termGrp></ntig></langSet></termEntry><termEntry id="10_307467"><langSet xml:lang="en-US"><descripGrp><descrip type="definition">An interface that is used to navigate the menus of a Unified Messaging (UM) system using DTMF or touchtone inputs.</descrip></descripGrp><ntig><termGrp><term id="307467">TUI</term><termNote type="partOfSpeech">Noun</termNote></termGrp></ntig></langSet><langSet xml:lang="fr-fr"><ntig><termGrp><term id="318299">TUI</term><termNote type="partOfSpeech">Noun</termNote></termGrp></ntig></langSet></termEntry><termEntry id="10_1218391"><langSet xml:lang="en-US"><descripGrp><descrip type="definition">An interface that is used to navigate the menus of a Unified Messaging (UM) system using DTMF or touchtone inputs.</descrip></descripGrp><ntig><termGrp><term id="1218391">touchtone interface</term><termNote type="partOfSpeech">Noun</termNote></termGrp></ntig></langSet><langSet xml:lang="fr-fr"><ntig><termGrp><term id="1783210">interface à tonalité</term><termNote type="partOfSpeech">Noun</termNote></termGrp></ntig></langSet></termEntry>
|
34
34
|
<termEntry id="12_233129">
|
35
35
|
<langSet xml:lang="en-US">
|
36
36
|
<descripGrp>
|
data/spec/tbx_importer_spec.rb
CHANGED
@@ -53,7 +53,7 @@ describe TbxImporter do
|
|
53
53
|
it 'imports a UTF-8 TBX file 6' do
|
54
54
|
file_path = File.expand_path('../tbx_importer/spec/sample_files/sample_1(utf-8).tbx')
|
55
55
|
tbx = TbxImporter::Tbx.new(file_path: file_path).import
|
56
|
-
expect(tbx[0][4][1]).to eq("The mode of a command-line application where it does not display confirmation messages or any other user interface items that normally appear on screen. The switch for quiet mode is typically
|
56
|
+
expect(tbx[0][4][1]).to eq("The mode of a command-line application where it does not display confirmation messages or any other user interface items that normally appear on screen. The switch for quiet mode is typically q.")
|
57
57
|
end
|
58
58
|
|
59
59
|
it 'imports a UTF-16 TBX file' do
|