iT邦幫忙

2017 iT 邦幫忙鐵人賽
DAY 6
0
Cloud

Translate 翻譯雲系列 第 6

Day6-如何把單字匯到資料庫

WordWeb Developer:http://wordweb.info/developer/ ,其特色官網說明如下:
1.219000 word senses with sense number, word type, synonyms id, and usage flags (English varieties, vulgar/offensive)
2.Nouns, Verbs, Adjectives, Adverbs, Prepositions, Conjunctions, Pronouns, Interjections and others
3.130000 Definitions
4.49000 Usage examples
5.Related word tables for antonyms, similar words, type of, part of, types, parts, see also
6.116000 derived forms table with derived form (plural, past, past participle, etc) and roots
7.International - full coverage of American, British, Canadian, Asian and Australian spellings and words
當購買軟體後,它會寄給您一個下載檔案的網址,下載後將可以把它匯入到mysql內,將下載後的檔案解壓縮後,會看到下列的檔案清單。
http://ithelp.ithome.com.tw/upload/images/20170108/20003705zEWu5bcVcY.jpg
而主要是透過base.sql的檔案來做產生資料表與匯入資料的動作,但是可能會遇到下列的問題。
http://ithelp.ithome.com.tw/upload/images/20170108/20003705f4S5XqT36L.jpg
需要將其語法修改為 ( 主要是把後面修改為ENGINE=MyISAM,其它的地方也要修改)
create table word_senses (
word_sense mediumint unsigned not null,
equiv_word varchar (80) not null,
word varchar (80) not null,
word_type tinyint unsigned not null,
sense_no smallint unsigned default 1,
ID mediumint unsigned not null,
usage smallint unsigned default 0,
PRIMARY KEY(word_sense),
key word (word),
key equiv_word (equiv_word),
key ID (ID)
) ENGINE=MyISAM;

而接著會遇到無法匯入資料的問題,會因為路徑問題找不到所要匯入的檔案
http://ithelp.ithome.com.tw/upload/images/20170108/20003705f851UF4ayy.jpg

而我是把那幾個文字檔複製抓到phpmyadmin server下,在修改base.sql中所抓取的文字檔路徑指向server上的實際路徑,如此即可將這些資料匯入到mysql內


上一篇
Day5-自己建立翻譯單字資料庫
下一篇
Day7-Widget的使用
系列文
Translate 翻譯雲30
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言