latex-decode 0.0.12-java
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/Gemfile +10 -0
- data/LICENSE +621 -0
- data/README.md +63 -0
- data/features/brackets.feature +11 -0
- data/features/diacritics.feature +40 -0
- data/features/non-latex.feature +15 -0
- data/features/punctuation.feature +46 -0
- data/features/special_characters.feature +20 -0
- data/features/step_definitions/latex.rb +7 -0
- data/features/support/env.rb +1 -0
- data/features/umlauts.feature +11 -0
- data/latex-decode.gemspec +39 -0
- data/lib/latex/decode.rb +49 -0
- data/lib/latex/decode/accents.rb +36 -0
- data/lib/latex/decode/base.rb +60 -0
- data/lib/latex/decode/compatibility.rb +59 -0
- data/lib/latex/decode/diacritics.rb +46 -0
- data/lib/latex/decode/punctuation.rb +57 -0
- data/lib/latex/decode/symbols.rb +223 -0
- data/lib/latex/decode/version.rb +5 -0
- metadata +143 -0
@@ -0,0 +1,46 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
|
3
|
+
module LaTeX
|
4
|
+
module Decode
|
5
|
+
|
6
|
+
class Diacritics < Decoder
|
7
|
+
@macros = Hash[*%W{
|
8
|
+
r \u030A
|
9
|
+
H \u030B
|
10
|
+
u \u0306
|
11
|
+
v \u030C
|
12
|
+
G \u030F
|
13
|
+
M \u0322
|
14
|
+
d \u0323
|
15
|
+
c \u0327
|
16
|
+
k \u0328
|
17
|
+
b \u0331
|
18
|
+
B \u0335
|
19
|
+
t \u0361
|
20
|
+
}.map { |s| LaTeX.to_unicode(s) }].freeze
|
21
|
+
|
22
|
+
@map = @macros.merge(Hash[*%w{
|
23
|
+
l ł
|
24
|
+
L Ł
|
25
|
+
o ø
|
26
|
+
O Ø
|
27
|
+
AA Å
|
28
|
+
aa å
|
29
|
+
AE Æ
|
30
|
+
ae æ
|
31
|
+
}]).freeze
|
32
|
+
|
33
|
+
@patterns = [
|
34
|
+
ruby_18 {
|
35
|
+
/\\(#{ @macros.keys.map { |k| Regexp.escape(k) }.join('|') })\{([[:alpha:]]?)([[:alpha:]]*)\}/ou
|
36
|
+
} ||
|
37
|
+
ruby_19 {
|
38
|
+
/\\(#{ @macros.keys.map { |k| Regexp.escape(k) }.join('|') })\{(\p{L}\p{M}*)([[:alpha:]]*)\}/ou
|
39
|
+
},
|
40
|
+
/\\(o|O|l|L|aa|AA|ae|AE)\b/,
|
41
|
+
].freeze
|
42
|
+
|
43
|
+
end
|
44
|
+
|
45
|
+
end
|
46
|
+
end
|
@@ -0,0 +1,57 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
|
3
|
+
module LaTeX
|
4
|
+
module Decode
|
5
|
+
|
6
|
+
class Punctuation < Decoder
|
7
|
+
|
8
|
+
@macros = Hash[*%w{
|
9
|
+
textendash –
|
10
|
+
textemdash —
|
11
|
+
textquoteleft ‘
|
12
|
+
textquoteright ’
|
13
|
+
quotesinglbase ‚
|
14
|
+
textquotedblleft “
|
15
|
+
textquotedblright ”
|
16
|
+
quotedblbase „
|
17
|
+
dag †
|
18
|
+
ddag ‡
|
19
|
+
textbullet •
|
20
|
+
dots …
|
21
|
+
textperthousand ‰
|
22
|
+
textpertenthousand ‱
|
23
|
+
guilsinglleft ‹
|
24
|
+
guilsinglright ›
|
25
|
+
textreferencemark ※
|
26
|
+
textinterrobang ‽
|
27
|
+
textoverline ‾
|
28
|
+
langle ⟨
|
29
|
+
rangle ⟩
|
30
|
+
textasciicircum ^
|
31
|
+
textbackslash \\
|
32
|
+
textasciitilde ~
|
33
|
+
}].freeze
|
34
|
+
|
35
|
+
@symbols = Hash[*%w[
|
36
|
+
- -
|
37
|
+
-- –
|
38
|
+
--- —
|
39
|
+
`` “
|
40
|
+
` ‘
|
41
|
+
'' ”
|
42
|
+
' ’
|
43
|
+
]].freeze
|
44
|
+
|
45
|
+
@map = @macros.merge(@symbols).freeze
|
46
|
+
|
47
|
+
@patterns = [
|
48
|
+
/\\(#{ @macros.keys.map { |k| Regexp.escape(k) }.compact.join('|') })(?:\{\}|\s+|\b|$)/ou,
|
49
|
+
/(-+|`{1,2}|'{1,2})/,
|
50
|
+
/()\\([$%#_&])(\{\})?/,
|
51
|
+
/()\\(~)\{\}/
|
52
|
+
].freeze
|
53
|
+
|
54
|
+
end
|
55
|
+
|
56
|
+
end
|
57
|
+
end
|
@@ -0,0 +1,223 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
|
3
|
+
module LaTeX
|
4
|
+
module Decode
|
5
|
+
|
6
|
+
class Symbols < Decoder
|
7
|
+
@map = Hash[*%w{
|
8
|
+
textcolonmonetary ₡
|
9
|
+
textlira ₤
|
10
|
+
textnaira ₦
|
11
|
+
textwon ₩
|
12
|
+
textdong ₫
|
13
|
+
euro €
|
14
|
+
texteuro €
|
15
|
+
textnumero №
|
16
|
+
texttrademark ™
|
17
|
+
leftarrow ←
|
18
|
+
uparrow ↑
|
19
|
+
rightarrow →
|
20
|
+
downarrow ↓
|
21
|
+
leftrightarrow ↔
|
22
|
+
updownarrow ↕
|
23
|
+
leadsto ↝
|
24
|
+
rightleftharpoons ⇌
|
25
|
+
Rightarrow ⇒
|
26
|
+
Leftrightarrow ⇔
|
27
|
+
forall ∀
|
28
|
+
complement ∁
|
29
|
+
partial ∂
|
30
|
+
exists ∃
|
31
|
+
nexists ∄
|
32
|
+
set ∅
|
33
|
+
Delta ∆
|
34
|
+
nabla ∇
|
35
|
+
in ∈
|
36
|
+
notin ∉
|
37
|
+
ni ∋
|
38
|
+
prod ∏
|
39
|
+
coprod ∐
|
40
|
+
sum ∑
|
41
|
+
mp ∓
|
42
|
+
dotplus ∔
|
43
|
+
setminus ∖
|
44
|
+
ast ∗
|
45
|
+
circ ∘
|
46
|
+
bullet ∙
|
47
|
+
surd √
|
48
|
+
propto ∝
|
49
|
+
infty ∞
|
50
|
+
angle ∠
|
51
|
+
measuredangle ∡
|
52
|
+
sphericalangle ∢
|
53
|
+
mid ∣
|
54
|
+
nmid ∤
|
55
|
+
parallel ∥
|
56
|
+
nparallel ∦
|
57
|
+
wedge ∧
|
58
|
+
vee ∨
|
59
|
+
cap ∩
|
60
|
+
cup ∪
|
61
|
+
int ∫
|
62
|
+
iint ∬
|
63
|
+
iiint ∭
|
64
|
+
oint ∮
|
65
|
+
therefore ∴
|
66
|
+
because ∵
|
67
|
+
sim ∼
|
68
|
+
backsim ∽
|
69
|
+
wr ≀
|
70
|
+
nsim ≁
|
71
|
+
simeq ≃
|
72
|
+
cong ≅
|
73
|
+
ncong ≇
|
74
|
+
approx ≈
|
75
|
+
approxeq ≊
|
76
|
+
asymp ≍
|
77
|
+
Bumpeq ≎
|
78
|
+
bumpeq ≏
|
79
|
+
doteq ≐
|
80
|
+
doteqdot ≑
|
81
|
+
fallingdotseq ≒
|
82
|
+
risingdotseq ≓
|
83
|
+
eqcirc ≖
|
84
|
+
circeq ≗
|
85
|
+
triangleq ≜
|
86
|
+
neq ≠
|
87
|
+
equiv ≡
|
88
|
+
leq ≤
|
89
|
+
geq ≥
|
90
|
+
leqq ≦
|
91
|
+
geqq ≧
|
92
|
+
lneqq ≨
|
93
|
+
gneqq ≩
|
94
|
+
ll ≪
|
95
|
+
gg ≫
|
96
|
+
between ≬
|
97
|
+
nless ≮
|
98
|
+
ngtr ≯
|
99
|
+
nleq ≰
|
100
|
+
ngeq ≱
|
101
|
+
lesssim ≲
|
102
|
+
gtrsim ≳
|
103
|
+
lessgtr ≶
|
104
|
+
gtrless ≷
|
105
|
+
prec ≺
|
106
|
+
succ ≻
|
107
|
+
preccurlyeq ≼
|
108
|
+
succcurlyeq ≽
|
109
|
+
precsim ≾
|
110
|
+
succsim ≿
|
111
|
+
nprec ⊀
|
112
|
+
nsucc ⊁
|
113
|
+
subset ⊂
|
114
|
+
supset ⊃
|
115
|
+
subseteq ⊆
|
116
|
+
supseteq ⊇
|
117
|
+
nsubseteq ⊈
|
118
|
+
nsupseteq ⊉
|
119
|
+
subsetneq ⊊
|
120
|
+
supsetneq ⊋
|
121
|
+
uplus ⊎
|
122
|
+
sqsubset ⊏
|
123
|
+
sqsupset ⊐
|
124
|
+
sqsubseteq ⊑
|
125
|
+
sqsupseteq ⊒
|
126
|
+
sqcap ⊓
|
127
|
+
sqcup ⊔
|
128
|
+
oplus ⊕
|
129
|
+
ominus ⊖
|
130
|
+
otimes ⊗
|
131
|
+
oslash ⊘
|
132
|
+
odot ⊙
|
133
|
+
circledcirc ⊚
|
134
|
+
circledast ⊛
|
135
|
+
circleddash ⊝
|
136
|
+
boxplus ⊞
|
137
|
+
boxminus ⊟
|
138
|
+
boxtimes ⊠
|
139
|
+
boxdot ⊡
|
140
|
+
vdash ⊢
|
141
|
+
dashv ⊣
|
142
|
+
top ⊤
|
143
|
+
bot ⊥
|
144
|
+
Vdash ⊩
|
145
|
+
Vvdash ⊪
|
146
|
+
nVdash ⊮
|
147
|
+
lhd ⊲
|
148
|
+
rhd ⊳
|
149
|
+
unlhd ⊴
|
150
|
+
unrhd ⊵
|
151
|
+
multimap ⊸
|
152
|
+
intercal ⊺
|
153
|
+
veebar ⊻
|
154
|
+
barwedge ⊼
|
155
|
+
bigwedge ⋀
|
156
|
+
bigvee ⋁
|
157
|
+
bigcap ⋂
|
158
|
+
bigcup ⋃
|
159
|
+
diamond ⋄
|
160
|
+
cdot ⋅
|
161
|
+
star ⋆
|
162
|
+
divideontimes ⋇
|
163
|
+
bowtie ⋈
|
164
|
+
ltimes ⋉
|
165
|
+
rtimes ⋊
|
166
|
+
leftthreetimes ⋋
|
167
|
+
rightthreetimes ⋌
|
168
|
+
backsimeq ⋍
|
169
|
+
curlyvee ⋎
|
170
|
+
curlywedge ⋏
|
171
|
+
Subset ⋐
|
172
|
+
Supset ⋑
|
173
|
+
Cap ⋒
|
174
|
+
Cup ⋓
|
175
|
+
pitchfork ⋔
|
176
|
+
lessdot ⋖
|
177
|
+
gtrdot ⋗
|
178
|
+
lll ⋘
|
179
|
+
ggg ⋙
|
180
|
+
lesseqgtr ⋚
|
181
|
+
gtreqless ⋛
|
182
|
+
curlyeqprec ⋞
|
183
|
+
curlyeqsucc ⋟
|
184
|
+
lnsim ⋦
|
185
|
+
gnsim ⋧
|
186
|
+
precnsim ⋨
|
187
|
+
succnsim ⋩
|
188
|
+
ntriangleleft ⋪
|
189
|
+
ntriangleright ⋫
|
190
|
+
ntrianglelefteq ⋬
|
191
|
+
ntrianglerighteq ⋭
|
192
|
+
vdots ⋮
|
193
|
+
cdots ⋯
|
194
|
+
ddots ⋱
|
195
|
+
lceil ⌈
|
196
|
+
rceil ⌉
|
197
|
+
lfloor ⌊
|
198
|
+
rfloor ⌋
|
199
|
+
Box □
|
200
|
+
spadesuit ♠
|
201
|
+
heartsuit ♡
|
202
|
+
diamondsuit ♢
|
203
|
+
clubsuit ♣
|
204
|
+
flat ♭
|
205
|
+
natural ♮
|
206
|
+
sharp ♯
|
207
|
+
tone5 ˥
|
208
|
+
tone4 ˦
|
209
|
+
tone3 ˧
|
210
|
+
tone2 ˨
|
211
|
+
tone1 ˩
|
212
|
+
ss ß
|
213
|
+
, \u2009
|
214
|
+
}].freeze
|
215
|
+
|
216
|
+
@patterns = [
|
217
|
+
/\\(#{ map.keys.map { |k| Regexp.escape(k) }.join('|') })(?:\{\}|\s+|\b)/ou
|
218
|
+
].freeze
|
219
|
+
|
220
|
+
end
|
221
|
+
|
222
|
+
end
|
223
|
+
end
|
metadata
ADDED
@@ -0,0 +1,143 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: latex-decode
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease:
|
5
|
+
version: 0.0.12
|
6
|
+
platform: java
|
7
|
+
authors:
|
8
|
+
- Sylvester Keil
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
|
13
|
+
date: 2012-02-08 00:00:00 Z
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: rake
|
17
|
+
prerelease: false
|
18
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
19
|
+
none: false
|
20
|
+
requirements:
|
21
|
+
- - ~>
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: "0.8"
|
24
|
+
type: :development
|
25
|
+
version_requirements: *id001
|
26
|
+
- !ruby/object:Gem::Dependency
|
27
|
+
name: bundler
|
28
|
+
prerelease: false
|
29
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
30
|
+
none: false
|
31
|
+
requirements:
|
32
|
+
- - ~>
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: "1.0"
|
35
|
+
type: :development
|
36
|
+
version_requirements: *id002
|
37
|
+
- !ruby/object:Gem::Dependency
|
38
|
+
name: rdoc
|
39
|
+
prerelease: false
|
40
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ~>
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: "3.6"
|
46
|
+
type: :development
|
47
|
+
version_requirements: *id003
|
48
|
+
- !ruby/object:Gem::Dependency
|
49
|
+
name: rspec
|
50
|
+
prerelease: false
|
51
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
52
|
+
none: false
|
53
|
+
requirements:
|
54
|
+
- - ~>
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
version: "2.6"
|
57
|
+
type: :development
|
58
|
+
version_requirements: *id004
|
59
|
+
- !ruby/object:Gem::Dependency
|
60
|
+
name: cucumber
|
61
|
+
prerelease: false
|
62
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
63
|
+
none: false
|
64
|
+
requirements:
|
65
|
+
- - ~>
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: "1.0"
|
68
|
+
type: :development
|
69
|
+
version_requirements: *id005
|
70
|
+
description: Decodes strings formatted in LaTeX to equivalent Unicode strings.
|
71
|
+
email:
|
72
|
+
- http://sylvester.keil.or.at
|
73
|
+
executables: []
|
74
|
+
|
75
|
+
extensions: []
|
76
|
+
|
77
|
+
extra_rdoc_files:
|
78
|
+
- README.md
|
79
|
+
- LICENSE
|
80
|
+
files:
|
81
|
+
- .gitignore
|
82
|
+
- Gemfile
|
83
|
+
- LICENSE
|
84
|
+
- README.md
|
85
|
+
- features/brackets.feature
|
86
|
+
- features/diacritics.feature
|
87
|
+
- features/non-latex.feature
|
88
|
+
- features/punctuation.feature
|
89
|
+
- features/special_characters.feature
|
90
|
+
- features/step_definitions/latex.rb
|
91
|
+
- features/support/env.rb
|
92
|
+
- features/umlauts.feature
|
93
|
+
- latex-decode.gemspec
|
94
|
+
- lib/latex/decode.rb
|
95
|
+
- lib/latex/decode/accents.rb
|
96
|
+
- lib/latex/decode/base.rb
|
97
|
+
- lib/latex/decode/compatibility.rb
|
98
|
+
- lib/latex/decode/diacritics.rb
|
99
|
+
- lib/latex/decode/punctuation.rb
|
100
|
+
- lib/latex/decode/symbols.rb
|
101
|
+
- lib/latex/decode/version.rb
|
102
|
+
homepage: http://github.com/inukshuk/latex-decode
|
103
|
+
licenses:
|
104
|
+
- GPL-3
|
105
|
+
post_install_message:
|
106
|
+
rdoc_options:
|
107
|
+
- --line-numbers
|
108
|
+
- --inline-source
|
109
|
+
- --title
|
110
|
+
- "\"LaTeX-Decode Documentation\""
|
111
|
+
- --main
|
112
|
+
- README.md
|
113
|
+
- --webcvs=http://github.com/inukshuk/latex-decode/tree/master/
|
114
|
+
require_paths:
|
115
|
+
- lib
|
116
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
117
|
+
none: false
|
118
|
+
requirements:
|
119
|
+
- - ">="
|
120
|
+
- !ruby/object:Gem::Version
|
121
|
+
version: "0"
|
122
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
123
|
+
none: false
|
124
|
+
requirements:
|
125
|
+
- - ">="
|
126
|
+
- !ruby/object:Gem::Version
|
127
|
+
version: "0"
|
128
|
+
requirements: []
|
129
|
+
|
130
|
+
rubyforge_project:
|
131
|
+
rubygems_version: 1.8.9
|
132
|
+
signing_key:
|
133
|
+
specification_version: 3
|
134
|
+
summary: Decodes LaTeX to Unicode.
|
135
|
+
test_files:
|
136
|
+
- features/brackets.feature
|
137
|
+
- features/diacritics.feature
|
138
|
+
- features/non-latex.feature
|
139
|
+
- features/punctuation.feature
|
140
|
+
- features/special_characters.feature
|
141
|
+
- features/step_definitions/latex.rb
|
142
|
+
- features/support/env.rb
|
143
|
+
- features/umlauts.feature
|