From b3bdb8aa1501ed5842e6843db3b25994700d5933 Mon Sep 17 00:00:00 2001 From: Alexandre Courbot Date: Mon, 9 Nov 2009 13:05:24 +0900 Subject: [PATCH 1/9] Fixed components for 5c02 --- XML/5c02.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/XML/5c02.xml b/XML/5c02.xml index 9e810dd41..a60411c2c 100644 --- a/XML/5c02.xml +++ b/XML/5c02.xml @@ -27,9 +27,9 @@ See http://creativecommons.org/licenses/by-sa/3.0/ for more details. --> - - - + + + From 635bc7d34adc34873a3270d7b1c9b50aa499c158 Mon Sep 17 00:00:00 2001 From: Alexandre Courbot Date: Mon, 9 Nov 2009 13:05:40 +0900 Subject: [PATCH 2/9] Added 2 missing components --- SVG/200a4.svg | 45 +++++++++++++++++++++++++++++++++++++++++++ SVG/5c03.svg | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++ XML/200a4.xml | 28 +++++++++++++++++++++++++++ XML/5c03.xml | 38 ++++++++++++++++++++++++++++++++++++ 4 files changed, 164 insertions(+) create mode 100644 SVG/200a4.svg create mode 100644 SVG/5c03.svg create mode 100644 XML/200a4.xml create mode 100644 XML/5c03.xml diff --git a/SVG/200a4.svg b/SVG/200a4.svg new file mode 100644 index 000000000..2d3e62270 --- /dev/null +++ b/SVG/200a4.svg @@ -0,0 +1,45 @@ + + + + + + + + + + + + + 𠂤 + + + 1 + 2 + 3 + 4 + 5 + 6 + + + + + + + + + + diff --git a/SVG/5c03.svg b/SVG/5c03.svg new file mode 100644 index 000000000..41d9fddb6 --- /dev/null +++ b/SVG/5c03.svg @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + + + + + + + + + + + + + + diff --git a/XML/200a4.xml b/XML/200a4.xml new file mode 100644 index 000000000..a138b9250 --- /dev/null +++ b/XML/200a4.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + diff --git a/XML/5c03.xml b/XML/5c03.xml new file mode 100644 index 000000000..2478840a3 --- /dev/null +++ b/XML/5c03.xml @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + From 016c5fc2c353c4e51780d5aca5d58780781961d2 Mon Sep 17 00:00:00 2001 From: Alexandre Courbot Date: Mon, 9 Nov 2009 13:13:29 +0900 Subject: [PATCH 3/9] =?UTF-8?q?Fixed=20components=20using=20=E9=98=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- XML/57e0.xml | 14 ++++++++------ XML/961c.xml | 16 +++++++++------- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/XML/57e0.xml b/XML/57e0.xml index 7b6aea127..bc27c36f4 100644 --- a/XML/57e0.xml +++ b/XML/57e0.xml @@ -22,13 +22,15 @@ See http://creativecommons.org/licenses/by-sa/3.0/ for more details. --> - - + + + + - - - - + + + + diff --git a/XML/961c.xml b/XML/961c.xml index aec3cc2c6..a9feae427 100644 --- a/XML/961c.xml +++ b/XML/961c.xml @@ -15,14 +15,16 @@ Under the following conditions: See http://creativecommons.org/licenses/by-sa/3.0/ for more details. --> - - - + + + + + - - - - + + + + From e79df42b1ea8e458a56b0b8ff5e1729b5d8b0287 Mon Sep 17 00:00:00 2001 From: Alexandre Courbot Date: Mon, 9 Nov 2009 18:10:53 +0900 Subject: [PATCH 4/9] =?UTF-8?q?Fixed=20component=20information=20related?= =?UTF-8?q?=20to=20=E3=90=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SVG/342c.svg | 47 +++++++++++++++++++++++++++++++++++++ XML/342c.xml | 35 ++++++++++++++++++++++++++++ XML/65d2.xml | 26 +++++++++++---------- XML/68b3.xml | 2 +- XML/68c4.xml | 66 +++++++++++++++++++++++++++------------------------- XML/6bd3.xml | 2 +- XML/6d41.xml | 20 +++++++++------- XML/7409.xml | 2 +- XML/758f.xml | 2 +- XML/852c.xml | 4 ++-- XML/91af.xml | 26 +++++++++++---------- 11 files changed, 161 insertions(+), 71 deletions(-) create mode 100644 SVG/342c.svg create mode 100644 XML/342c.xml diff --git a/SVG/342c.svg b/SVG/342c.svg new file mode 100644 index 000000000..569e3dd63 --- /dev/null +++ b/SVG/342c.svg @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + 1 + 2 + 3 + 4 + 5 + 6 + 7 + + + + + + + + + + + diff --git a/XML/342c.xml b/XML/342c.xml new file mode 100644 index 000000000..12a5c9f23 --- /dev/null +++ b/XML/342c.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/XML/65d2.xml b/XML/65d2.xml index 2a9dbf41a..f32d4aa4a 100644 --- a/XML/65d2.xml +++ b/XML/65d2.xml @@ -29,21 +29,23 @@ See http://creativecommons.org/licenses/by-sa/3.0/ for more details. --> - - - - + + + + + + + + + + - - - + + + + - - - - - diff --git a/XML/68b3.xml b/XML/68b3.xml index 49797522d..c97f4762f 100644 --- a/XML/68b3.xml +++ b/XML/68b3.xml @@ -22,7 +22,7 @@ See http://creativecommons.org/licenses/by-sa/3.0/ for more details. --> - + diff --git a/XML/68c4.xml b/XML/68c4.xml index b60231722..ef0cfaa3f 100644 --- a/XML/68c4.xml +++ b/XML/68c4.xml @@ -16,45 +16,47 @@ Under the following conditions: See http://creativecommons.org/licenses/by-sa/3.0/ for more details. --> - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - + - - + + - - - diff --git a/XML/6bd3.xml b/XML/6bd3.xml index 4e689a555..e4a0def91 100644 --- a/XML/6bd3.xml +++ b/XML/6bd3.xml @@ -31,7 +31,7 @@ See http://creativecommons.org/licenses/by-sa/3.0/ for more details. --> - + diff --git a/XML/6d41.xml b/XML/6d41.xml index ff50d9e94..25c5c4f45 100644 --- a/XML/6d41.xml +++ b/XML/6d41.xml @@ -21,16 +21,18 @@ See http://creativecommons.org/licenses/by-sa/3.0/ for more details. --> - - - - + + + + + + + + + + - - - - - + diff --git a/XML/7409.xml b/XML/7409.xml index 2facbdde0..7cd92315f 100644 --- a/XML/7409.xml +++ b/XML/7409.xml @@ -22,7 +22,7 @@ See http://creativecommons.org/licenses/by-sa/3.0/ for more details. --> - + diff --git a/XML/758f.xml b/XML/758f.xml index 87b9d95e5..e3b570f56 100644 --- a/XML/758f.xml +++ b/XML/758f.xml @@ -27,7 +27,7 @@ See http://creativecommons.org/licenses/by-sa/3.0/ for more details. --> - + diff --git a/XML/852c.xml b/XML/852c.xml index 14e7aaca7..49736ebee 100644 --- a/XML/852c.xml +++ b/XML/852c.xml @@ -33,7 +33,7 @@ See http://creativecommons.org/licenses/by-sa/3.0/ for more details. --> - + @@ -50,6 +50,6 @@ See http://creativecommons.org/licenses/by-sa/3.0/ for more details. --> - + diff --git a/XML/91af.xml b/XML/91af.xml index 3127c3827..a62d2994f 100644 --- a/XML/91af.xml +++ b/XML/91af.xml @@ -33,21 +33,23 @@ See http://creativecommons.org/licenses/by-sa/3.0/ for more details. --> - - - - + + + + + + + + + + - - - + + + + - - - - - From 1c9e3c8866ae165fad5b2a6dad54204a90128807 Mon Sep 17 00:00:00 2001 From: Alexandre Courbot Date: Mon, 9 Nov 2009 18:42:02 +0900 Subject: [PATCH 5/9] =?UTF-8?q?Fixed=20=E5=8D=85=20related=20components?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- XML/4e17.xml | 2 +- XML/5345.xml | 2 +- XML/68c4.xml | 2 +- XML/6ede.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/XML/4e17.xml b/XML/4e17.xml index c0d858f25..9174cea38 100644 --- a/XML/4e17.xml +++ b/XML/4e17.xml @@ -40,7 +40,7 @@ See http://creativecommons.org/licenses/by-sa/3.0/ for more details. --> - + diff --git a/XML/5345.xml b/XML/5345.xml index 1e6fdb074..164a4ab37 100644 --- a/XML/5345.xml +++ b/XML/5345.xml @@ -31,7 +31,7 @@ See http://creativecommons.org/licenses/by-sa/3.0/ for more details. --> - + diff --git a/XML/68c4.xml b/XML/68c4.xml index ef0cfaa3f..1ba18446e 100644 --- a/XML/68c4.xml +++ b/XML/68c4.xml @@ -49,7 +49,7 @@ See http://creativecommons.org/licenses/by-sa/3.0/ for more details. --> - + diff --git a/XML/6ede.xml b/XML/6ede.xml index 9082e2ae8..8de7a2d70 100644 --- a/XML/6ede.xml +++ b/XML/6ede.xml @@ -45,7 +45,7 @@ See http://creativecommons.org/licenses/by-sa/3.0/ for more details. --> - + From 389f7739afe38d26f7d36a0b17f1795c35268cbd Mon Sep 17 00:00:00 2001 From: Alexandre Courbot Date: Tue, 10 Nov 2009 10:07:01 +0900 Subject: [PATCH 6/9] =?UTF-8?q?Fixed=20stroke=20order=20for=20=E5=8D=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SVG/5345.svg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SVG/5345.svg b/SVG/5345.svg index 9f07937c9..eccf8442a 100644 --- a/SVG/5345.svg +++ b/SVG/5345.svg @@ -33,9 +33,9 @@ See http://creativecommons.org/licenses/by-sa/3.0/ for more details. --> 4 + - From cd1898ec65314523e115636837afe9a82778ee71 Mon Sep 17 00:00:00 2001 From: Alexandre Courbot Date: Tue, 10 Nov 2009 10:21:29 +0900 Subject: [PATCH 7/9] Better calculation of multi-part components ancestor --- kanjivg.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/kanjivg.py b/kanjivg.py index c3c93af97..52487a0a4 100644 --- a/kanjivg.py +++ b/kanjivg.py @@ -34,8 +34,7 @@ Under the following conditions: See http://creativecommons.org/licenses/by-sa/3.0/ for more details.""" -def isKanji(c): - v = realord(c) +def isKanji(v): return (v >= 0x4E00 and v <= 0x9FC3) or (v >= 0x3400 and v <= 0x4DBF) or (v >= 0xF900 and v <= 0xFAD9) or (v >= 0x2E80 and v <= 0x2EFF) or (v >= 0x20000 and v <= 0x2A6DF) # Returns the unicode of a character in a unicode string, taking surrogate pairs into account @@ -252,6 +251,17 @@ class StructuredKanji: stk = [] self.__buildStructure(kanji.root, stk, None) + def __mostCommonAncestor(self, np, npp): + # Update the parent to the most common parent of all parts + npSave = np + if np != None: + while np != npp: + np = np.parent + if np == None: + npp = npp.parent + np = npSave + return np + def __buildStructure(self, group, stk, parent): # Find the component if it exists already, or create it as needed # Number exists and part is > 1, we must find a component which number matches. @@ -260,6 +270,7 @@ class StructuredKanji: for component in self.components: if component.element == group.element and component.number == group.number: newParent = component + component.parent = self.__mostCommonAncestor(component.parent, parent) break # Should never happen if not newParent: raise Exception("Unable to find component!") @@ -268,6 +279,7 @@ class StructuredKanji: for component in self.components: if component.element == group.element: newParent = component + component.parent = self.__mostCommonAncestor(component.parent, parent) break if not newParent: raise Exception("Unable to find component!") # Either a single part component or a first part - we need to create the component From 4bca006d1f8692446195fa34ee6ec6e5af19e5e4 Mon Sep 17 00:00:00 2001 From: Alexandre Courbot Date: Tue, 10 Nov 2009 10:23:04 +0900 Subject: [PATCH 8/9] Fixed stroke order for 825c --- SVG/852c.svg | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/SVG/852c.svg b/SVG/852c.svg index 8a319fbfb..fc2d4b693 100644 --- a/SVG/852c.svg +++ b/SVG/852c.svg @@ -47,6 +47,11 @@ See http://creativecommons.org/licenses/by-sa/3.0/ for more details. --> + + + + + @@ -54,10 +59,5 @@ See http://creativecommons.org/licenses/by-sa/3.0/ for more details. --> - - - - - From ef55b7ccc515e2211048c44c0005666078c525fe Mon Sep 17 00:00:00 2001 From: Alexandre Courbot Date: Thu, 19 Nov 2009 15:08:30 +0900 Subject: [PATCH 9/9] =?UTF-8?q?Fixed=20=E9=9D=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SVG/9766.svg | 7 ------- 1 file changed, 7 deletions(-) diff --git a/SVG/9766.svg b/SVG/9766.svg index e399e6040..0a612aac6 100644 --- a/SVG/9766.svg +++ b/SVG/9766.svg @@ -45,13 +45,6 @@ See http://creativecommons.org/licenses/by-sa/3.0/ for more details. --> 16 - - - - - - -