Mercurial > hg > extraction-interface
changeset 38:4b3da4802998 extractapp
config for localgazetteers-dev
author | Zoe Hong <zhong@mpiwg-berlin.mpg.de> |
---|---|
date | Fri, 06 Mar 2015 17:56:48 +0100 |
parents | 893ed33c2bd4 |
children | 8347776a44fc |
files | Gazetteers_funcTables_20150306.sql develop/classes/basemodel.php develop/models/extractapp.php |
diffstat | 3 files changed, 188 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Gazetteers_funcTables_20150306.sql Fri Mar 06 17:56:48 2015 +0100 @@ -0,0 +1,186 @@ +# ************************************************************ +# Sequel Pro SQL dump +# Version 4096 +# +# http://www.sequelpro.com/ +# http://code.google.com/p/sequel-pro/ +# +# Host: 127.0.0.1 (MySQL 5.5.38) +# Database: Gazetteers +# Generation Time: 2015-03-06 15:59:34 +0000 +# ************************************************************ + + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; + + +# Dump of table taglist +# ------------------------------------------------------------ + +DROP TABLE IF EXISTS `taglist`; + +CREATE TABLE `taglist` ( + `id` int(10) NOT NULL AUTO_INCREMENT, + `name` varchar(100) NOT NULL, + `tag` varchar(100) NOT NULL, + `color` varchar(30) NOT NULL, + `systemName` varchar(255) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `tag` (`tag`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +LOCK TABLES `taglist` WRITE; +/*!40000 ALTER TABLE `taglist` DISABLE KEYS */; + +INSERT INTO `taglist` (`id`, `name`, `tag`, `color`, `systemName`) +VALUES + (2,'人名','person','rgb(8, 148, 255)','interface'), + (19,'入仕時間','entry_time','rgb(174, 179, 39)','interface'), + (13,'字','zi','rgb(123, 128, 235)','interface'), + (14,'年號','nianhao','rgb(3, 235, 30)','interface'), + (15,'朝代','dy','rgb(67, 148, 95)','interface'), + (16,'官職','office','rgb(204, 0, 204)','interface'), + (17,'無意義','null','rgb(219, 219, 219)','interface'), + (18,'籍貫','jiguan','rgb(235, 57, 26)','interface'), + (20,'入仕方法','entry_way','rgb(100, 209, 194)','interface'), + (21,'任職時間','post_time','rgb(252, 0, 151)','interface'), + (22,'任職種類','post_type','rgb(240, 40, 240)','interface'), + (23,'號','hao','rgb(0, 204, 255)','interface'), + (24,'入仕地點','entry_addr','rgb(179, 156, 6)','interface'), + (25,'親屬關係','kins','rgb(101, 138, 214)','interface'), + (26,'別名','othername','rgb(141, 212, 224)','interface'), + (27,'任官地點','post_address','rgb(230, 161, 192)','interface'), + (28,'出處','source_tag','rgb(122, 122, 122)','interface'), + (29,'前官','prev_office','rgb(110, 11, 98)','interface'), + (30,'後官','next_office','rgb(168, 57, 168)','interface'), + (31,'物產名稱','product_name','rgb(227, 63, 227)','interface'), + (32,'屬','shu','rgb(143, 14, 143)','interface'), + (34,'物產產地','product_place','rgb(7, 64, 209)','interface'); + +/*!40000 ALTER TABLE `taglist` ENABLE KEYS */; +UNLOCK TABLES; + + +# Dump of table topic_regex_relation +# ------------------------------------------------------------ + +DROP TABLE IF EXISTS `topic_regex_relation`; + +CREATE TABLE `topic_regex_relation` ( + `id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `topic_id` int(11) NOT NULL DEFAULT '0', + `regex_filename` varchar(100) NOT NULL DEFAULT '', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +LOCK TABLES `topic_regex_relation` WRITE; +/*!40000 ALTER TABLE `topic_regex_relation` DISABLE KEYS */; + +INSERT INTO `topic_regex_relation` (`id`, `topic_id`, `regex_filename`) +VALUES + (1,1,'Basic_Address.txt'), + (2,1,'entry_method_student.txt'), + (3,1,'hao.txt'), + (4,1,'kin_name_relation.txt'), + (5,1,'post_year_month_day_former_post.txt'), + (6,1,'post_year_month_day_type.txt'), + (7,1,'post_year_month_day_with former post.txt'), + (8,1,'post_year_type.txt'), + (9,1,'source.txt'), + (10,1,'test regex.txt'), + (11,1,'Zi.txt'), + (12,2,'zhishu.txt'), + (13,2,'product_name.txt'), + (14,2,'product_name.txt'), + (15,2,'product_name_place.txt'), + (16,2,'product_name_place.txt'), + (17,2,'product_name_started_with_space.txt'), + (18,1,'test2.txt'); + +/*!40000 ALTER TABLE `topic_regex_relation` ENABLE KEYS */; +UNLOCK TABLES; + + +# Dump of table topic_tag_relation +# ------------------------------------------------------------ + +DROP TABLE IF EXISTS `topic_tag_relation`; + +CREATE TABLE `topic_tag_relation` ( + `id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `topic_id` int(11) NOT NULL DEFAULT '0', + `tag_id` int(10) NOT NULL DEFAULT '0', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +LOCK TABLES `topic_tag_relation` WRITE; +/*!40000 ALTER TABLE `topic_tag_relation` DISABLE KEYS */; + +INSERT INTO `topic_tag_relation` (`id`, `topic_id`, `tag_id`) +VALUES + (1,1,2), + (2,1,13), + (3,1,14), + (4,1,15), + (5,1,16), + (6,1,17), + (7,1,18), + (8,1,19), + (9,1,20), + (10,1,21), + (11,1,22), + (12,1,23), + (13,1,24), + (14,1,25), + (15,1,26), + (16,1,27), + (17,1,28), + (18,1,29), + (19,1,30), + (20,2,31), + (21,2,32), + (22,2,17), + (23,2,34), + (24,2,26); + +/*!40000 ALTER TABLE `topic_tag_relation` ENABLE KEYS */; +UNLOCK TABLES; + + +# Dump of table topics +# ------------------------------------------------------------ + +DROP TABLE IF EXISTS `topics`; + +CREATE TABLE `topics` ( + `id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(100) NOT NULL DEFAULT '', + `tag` varchar(100) NOT NULL DEFAULT '', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +LOCK TABLES `topics` WRITE; +/*!40000 ALTER TABLE `topics` DISABLE KEYS */; + +INSERT INTO `topics` (`id`, `name`, `tag`) +VALUES + (1,'人物','person'), + (2,'物產','product_name'); + +/*!40000 ALTER TABLE `topics` ENABLE KEYS */; +UNLOCK TABLES; + + + +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
--- a/develop/classes/basemodel.php Fri Mar 06 15:53:42 2015 +0100 +++ b/develop/classes/basemodel.php Fri Mar 06 17:56:48 2015 +0100 @@ -5,7 +5,7 @@ protected $systemNAME, $topic; protected $get_text_from_fileId_url = "http://localgazetteers-dev:8080/LGServer/rest/text/getFileText?fileId="; - protected $get_text_from_sectionId_url = "http://localgazetteers-dev:8080/LGServerrest/text/getSectionText?sectionId="; + protected $get_text_from_sectionId_url = "http://localgazetteers-dev:8080/LGServer/rest/text/getSectionText?sectionId="; protected $save_to_LGService_url = "http://localgazetteers-dev:8080/LGServer/rest/text/save"; protected $save_new_to_LGService_url = "http://localgazetteers-dev:8080/LGServer/rest/text/saveNew";
--- a/develop/models/extractapp.php Fri Mar 06 15:53:42 2015 +0100 +++ b/develop/models/extractapp.php Fri Mar 06 17:56:48 2015 +0100 @@ -62,9 +62,9 @@ $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); $stringInput = $lg_text;