comparison models/extractapp.php @ 87:fb5049fc5dd7 extractapp_dev

New:(1)UI(2)generate simple regex by examples(3)coordinates in book metadata
author Zoe Hong <zhong@mpiwg-berlin.mpg.de>
date Tue, 02 Jun 2015 16:52:05 +0200
parents 0141df465205
children e681d693240e
comparison
equal deleted inserted replaced
86:0141df465205 87:fb5049fc5dd7
25 */ 25 */
26 26
27 class ExtractappModel extends BaseModel{ 27 class ExtractappModel extends BaseModel{
28 28
29 protected $section_id = 0, $data_path, $file_id = 0, $current_fileId=0, 29 protected $section_id = 0, $data_path, $file_id = 0, $current_fileId=0,
30 $branch_id = 0, $user_id = 0, $lg_text = "", $topic, $taglist_infile = "", $book_meta = "",$book_dynasty=""; 30 $branch_id = 0, $user_id = 0, $lg_text = "", $topic, $taglist_infile = "",
31 $book_meta = "", $book_dynasty = "";
32
31 public $messages = array('info'=>"",'error'=>"",'warning'=>"",'debug'=>""); 33 public $messages = array('info'=>"",'error'=>"",'warning'=>"",'debug'=>"");
32 34
33 35
34 public function SetTextFromFileId() { // remove $_postdata as input 36 public function SetTextFromFileId() { // remove $_postdata as input
35 /** 37 /**
105 $book_meta->author = $b['author']; 107 $book_meta->author = $b['author'];
106 $book_meta->edition = $b['edition']; 108 $book_meta->edition = $b['edition'];
107 $book_meta->in_jibengujiku = $b['in_jibengujiku']; 109 $book_meta->in_jibengujiku = $b['in_jibengujiku'];
108 $book_meta->admin_type = $b['admin_type']; 110 $book_meta->admin_type = $b['admin_type'];
109 111
112 $coordinates = $section_meta['section']['coordinates_books'];
113 $book_meta->x = $coordinates['x'];
114 $book_meta->y = $coordinates['y'];
115 $book_meta->place_name = $coordinates['place_name'];
116
117
110 118
111 $this->book_meta = $book_meta; 119 $this->book_meta = $book_meta;
112 120
113 } 121 }
114 122
383 $text .= "<topic>".$this->topic."</topic>\n"; 391 $text .= "<topic>".$this->topic."</topic>\n";
384 // --- book meta data --- 392 // --- book meta data ---
385 $book = $this->book_meta; 393 $book = $this->book_meta;
386 394
387 $text .= "<book>\n"; 395 $text .= "<book>\n";
388 $text .= "<id>".$book->id."</id>\n"; 396 $text .= "<id>".$book->id."</id>\n";
389 $text .= "<name>".$book->name."</name>\n"; 397 $text .= "<name>".$book->name."</name>\n";
390 $text .= "<level1>".$book->level1."</level1>\n"; 398 $text .= "<level1>".$book->level1."</level1>\n";
391 $text .= "<level2>".$book->level2."</level2>\n"; 399 $text .= "<level2>".$book->level2."</level2>\n";
392 $text .= "<period>".$book->period."</period>\n"; 400 $text .= "<period>".$book->period."</period>\n";
393 $text .= "<dynasty>".$book->dynasty."</dynasty>\n"; 401 $text .= "<dynasty>".$book->dynasty."</dynasty>\n";
394 $text .= "<start_year>".$book->start_year."</start_year>\n"; 402 $text .= "<start_year>".$book->start_year."</start_year>\n";
395 $text .= "<end_year>".$book->end_year."</end_year>\n"; 403 $text .= "<end_year>".$book->end_year."</end_year>\n";
396 $text .= "<line>".$book->line."</line>\n"; 404 $text .= "<line>".$book->line."</line>\n";
397 $text .= "<volume>".$book->volume."</volume>\n"; 405 $text .= "<volume>".$book->volume."</volume>\n";
398 $text .= "<author>".$book->author."</author>\n"; 406 $text .= "<author>".$book->author."</author>\n";
399 $text .= "<edition>".$book->edition."</edition>\n"; 407 $text .= "<edition>".$book->edition."</edition>\n";
400 $text .= "<in_jibengujiku>".$book->in_jibengujiku."</in_jibengujiku>\n"; 408 $text .= "<in_jibengujiku>".$book->in_jibengujiku."</in_jibengujiku>\n";
401 $text .= "<admin_type>".$book->admin_type."</admin_type>\n"; 409 $text .= "<admin_type>".$book->admin_type."</admin_type>\n";
410
411 $text .= "<place_name>".$book->place_name."</place_name>\n";
412 $text .= "<x>".$book->x."</x>\n";
413 $text .= "<y>".$book->y."</y>\n";
402 $text .= "</book>\n"; 414 $text .= "</book>\n";
403 415
404
405 /* 416 /*
406 foreach ($book as $b) { 417 foreach ($book as $b) {
407 $text .= "<book>\n"; 418 $text .= "<book>\n";
408 $text .= "<id>".$b[0]."</id>\n"; 419 $text .= "<id>".$b[0]."</id>\n";
409 $text .= "<name>".$b[1]."</name>\n"; 420 $text .= "<name>".$b[1]."</name>\n";