Форум русскоязычного сообщества Ubuntu


Хотите сделать посильный вклад в развитие Ubuntu и русскоязычного сообщества?
Помогите нам с документацией!

Автор Тема: Распознавание японских иероглифов (кандзи)  (Прочитано 5666 раз)

0 Пользователей и 1 Гость просматривают эту тему.

Оффлайн Jey

  • Автор темы
  • Новичок
  • *
  • Сообщений: 1
    • Просмотр профиля
Доброго времени суток!
Вот какое дело, Ubuntu 11.04 не распознает кандзи как  в названиях файлов и папок, которые были скопированы из окон, так и тех, которые были созданы уже в  самой Ubuntu.
Кану (фонетические азбуки) система распознает нормально, а вместо кандзи сплошные квадратики. Установил тучу языковых пакетов, но повлиял на решение проблемы только один, а именно "ttf-hanazono", после установки которого подавляющее большинство символов обрели читабельность.

 ibus включен, вводить он вводит, к примеру 漢字 (кандзи), но при этом в меню выбора вариантов иероглифического написания также квадратики вместо иероглифов...

Народ на японском форуме помогает, чем может, но и в родном сообществе тоже хотелось бы помощи получить )
Вот данные о которых спрашивали на японском форуме:

$ dpkg -l | grep ttf
ii  ttf-arphic-bkai00mp                   2.10-8                                     "AR PL KaitiM Big5" Chinese TrueType font by Arphic Technology
ii  ttf-arphic-gbsn00lp                   2.11-9                                     "AR PL SungtiL GB" Chinese TrueType font by Arphic Technology
ii  ttf-arphic-ukai                       0.2.20080216.1-1                           "AR PL UKai" Chinese Unicode TrueType font collection Kaiti style
ii  ttf-arphic-uming                      0.2.20080216.1-3ubuntu2                    "AR PL UMing" Chinese Unicode TrueType font collection Mingti style
ii  ttf-baekmuk                           2.2-3                                      Baekmuk series TrueType fonts
ii  ttf-dejavu-core                       2.31-1                                     Vera font family derivate with additional characters
ii  ttf-dejavu-extra                      2.31-1                                     Vera font family derivate with additional characters
ii  ttf-droid                             1.00~b112+dfsg+1-0ubuntu1                  handheld device font with extensive style and language support
ii  ttf-freefont                          20090104-7                                 Freefont Serif, Sans and Mono Truetype fonts
ii  ttf-hanazono                          20100718-1                                 Japanese TrueType font by KAGE system and FontForge
ii  ttf-indic-fonts-core                  1:0.5.11ubuntu1                            Core collection of free fonts for languages of India
ii  ttf-kacst-one                         4.0-0ubuntu1                               TrueType font designed for Arabic language
ii  ttf-khmeros-core                      5.0-3ubuntu1                               KhmerOS Unicode fonts for the Khmer language of Cambodia
ii  ttf-kochi-mincho                      20030809-9                                 Kochi Subst Mincho Japanese TrueType font without naga10
ii  ttf-lao                               0.0.20060226-7                             TrueType font for Lao language
ii  ttf-liberation                        1.05.2.20091019-4                          Fonts with the same metrics as Times, Arial and Courier
ii  ttf-mscorefonts-installer             3.3ubuntu3                                 Installer for Microsoft TrueType core fonts
ii  ttf-opensymbol                        2:2.4.3+LibO3.3.2-1ubuntu5                 OpenSymbol TrueType font
ii  ttf-punjabi-fonts                     1:0.5.11ubuntu1                            Free TrueType fonts for the Punjabi language
ii  ttf-sazanami-gothic                   20040629-8ubuntu1                          Sazanami Gothic Japanese TrueType font
ii  ttf-sazanami-mincho                   20040629-8ubuntu1                          Sazanami Mincho Japanese TrueType font
ii  ttf-symbol-replacement-wine1.3        1.3.22-0ubuntu1~ppa1~natty1                Free font with the same metrics as Symbol
ii  ttf-takao-gothic                      003.02.01-4ubuntu1                         Japanese TrueType font set, Takao Gothic Fonts
ii  ttf-takao-mincho                      003.02.01-4ubuntu1                         Japanese TrueType font set, Takao Mincho Fonts
ii  ttf-takao-pgothic                     003.02.01-4ubuntu1                         Japanese TrueType font set, Takao P Gothic Font
ii  ttf-thai-tlwg                         1:0.4.14-1                                 Thai fonts in TrueType format
ii  ttf-ubuntu-font-family                0.71.2-0ubuntu3                            Ubuntu Font Family, sans-serif typeface hinted for clarity
ii  ttf-umefont                           422-1                                      Japanese TrueType font, Ume-font
ii  ttf-unfonts                           1.0.3.is.1.0.1-0ubuntu1                    Metapackage to pull in -core and -extra
ii  ttf-unfonts-core                      1.0.3.is.1.0.1-0ubuntu1                    Un series Korean TrueType fonts
ii  ttf-unfonts-extra                     1.0.3.is.1.0.1-0ubuntu1                    Un series Korean TrueType fonts
ii  ttf-wqy-microhei                      0.2.0-beta-1                               A droid derived Sans-Seri style CJK font

fc-list :lang=ja

Ume Mincho S3,梅明朝S3:style=Regular
Droid Sans Fallback:style=Regular
Mona:style=Regular
Ume Gothic C4,梅ゴシックC4:style=Regular
Ume Gothic S4,梅ゴシックS4:style=Regular
Ume P Mincho,梅P明朝:style=Regular
Ume Mincho,梅明朝:style=Regular
文泉驛等寬微米黑,WenQuanYi Micro Hei Mono,文泉驿等宽微米黑:style=Regular
Droid Sans Japanese:style=Regular
HanaMin,花園明朝:style=Regular
Sazanami Mincho,さざなみ明朝:style=Regular,Mincho-Regular
Ume Gothic C5,梅ゴシックC5:style=Medium
Ume Gothic O5,梅ゴシックO5:style=Medium
Ume Gothic S5,梅ゴシックS5:style=Medium
TakaoPMincho,Takao P明朝:style=Regular
Kochi Gothic,東風ゴシック:style=Regular,標準
Kochi Mincho,東風明朝:style=Regular,標準
Ume P Gothic,梅Pゴシック:style=Regular
TakaoGothic,Takaoゴシック:style=Regular
Ume Gothic,梅ゴシック:style=Regular
VL PGothic,VL Pゴシック:style=regular
Ume P Gothic C5,梅PゴシックC5:style=Medium
Ume P Gothic O5,梅PゴシックO5:style=Medium
Ume P Gothic S5,梅PゴシックS5:style=Medium
Ume P Gothic C4,梅PゴシックC4:style=Regular
Ume P Gothic S4,梅PゴシックS4:style=Regular
Ume P Mincho S3,梅P明朝S3:style=Regular
文泉驛微米黑,WenQuanYi Micro Hei,文泉驿微米黑:style=Regular
Sazanami Gothic,さざなみゴシック:style=Regular,Gothic-Regular
TakaoPGothic,Takao Pゴシック:style=Regular
kiloji \- B,きろ字 \- B:style=Regular
kiloji \- D,きろ字 \- D:style=Regular
kiloji \- P,きろ字 \- P:style=Regular
kiloji,きろ字:style=Regular
TakaoExGothic,TakaoExゴシック:style=Regular
Ume UI Gothic,梅UIゴシック:style=Regular
TakaoExMincho,TakaoEx明朝:style=Regular
TakaoMincho,Takao明朝:style=Regular
Ume UI Gothic O5,梅UIゴシックO5:style=Medium
VL Gothic,VL ゴシック:style=regular





/etc/fonts/conf.d$ ls
10-antialias.conf                 64-ttf-thai-tlwg.conf
10-hinting.conf                   65-fonts-persian.conf
10-hinting-slight.conf            65-khmer.conf
11-lcd-filter-lcddefault.conf     65-nonlatin.conf
20-fix-globaladvance.conf         69-unifont.conf
20-unhint-small-vera.conf         70-no-bitmaps.conf
25-ttf-arphic-ukai-render.conf    75-ttf-arphic-ukai-select.conf
25-ttf-arphic-uming-render.conf   80-delicious.conf
30-defoma.conf                    89-ttf-thai-tlwg-synthetic.conf
30-metric-aliases.conf            90-synthetic.conf
30-urw-aliases.conf               90-ttf-arphic-ukai-embolden.conf
35-ttf-arphic-ukai-aliases.conf   90-ttf-arphic-uming-embolden.conf
35-ttf-arphic-uming-aliases.conf  90-ttf-bengali-fonts.conf
40-nonlatin.conf                  90-ttf-devanagari-fonts.conf
41-ttf-arphic-ukai.conf           90-ttf-gujarati-fonts.conf
41-ttf-arphic-uming.conf          90-ttf-kannada-fonts.conf
45-latin.conf                     90-ttf-malayalam-fonts.conf
49-sansserif.conf                 90-ttf-oriya-fonts.conf
50-user.conf                      90-ttf-punjabi-fonts.conf
51-local.conf                     90-ttf-tamil-fonts.conf
53-monospace-lcd-filter.conf      90-ttf-telugu-fonts.conf
60-latin.conf                     99pdftoopvp.conf
64-ttf-arphic-uming.conf          README

Переключение системы на японский язык тоже не помогает, проблема сохраняется. Казалось бы не критично, наутилус не видит всего пару-тройку иероглифов, но достаточно открыть японский форум, чтобы убедиться - беда...  Много неопознанных символов )

Загрузил некую kagedb на которую ссылается "ttf-hanazono'
~/
ls -R kage
kage:
CVS  kagedb

kage/CVS:
Entries  Entries.Log  Entries.Static  Repository  Root

kage/kagedb:
alias.txt  getaliastxt.pl  index.cgi       makeidsdb.pl    parts.txt
CVS        getpartstxt.pl  makealiasdb.pl  makepartsdb.pl  readme.en

kage/kagedb/CVS:
Entries  Repository  Root

/kage/kagedb/reamde.en
~/kage/kagedb$ cat readme.en
This directory holds the KAGE/DB files which contains data and
utilities.

* partsdb : Kanji parts database for KAGE/cgi

Get makepartsdb.pl and parts.txt, please type like follows.

    % perl makepartsdb.pl .

Then ''partsdb'' is to be created.

* aliasdb : Kanji parts alias database for KAGE/cgi

Get makealiasdb.pl and alias.txt, please type like follows.

    % perl makealiasdb.pl .

Then ''aliasdb'' is to be created.

* idsdb : Kanji alias IDS database for KAGE/cgi

Get makeidsdb.pl and CHISE/IDS data, please type like follows.

    % perl makeidsdb.pl .

Then ''idsdb'' is to be created.

 note: More information about CHISE/IDS data is avalable at
       http://www.kanji.zinbun.kyoto-u.ac.jp/projects/chise/ids/

* About KAGE/DB

Please see http://fonts.jp/index.php?KAGE%2Fcgi

(Only Japanese documents are avalable)

* License

This package is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.

This package is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
General Public License for more details.

You should have received a copy of the GNU General Public License
along with this package; see the file COPYING.  If not, write to
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.

При попытке выполнить инструкцию получается следующее:
perl makepartsdb.pl
Can't locate BerkeleyDB.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.10.1 /usr/local/share/perl/5.10.1 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl .) at makepartsdb.pl line 21.
BEGIN failed--compilation aborted at makepartsdb.pl line 21.

Вот содержимое файла:
cat makepartsdb.pl
###############################################################################
# makepartsdb.pl
#
#   create DB file for KAGE/cgi from parts.txt
#   by Koichi Kamichi
###############################################################################

if($#ARGV != 0 || !(-d $ARGV[0])){
print "Usage: perl makepartsdb.pl parts_dir\n";
exit;
}
$partsdir = $ARGV[0];
$partsdir =~ s/\/?$//; # remove the last slash

if(-e "partsdb"){
  print "Remove old partsdb first.\n";
exit;
}

use Fcntl;
use BerkeleyDB;

tie %db, "BerkeleyDB::Hash", -Filename => "partsdb", -Flags => DB_CREATE
or die "An error occured at ceating DB file.\n";
%db = ();

open(FH, "<$ARGV[0]/parts.txt");
@buffer = <FH>;

$counter = 1;

foreach(@buffer){
$_ =~ m/(.*?)\t(.*)\n/;
$key = $1;
$value = $2;
if($value ne ""){
print "\rcreating ... [$counter] key : $key      ";
$db{$key} = $value;
$counter++;
}
}

close(FH);
untie(%db);
print "\n\rdone.\n";

Версия perl:
perl -v

This is perl, v5.10.1 (*) built for x86_64-linux-gnu-thread-multi
(with 53 registered patches, see perl -V for more detail)

Copyright 1987-2009, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl".  If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.

Про BerkleyDB почитал, но не смог разобраться. Вобщем, вроде все что нужно, кажется, указал, прошу помощи ^^

З.Ы.: Мне не от балды приспичило, учусь по специальности "японский язык", для учебы необходимо решить проблему с распознаванием символов. Конечно, если уж совсем припрет скачаю японский дистрибутив, но хочется попробовать решить проблему в родном. Заранее спасибо за помощь =)
« Последнее редактирование: 29 Июня 2011, 03:49:28 от Jey »

 

Страница сгенерирована за 0.055 секунд. Запросов: 25.