# HG changeset patch # User Zoe Hong # Date 1425309414 -3600 # Node ID 4b6d2d7e706e893aac4a8af4b158f7088c217585 # Parent b55f5d3564c48c1930901a947e32a614dd517c8e update for the integration diff -r b55f5d3564c4 -r 4b6d2d7e706e develop/controllers/extractapp.php --- a/develop/controllers/extractapp.php Fri Feb 27 16:35:59 2015 +0100 +++ b/develop/controllers/extractapp.php Mon Mar 02 16:16:54 2015 +0100 @@ -131,7 +131,6 @@ case 'Update': $viewmodel->UpdateTagsInTopic($this->postdata); break; - default: $this->ReturnView($viewmodel->ConfigTagsInTopic($this->postdata), true); break; diff -r b55f5d3564c4 -r 4b6d2d7e706e develop/data/parsing_files/126434.txt --- a/develop/data/parsing_files/126434.txt Fri Feb 27 16:35:59 2015 +0100 +++ b/develop/data/parsing_files/126434.txt Mon Mar 02 16:16:54 2015 +0100 @@ -1,4 +1,5 @@ -【737】常州府志卷之十 物産 禮曰天時有生也地利有宜也天不生地不養君子 不以為禮則物宜所亟辨哉常郡屬古揚州而禹貢 所載貢物吾郡無一焉蓋吾郡之所生者日用飮食 之外無他奇似無足紀然書稱不貴異物賤用物民 乃足豈吾郡之謂乎兹於他郡所同有者紀於前吾 郡所獨有者紀於後即同為他郡所有而吾郡尤佳 者亦特表而出之作物産志 +【737】常州府志卷之十 +物産 禮曰天時有生也地利有宜也天不生地不養君子 不以為禮則物宜所亟辨哉常郡屬古揚州而禹貢 所載貢物吾郡無一焉蓋吾郡之所生者日用飮食 之外無他奇似無足紀然書稱不貴異物賤用物民 乃足豈吾郡之謂乎兹於他郡所同有者紀於前吾 郡所獨有者紀於後即同為他郡所有而吾郡尤佳 者亦特表而出之作物産志 〈榖之屬〉〈榖之屬〉 〈榖之屬〉〈榖之屬〉白稻 @@ -8,9 +9,8 @@ 〈榖之屬〉晚稻 〈榖之屬〉糯稻與他郡無異 〈榖之屬〉【738】 惟 -武進〈榖之屬〉香珠稻 -武進〈榖之屬〉紅蓮稻則産於 -武進武進者佳而秈米則歲以 二十石為 上供焉如 +〈榖之屬〉香珠稻 +〈榖之屬〉紅蓮稻則産於武進者佳而秈米則歲以 二十石為 上供焉如 〈榖之屬〉大麥 〈榖之屬〉小麥 〈榖之屬〉麥 @@ -25,198 +25,106 @@ 〈榖之屬〉僧衣豆 〈榖之屬〉豇豆 〈榖之屬〉豌豆 -〈榖之屬〉稨豆 -〈榖之屬〉芝麻 -〈榖之屬〉飯豆俱與他郡無異惟 -〈榖之屬〉白果豆則産於武進者 -〈榖之屬〉佳蠶豆 則産於無錫者佳 -〈蔬之屬〉〈蔬之屬〉 -〈蔬之屬〉如 -〈蔬之屬〉芹菜 -〈蔬之屬〉蔓菁 -〈蔬之屬〉韭薺 -〈蔬之屬〉塌科 -〈蔬之屬〉烏菘菜 -〈蔬之屬〉薹馬蘭 -〈蔬之屬〉茼蒿 -〈蔬之屬〉菠菜芫荽葱小蒜扁瓠茭白芥莧萵苣馬齒 -〈蔬之屬〉莧黄瓜 -〈蔬之屬〉茄子 -〈蔬之屬〉絲瓜 -〈蔬之屬〉南瓜 -〈蔬之屬〉牛角瓜 -〈蔬之屬〉香瓜 -〈蔬之屬〉冬瓜 -〈蔬之屬〉番瓜 -〈蔬之屬〉火菜 -〈蔬之屬〉白菜 -〈蔬之屬〉葫蘆 -〈蔬之屬〉刀豆 -〈蔬之屬〉莢茨 -〈蔬之屬〉 -〈蔬之屬〉荸薺 -〈蔬之屬〉香芋俱與他郡無異惟 -〈蔬之屬〉燕笋産於 【739】 江陰者隹 -〈蔬之屬〉毛笋產於宜興者隹 -〈蔬之屬〉萊菔蘿蔔 産於武進 之觀基者隹 -〈蔬之屬〉芋頭產於武進之馬山者隹蕈産於無 錫之惠山 -〈蔬之屬〉者隹竹茹産於宜興之南山者 -〈蔬之屬〉西瓜産 於武進之奔牛無錫之五牧江陰之青暘者隹 -〈蔬之屬〉大蒜 産於武進之横林者隹 -〈果之屬〉 -〈果之屬〉如 -〈果之屬〉棗栗 -〈果之屬〉 -〈果之屬〉 -〈果之屬〉 -〈果之屬〉枇杷 -〈果之屬〉 -〈果之屬〉 -〈果之屬〉梧桐 -〈果之屬〉石榴花紅嘉慶 子 -〈果之屬〉核桃 -〈果之屬〉葡萄 -〈果之屬〉銀杏 -〈果之屬〉蓮蓬 -〈果之屬〉實俱與他郡無異惟 -〈果之屬〉則 産於武進之孟河靖江之諸沙者隹 -〈果之屬〉櫻桃產於江陰 之青暘者隹 -〈果之屬〉楊梅産於武進之馬山者隹 -〈果之屬〉産於武進之蘆墅者隹 -【740】 -〈藥之屬〉〈藥之屬〉如 -〈藥之屬〉百合 -〈藥之屬〉〈藥之屬〉山藥 -〈藥之屬〉麥門冬 -〈藥之屬〉桔梗 -〈藥之屬〉枸杞 -〈藥之屬〉菖蒲 -〈藥之屬〉金銀花 -〈藥之屬〉櫻子 -〈藥之屬〉山查 -〈藥之屬〉决明 -〈藥之屬〉蒲公英皂角沙參稀薟蒼耳子大薊 小薊牽牛薄荷蛇牀子茴 -〈藥之屬〉香瞿 -〈藥之屬〉麥藿 -〈藥之屬〉香夏 -〈藥之屬〉枯草瓜簍 仁益母草山茨菰土茯苓五加皮水蓼浮萍羊蹄根 天花粉甘菊艾俱與他郡無異惟 -〈藥之屬〉紫蘇產於武進之 毘陵驛者隹 -〈藥之屬〉何首烏産於宜興之銅官者佳而武進 之馬山又有一種亦名何首烏或曰何首胡身如蘿 蔔而略細味甚甘美山人種之售於他邑多所獲利 -〈木之屬〉〈木之屬〉 -〈木之屬〉如 -〈木之屬〉 -〈木之屬〉 -〈木之屬〉榆槐椐石楠 -〈木之屬〉冬青 -〈木之屬〉棕櫚黄楊檉梓桐 杉椿桑柘樗樟楓楊柳楮樸槿楝烏柏烏穠糓檀櫟 -〈木之屬〉【741】 俱與他郡無異惟 -〈木之屬〉則産於宜興者佳其品類不一 而總名之日岕茶大約以高山者為上平原者為下 每當初夏商賈駢集官給茶引方敢出境 -〈竹之屬〉〈竹之屬〉 -〈竹之屬〉如 -〈竹之屬〉慈孝 -〈竹之屬〉紫竹 -〈竹之屬〉淡竹 -〈竹之屬〉金竹 -〈竹之屬〉剛竹 -〈竹之屬〉天竹 -〈竹之屬〉苦竹 -〈竹之屬〉木竹 -〈竹之屬〉鳯尾竹 -〈竹之屬〉烏筋竹 -〈竹之屬〉水竹 -〈竹之屬〉護基竹俱與他郡無異 -〈竹之屬〉惟 -〈竹之屬〉〈江陰〉燕竹 -〈竹之屬〉〈江陰〉班竹産於 -〈竹之屬〉〈江陰〉〈江陰〉者佳 -〈竹之屬〉毛竹産於宜興者佳 -〈竹之屬〉〈竹之屬〉其 -〈竹之屬〉班竹 -〈竹之屬〉毛竹 俱可為器物 -〈花之屬〉〈花之屬〉 -〈花之屬〉其已見果屬者不更載如 -〈花之屬〉芍藥 -〈花之屬〉山鵑萱夜合金 雀 -〈花之屬〉薔薇木香月季鐵線蓮 -〈花之屬〉罌粟虞美人佛見笑荼䕷 -諸葛菜金絲桃蝴蝶蜀葵錦葵剪春羅剪秋紗翠梅 -【742】 烏羢凌霄沃丹沃黄沃素玉簮長春玫瑰滴滴金千 日紫秋葵鳯仙雞冠荷包牡丹埭棠海棠俱與他郡 無異惟 -〈花之屬〉牡丹則産於江陰之虎涇口者隹多以芍藥 相接故花色甚不一 -〈花之屬〉石巖亦産於江陰之虎涇口沙山者佳 -〈花之屬〉菊花亦産於江陰者佳 -〈花之屬〉蘭蕙産於宜興諸山者佳 -〈花之屬〉杜鵑亦産於宜興者佳而惟南嶽一株為最古 -〈花之屬〉棉花雖各邑俱産而江靖尤多遠近交相貿易 +〈榖之屬〉稨豆芝麻飯 豆俱與他郡無異惟 +〈榖之屬〉白果豆則産於武進者 +〈榖之屬〉佳蠶豆 則産於無錫者佳 +〈蔬之屬〉 +如 +芹菜蔓菁韭薺塌科 +烏菘菜薹馬蘭茼蒿菠 菜芫荽葱小蒜扁瓠茭白芥莧萵苣馬齒 +莧黄瓜茄 +子絲瓜 +南瓜 +牛角瓜 +香瓜 +冬瓜 +番瓜 +火菜 +白菜葫蘆 +刀豆莢茨菇荸薺香芋俱與他郡無異惟燕笋産於 +【739】 江陰者隹毛笋產於宜興者隹萊菔 +即蘿 + 産於武進 之觀基者隹芋頭產於武進之馬山者隹蕈産於無 錫之惠山 +者隹竹茹産於宜興之南山者 +隹西瓜産 於武進之奔牛無錫之五牧江陰之青暘者隹大蒜 産於武進之横林者隹 +〈果之屬〉 +如棗栗梅杏李枇杷梨杮梧桐石榴花紅嘉慶 子核桃葡萄銀杏蓮蓬芡實俱與他郡無異惟桃則 産於武進之孟河靖江之諸沙者隹櫻桃產於江陰 之青暘者隹楊梅産於武進之馬山者隹菱産於武 進之蘆墅者隹 +【740】藥之屬如百合 +山藥麥門冬桔梗枸杞菖蒲金銀花金櫻子山查决明蒲公英皂角沙參稀薟蒼耳子大薊 小薊牽牛薄荷蛇牀子茴 +香瞿麥藿香夏 +枯草瓜簍 仁益母草山茨菰土茯苓五加皮水蓼浮萍羊蹄根 天花粉甘菊艾俱與他郡無異惟紫蘇產於武進之 毘陵驛者隹何首烏産於宜興之銅官者佳而武進 之馬山又有一種亦名何首烏或曰何首胡身如蘿 蔔而略細味甚甘美山人種之售於他邑多所獲利 +〈木之屬〉 +如松栢檜榆槐椐石楠冬青棕櫚黄楊檉梓桐 杉椿桑柘樗樟楓楊柳楮樸槿楝烏柏烏穠糓檀櫟 +【741】 俱與他郡無異惟茶則産於宜興者佳其品類不一 而總名之日岕茶大約以高山者為上平原者為下 每當初夏商賈駢集官給茶引方敢出境 +〈竹之屬〉 +如慈 +孝紫竹 +淡竹 +金竹 +剛竹 +天竹 +苦竹 +木竹鳯 +尾竹 +烏筋竹 +水竹 +護基竹俱與他郡無異 +惟燕竹班 竹産於江陰者 +佳毛竹産於宜興者佳 +其班竹 +毛竹 俱可為器物 +〈花之屬〉 +其已見果屬者不更載如芍藥山鵑萱夜合金 雀薔薇木香月季鐵線蓮罌粟虞美人佛見笑荼䕷 +諸葛菜金絲桃蝴蝶蜀葵錦葵剪春羅剪秋紗翠梅 +【742】 烏羢凌霄沃丹沃黄沃素玉簮長春玫瑰滴滴金千 日紫秋葵鳯仙雞冠荷包牡丹埭棠海棠俱與他郡 無異惟牡丹則産於江陰之虎涇口者隹多以芍藥 相接故花色甚不一石巖亦産於江陰之虎涇口沙 山者佳菊花亦産於江陰者佳蘭蕙産於宜興諸山 者佳杜鵑亦産於宜興者佳而惟南嶽一株為最古 棉花雖各邑俱産而江靖尤多遠近交相貿易 〈草之屬〉 -如千年蒀龍虎草游龍虎耳鳯尾吉祥翠雲繡 墩書帶芭蕉酸漿魚腥紅蓼辣蓼淡竹葉青苔薜荔 莎蓬蒿灰蓼俱與他郡無異惟 -黄麻席草則産於【743】無錫者佳黄麻漬水取皮織以為布蓆草織以為蓆藍 則産於江靖者多而且佳以之為靛利用甚溥 -〈禽之屬〉〈禽之屬〉 -〈禽之屬〉如 -〈禽之屬〉 -〈禽之屬〉 -〈禽之屬〉 -〈禽之屬〉鴿 -〈禽之屬〉雉竹 -〈禽之屬〉雞鵲 -〈禽之屬〉烏鴉鶯燕戴勝雀鳩鵓 鴣鸜鵒鵜鶘練雀百舌畫眉脊令啄木鷹鷺鷥鷗鴛 鴦黄頭偷倉鸕鷀俱與他郡無異惟 -〈禽之屬〉 俗名 野鴨 -〈禽之屬〉 俗名 水葫蘆産於武進之太湖滆湖者佳 -〈禽之屬〉産於武進之横 林無錫之五牧者佳以上數禽取其肥而可食 +如千年蒀龍虎草游龍虎耳鳯尾吉祥翠雲繡 墩書帶芭蕉 +酸漿魚腥紅蓼辣 +蓼淡竹葉青苔薜荔 莎蓬蒿灰蓼俱與他郡無異惟黄麻席草則産於無 +【743】 錫者佳黄麻漬水取皮織以為布蓆草織以為蓆藍 則産於江靖者多而且佳以之為靛利用甚溥 +〈禽之屬〉 +如雞鵝鴨 +鴿雉竹雞鵲烏鴉鶯燕戴勝雀鳩鵓 鴣鸜鵒鵜鶘練雀百舌畫眉脊令啄木鷹鷺鷥鷗鴛 鴦黄頭偷倉鸕鷀俱與他郡無異惟鶩 +俗名 +野鴨 + +俗名 +水葫 + 産於武進之太湖滆湖者佳黄雀産於武進之横 林無錫之五牧者佳以上數禽取其肥而可食 〈獸之屬〉 -如 - - -虎豹 -豕兔 -犬貓 -竹䶉 -獺獾俱與他郡無 異惟鹿獐鹿柿狐山牛野猪産於宜興諸山者佳而 可食 -【744】 -〈鱗之屬〉如鯉青魚鰱鯽鯶鯿鱸鮆鮎土鮒蝦虎黄䫙白 絲黑魚鰻鱔俱與他郡無異惟子魚河魨刀鱭鱠殘 塌沙蛼 俗名 昌蛾 鑊㔶鱘鮰蝗諸種産於武邑之孟河 虞塘及江靖兩邑者佳白魚至時雨後産於無錫溪 河及太湖者佳 -〈無錫〉〈太湖〉銀魚 -〈無錫〉〈太湖〉澤魚産於 -〈無錫〉〈太湖〉〈太湖〉及 -〈無錫〉〈無錫〉之鵝肫 蕩者佳 +如牛羊虎豹豕兔 +犬貓竹䶉獺獾俱與他郡無 異惟鹿獐鹿柿狐山牛野猪産於宜興諸山者佳而 +可食 +【744】鱗之屬如 +鯉青魚鰱鯽鯶鯿鱸鮆鮎土鮒蝦虎黄䫙白 +絲黑魚鰻鱔俱與他郡無異 +惟子魚河魨刀鱭鱠殘 塌沙蛼 +俗名 +昌蛾 鑊㔶鱘鮰蝗諸種産於武邑之孟河 虞塘及江靖兩邑者 +佳白魚至時雨後産於無錫溪 河及太湖者 +佳銀魚 +澤魚産於太湖及無錫之鵝肫 +蕩者佳 〈介之屬〉 -如鼋龜蝦蟛蜞鼈蚌蜆螺田螺俱與他郡無異 惟 -則産於武進之芙蓉湖 -名玉瓜者佳江陰之江 蟹尤巨 -〈蟲之屬〉〈蟲之屬〉 -〈蟲之屬〉如蠶蜂蛙蝦蟇蝌蚪蜥蜴蜘蛛䗪 俗名 地鱉 螟蛉 -〈蟲之屬〉【745】 菜花蟲螢蟬螻蟈螳螂蠅虎蠅螬蠐蚱蜢飛蛾蝸牛 壁虎黄蜂鐵嘴蜂蛇蜈蚣虱蚤蚊俱與他郡無異惟 -〈蟲之屬〉石曠一名石麟産於宜興山中食者以為佳 -〈布帛之屬〉〈布帛之屬〉 -〈布帛之屬〉如 -〈布帛之屬〉綾絹 -〈布帛之屬〉布苧之類與他郡無異惟 -〈布帛之屬〉武邑 之名東門闊者闊而甚細異於他織無錫之名蕩口 縑者細擘黄草合絲縷績之織成縑布靖江之麻布 麤細各種細者縝密可愛即麤者亦疏爽經久不敝 -〈工作之屬〉〈工作之屬〉 -〈工作之屬〉如 -〈工作之屬〉 -〈工作之屬〉 -〈工作之屬〉 -〈工作之屬〉 -〈工作之屬〉 -〈工作之屬〉 -〈工作之屬〉 -〈工作之屬〉 -〈工作之屬〉諸作俱與他郡無 異惟 -〈工作之屬〉無錫最擅名所云惠山三白 謂米白麴 白泉水白 臘月釀成以味清冽者為上奔走天下每歲數十萬 -【746】 斛不止窑作則宜興之缸甕罌缽壺諸器稱蜀山 窑者佳又有灰户伐石而焚炭户斵薪而火一郡資 之無錫則磚瓦窑磚瓦盛行於數百里內外又若石 作則宜興之石板可以蓋地無錫之陽山石可以為 磨為臼江陰之石堰石可以砌牆築岸皆工人终歲 勤劬以為業也 -〈器用之屬〉〈器用之屬〉 -〈器用之屬〉如 -〈器用之屬〉筆箋 -〈器用之屬〉扇箸 -〈器用之屬〉梳枕 -〈器用之屬〉以及 -〈器用之屬〉竹木器皿之類俱與 他郡無異惟燈則武邑有料絲燈初鈕姓獨擅其長 今則工是伎者甚衆厥製方圓不一又或為圍屏或 為對額夜燃膏燭瑩瑩洞徹山水人物花卉翎毛畢 -〈器用之屬〉【747】 具爭奇競巧歲歲不同惟 -〈器用之屬〉宜興有茶壺澄泥為 之始於供春而時大彬陳仲美陳用卿徐友泉輩踵 事增華并製為花罇菊合香盤十錦杯等物精美絕 倫四方皆爭購之他如 -〈器用之屬〉〈江陰〉蒲扇 -〈器用之屬〉〈江陰〉蒲蓆則 -〈器用之屬〉〈江陰〉〈江陰〉者佳 -〈器用之屬〉苧帨武進之驛前無錫之蕩口與靖江三者各佳 -〈器用之屬〉蒲鞋宜興之陳橋者佳 -【748】常州府志卷之十一 封系 考古封建所以親親尙賢也三代建國盛於西北而 東南則自泰伯季札始封至漢初猶循遺制從兹以 後有借一邑以為名實未嘗秉國之鈞食土之毛也 欲譜其流必溯其源自商周以迄後世其族之䌓簡 年之多寡莫不彰彰可考若夫齊以四代興梁以五 傳熾二代同姓各紀其始祖而餘略之蓋詳於史矣 作封系志 商 +如鼋龜蝦蟛蜞鼈蚌蜆螺田螺俱與他郡無異 惟蟹則産於武進之芙蓉湖 +名玉瓜者佳江陰之江 +蟹尤巨 +〈蟲之屬〉 +如蠶蜂蛙蝦蟇蝌蚪蜥蜴蜘蛛䗪 +俗名 +地鱉 +螟蛉 +【745】 菜花蟲螢蟬螻蟈螳螂蠅虎蠅螬蠐蚱蜢飛蛾蝸牛 壁虎黄蜂鐵嘴蜂蛇蜈蚣虱蚤蚊俱與他郡無異惟 石曠一名石麟産於宜興山中食者以為佳 +〈布帛之屬〉 +如綾絹布苧之類與他郡無異惟布則武邑 之名東門闊者闊而甚細異於他織無錫之名蕩口 縑者細擘黄草合絲縷績之織成縑布靖江之麻布 麤細各種細者縝密可愛即麤者亦疏爽經久不敝 +〈工作之屬〉 +如銀錫銅鐵木瓦石漆染諸作俱與他郡無 異惟酒作則無錫最擅名所云惠山三白 謂米白麴 白泉水白 臘月釀成以味清冽者為上奔走天下每歲數十萬 +【746】 斛不止窑作則宜興之缸甕罌缽壺諸器稱蜀山 窑者佳又有灰户伐石而焚炭户斵薪而火一郡資 之無錫則磚瓦窑磚瓦盛行於數百里內外又若石 作則宜興之石板可以蓋地無錫之陽山石可以為 磨為臼江陰之石堰石可以砌牆築岸皆工人终歲 勤劬以為業也 +〈器用之屬〉 +如筆箋扇箸梳枕 +以及竹木器皿之類俱與 他郡無異惟燈則武邑有料絲燈初鈕姓獨擅其長 今則工是伎者甚衆厥製方圓不一又或為圍屏或 為對額夜燃膏燭瑩瑩洞徹山水人物花卉翎毛畢 +【747】 具爭奇競巧歲歲不同惟壺則宜興有茶壺澄泥為 之始於供春而時大彬陳仲美陳用卿徐友泉輩踵 事增華并製為花罇菊合香盤十錦杯等物精美絕 倫四方皆爭購之他如蒲扇蒲蓆則江陰者佳苧帨 則武進之驛前無錫之蕩口與靖江三者各佳蒲鞋 則宜興之陳橋者佳 +【748】常州府志卷之十一 +封系 考古封建所以親親尙賢也三代建國盛於西北而 東南則自泰伯季札始封至漢初猶循遺制從兹以 後有借一邑以為名實未嘗秉國之鈞食土之毛也 欲譜其流必溯其源自商周以迄後世其族之䌓簡 年之多寡莫不彰彰可考若夫齊以四代興梁以五 傳熾二代同姓各紀其始祖而餘略之蓋詳於史矣 作封系志 + - diff -r b55f5d3564c4 -r 4b6d2d7e706e develop/data/regex_files/product_name.txt --- a/develop/data/regex_files/product_name.txt Fri Feb 27 16:35:59 2015 +0100 +++ b/develop/data/regex_files/product_name.txt Mon Mar 02 16:16:54 2015 +0100 @@ -1,1 +1,1 @@ - 物產名 \ No newline at end of file + 物產名 \ No newline at end of file diff -r b55f5d3564c4 -r 4b6d2d7e706e develop/data/regex_files/product_name_started_with_space.txt --- a/develop/data/regex_files/product_name_started_with_space.txt Fri Feb 27 16:35:59 2015 +0100 +++ b/develop/data/regex_files/product_name_started_with_space.txt Mon Mar 02 16:16:54 2015 +0100 @@ -1,1 +1,1 @@ - 空白 物產 \ No newline at end of file + 空白 物產 空白 \ No newline at end of file diff -r b55f5d3564c4 -r 4b6d2d7e706e develop/index.php --- a/develop/index.php Fri Feb 27 16:35:59 2015 +0100 +++ b/develop/index.php Mon Mar 02 16:16:54 2015 +0100 @@ -19,8 +19,6 @@ require("controllers/home.php"); require("controllers/extractapp.php"); - - // create the controller and execute the action $loader = new Loader($_GET, $_POST); diff -r b55f5d3564c4 -r 4b6d2d7e706e develop/js/taggingtext.js --- a/develop/js/taggingtext.js Fri Feb 27 16:35:59 2015 +0100 +++ b/develop/js/taggingtext.js Mon Mar 02 16:16:54 2015 +0100 @@ -761,7 +761,7 @@ var el = document.getElementById("listNameText"); $.ajax({ //url : '../../models/_extractapp_func.php', - url : './EditWordlist', + url : './Editwordlist', async : false, type : 'POST', data : 'func=AddNewList'+'&text='+el.value, @@ -781,7 +781,7 @@ function saveWordlist(id ) { var el = document.getElementById("editable-area"); $.ajax({ - url : './EditWordlist', + url : './Editwordlist', async : false, type : 'POST', data : 'func=SaveWordlist'+'&text='+el.innerHTML+'&filename='+id, diff -r b55f5d3564c4 -r 4b6d2d7e706e develop/models/extractapp.php --- a/develop/models/extractapp.php Fri Feb 27 16:35:59 2015 +0100 +++ b/develop/models/extractapp.php Mon Mar 02 16:16:54 2015 +0100 @@ -25,6 +25,13 @@ $this->file_id = $file_id; $this->user_id = $_postdata['userId']; $this->section_id = $section_id; + + + // TODO: get info from LGService + $this->section_name = $_postdata['sectionName']; + $this->book_id = $_postdata['bookId']; + $this->book_name = $_postdata['bookName']; + // get from URL with file_id $lg_text_url = $this->get_text_from_fileId_url.$file_id; @@ -46,6 +53,13 @@ $this->section_id = $section_id; $this->user_id = $_postdata['userId']; + // TODO: get info from LGService + $this->section_name = $_postdata['sectionName']; + $this->book_id = $_postdata['bookId']; + $this->book_name = $_postdata['bookName']; + + + // get from URL with file_id $lg_text_url = $this->get_text_from_sectionId_url.$section_id; $lg_text = file_get_contents($lg_text_url); @@ -88,9 +102,23 @@ $this->topic = $_postdata['topic_id']; } + // TODO: LGService + if ($_postdata['sectionName']) { + $this->section_name = $_postdata['sectionName']; + } + if ($_postdata['bookName']) { + $this->book_name = $_postdata['bookName']; + } + if ($_postdata['bookId']) { + $this->book_id = $_postdata['bookId']; + } + $this->messages .= "Info: "; $this->messages .= "file_id=".$this->file_id.", section_id=".$this->section_id; - $this->messages .= ", user_id=".$this->user_id.", branch_id=".$this->branch_id.", topic_id=".$this->topic."
"; + $this->messages .= ", user_id=".$this->user_id.", branch_id=".$this->branch_id.", topic_id=".$this->topic; + $this->messages .= ", book_id=".$this->book_id.", book_name=".$this->book_name.", section_name=".$this->section_name."
"; + + } public function InitData($_postdata) { @@ -164,7 +192,7 @@ $data['topic_tag'] = $this->GetTopicTag($this->GetTopic()); $data['topic_name'] = $this->GetTopicName($this->GetTopic()); - $data['info'] = array('file_id'=>$this->file_id, 'user_id'=>$this->user_id, 'branch_id'=>$this->branch_id, 'section_id'=>$this->section_id); + $data['info'] = array('file_id'=>$this->file_id, 'user_id'=>$this->user_id, 'branch_id'=>$this->branch_id, 'section_id'=>$this->section_id, 'book_id'=>$this->book_id, 'book_name'=>$this->book_name, 'section_name'=>$this->section_name); $data['messages'] = $this->messages; return $data; @@ -202,20 +230,31 @@ $this->file_id = (string)$response_file["id"]; $this->branch_id = (string)$response_branch["id"]; + + + + $status = (string)$response["status"]; + if ($status == "ok") { + $this->messages .= "saving success."; + + } else if ($status == "error") { + // saving not success + $this->messages .= "saving does not success! ".(string)$response["message"]; - //$this->messages .= "file_id: ".$this->file_id."
"; - //$this->messages .= "branch_id: ".$this->branch_id."
"; + + } + } public function SaveFullTextToLGService($_postdata) { // save tagged text (full text) by Jorge's API to lg service // -------- - // saving in my local machine in developing phrase if ($_postdata['text']){ $date = date('Y_m_d_H_i_s', time()); if ( file_exists("data/parsing_files/".$_postdata['sectionId'].".txt") ) { $oldFile = file_get_contents("data/parsing_files/".$_postdata['sectionId'].".txt"); + //saving in my local machine in developing phrase file_put_contents("data/parsing_files/".$_postdata['sectionId']."_".$date.".txt", $oldFile); } @@ -230,6 +269,7 @@ $require = preg_replace("/○/u", " ", $require); $require = preg_replace("/
/u", "\n", $require); $require = preg_replace("/
/u", "\n", $require); + //saving in my local machine in developing phrase file_put_contents("data/parsing_files/".$_postdata['sectionId'].".txt", $require); } @@ -250,13 +290,18 @@ } else { // new branch case echo "saveNew!"; + if ($_postdata['userId']) { + $user_id = $_postdata['userId']; + } else { + $user_id = "12"; + } $postfields = array( //"text" => $_postdata['text'], "text" => $require, "sectionId" => $_postdata['sectionId'], //"userId" => $_postdata['userId'], // TODO: change userId when we can query by sectionId from LGService using search - "userId" => "12", + "userId" => $user_id, "label" => $_postdata['label'], // TODO: ask user for lable //"label" => "label for section ".$_postdata['sectionId'], @@ -376,7 +421,14 @@ //$section_id = $this->section_id; - // TODO: this should be get from LGServic: sectionName, bookId, bookName + // TODO: this should be get from LGService: sectionName, bookId, bookName + $sectionName = $postdata['sectionName']; + $bookId = $postdata['bookId']; + $bookName = $postdata['bookName']; + + + // --- replace if get info from LGService + /* $section_info = $this->GetSectionInfo(); $sectionName = $section_info['sectionName']; @@ -384,6 +436,7 @@ $books_info = $this->GetBooksInfo($bookId); $bookName = $books_info['bookName']; + */ // ===== diff -r b55f5d3564c4 -r 4b6d2d7e706e develop/views/Extractapp/taggingtext.php --- a/develop/views/Extractapp/taggingtext.php Fri Feb 27 16:35:59 2015 +0100 +++ b/develop/views/Extractapp/taggingtext.php Mon Mar 02 16:16:54 2015 +0100 @@ -8,8 +8,7 @@ $default_topic_id = $viewmodel['default_topic_id']; $topic_name = $viewmodel['topic_name']; $topic_tag = $viewmodel['topic_tag']; -$info = $viewmodel['info']; -$messages = $viewmodel['messages']; +$info = $viewmodel['info']; $messages = $viewmodel['messages']; ?> @@ -188,8 +187,10 @@ newdiv.innerHTML += "
"; + /* newdiv.innerHTML += "

"; - + */ + var newselect = document.createElement("select"); newselect.id = "RemoveTitletagType"; '); + + if (info) { + var hiddenField = document.createElement("input"); + hiddenField.setAttribute("name", "bookId"); + hiddenField.setAttribute("value", info['book_id']); + form.appendChild(hiddenField); + + var hiddenField = document.createElement("input"); + hiddenField.setAttribute("name", "bookName"); + hiddenField.setAttribute("value", info['book_name']); + form.appendChild(hiddenField); + + var hiddenField = document.createElement("input"); + hiddenField.setAttribute("name", "sectionName"); + hiddenField.setAttribute("value", info['section_name']); + form.appendChild(hiddenField); + + }; + if(navigator.userAgent.toLowerCase().indexOf('firefox') > -1) { document.body.appendChild(form); form.submit(); @@ -324,6 +345,26 @@ hiddenField.setAttribute("value", section_id); form.appendChild(hiddenField); + var info = JSON.parse( ''); + + if (info) { + var hiddenField = document.createElement("input"); + hiddenField.setAttribute("name", "bookId"); + hiddenField.setAttribute("value", info['book_id']); + form.appendChild(hiddenField); + + var hiddenField = document.createElement("input"); + hiddenField.setAttribute("name", "bookName"); + hiddenField.setAttribute("value", info['book_name']); + form.appendChild(hiddenField); + + var hiddenField = document.createElement("input"); + hiddenField.setAttribute("name", "sectionName"); + hiddenField.setAttribute("value", info['section_name']); + form.appendChild(hiddenField); + + }; + if(navigator.userAgent.toLowerCase().indexOf('firefox') > -1) { document.body.appendChild(form); @@ -362,7 +403,27 @@ hiddenField.setAttribute("name", "sectionId"); hiddenField.setAttribute("value", section_id); form.appendChild(hiddenField); + + var info = JSON.parse( ''); + + if (info) { + var hiddenField = document.createElement("input"); + hiddenField.setAttribute("name", "bookId"); + hiddenField.setAttribute("value", info['book_id']); + form.appendChild(hiddenField); + + var hiddenField = document.createElement("input"); + hiddenField.setAttribute("name", "bookName"); + hiddenField.setAttribute("value", info['book_name']); + form.appendChild(hiddenField); + var hiddenField = document.createElement("input"); + hiddenField.setAttribute("name", "sectionName"); + hiddenField.setAttribute("value", info['section_name']); + form.appendChild(hiddenField); + + }; + if(navigator.userAgent.toLowerCase().indexOf('firefox') > -1) { document.body.appendChild(form); form.submit(); @@ -506,7 +567,20 @@ hiddenField.setAttribute("name", "sectionId"); hiddenField.setAttribute("value", info['section_id']); form.appendChild(hiddenField); - + + var hiddenField = document.createElement("input"); + hiddenField.setAttribute("name", "bookId"); + hiddenField.setAttribute("value", info['book_id']); + form.appendChild(hiddenField); + var hiddenField = document.createElement("input"); + hiddenField.setAttribute("name", "sectionName"); + hiddenField.setAttribute("value", info['section_name']); + form.appendChild(hiddenField); + var hiddenField = document.createElement("input"); + hiddenField.setAttribute("name", "bookName"); + hiddenField.setAttribute("value", info['book_name']); + form.appendChild(hiddenField); + } var hiddenField = document.createElement("input"); @@ -526,6 +600,9 @@ hiddenField.setAttribute("name", "topic_id"); hiddenField.setAttribute("value", topic_id); form.appendChild(hiddenField); + + + if(navigator.userAgent.toLowerCase().indexOf('firefox') > -1) { document.body.appendChild(form); @@ -633,7 +710,21 @@ hiddenField.setAttribute("name", "sectionId"); hiddenField.setAttribute("value", info['section_id']); form.appendChild(hiddenField); + + var hiddenField = document.createElement("input"); + hiddenField.setAttribute("name", "bookId"); + hiddenField.setAttribute("value", info['book_id']); + form.appendChild(hiddenField); + var hiddenField = document.createElement("input"); + hiddenField.setAttribute("name", "sectionName"); + hiddenField.setAttribute("value", info['section_name']); + form.appendChild(hiddenField); + + var hiddenField = document.createElement("input"); + hiddenField.setAttribute("name", "bookName"); + hiddenField.setAttribute("value", info['book_name']); + form.appendChild(hiddenField); } if(navigator.userAgent.toLowerCase().indexOf('firefox') > -1) {