Changeset 19 for trunk/Meet.php


Ignore:
Timestamp:
Dec 25, 2018, 1:51:34 PM (6 years ago)
Author:
chronos
Message:
  • Added: Meet import from CSTS web.
  • Modified: Improved analysis of person age from message text.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Meet.php

    r18 r19  
    88include_once('Import/Amblar.php');
    99include_once('Import/MajkluvSvet.php');
     10include_once('Import/Csts.php');
    1011
    1112abstract class Gender
     
    156157  $Text = strtolower($Text);
    157158  $Result = GetNumberBeforeText($Text, 'let');
     159  if ($Result == '') $Result = GetNumberBeforeText($Text, 'rokov');
     160  if ($Result == '') $Result = GetNumberBeforeText($Text, 'letou');
    158161  if ($Result == '') $Result = GetNumberAfterText($Text, 'je mi');
    159162  if ($Result == '') $Result = GetNumberAfterText($Text, 'jsem');
    160163  if ($Result == '') $Result = GetNumberAfterText($Text, 'čerstvých');
    161164  if ($Result == '') $Result = GetAgeHeightWeightFromText($Text)[0];
     165  if ($Result == '') $Result = date('Y', time()) - GetNumberAfterText($Text, 'ročník');
    162166  return $Result;
    163167}
     
    217221
    218222$Locations = array(
    219   'Praha' => 'Praha',
    220   'Prahy' => 'Praha',
    221   'Praze' => 'Praha',
    222   'Ostrava' => 'Ostrava',
    223   'Ostravě' => 'Ostrava',
    224   'Ostravy' => 'Ostrava',
    225   'Mladé Boleslavi' => 'Mladá Boleslav',
     223  'praha' => 'Praha',
     224  'prahy' => 'Praha',
     225  'praze' => 'Praha',
     226  'brno' => 'Brno',
     227  'brně' => 'Brno',
     228  'ostrava' => 'Ostrava',
     229  'ostravě' => 'Ostrava',
     230  'ostravy' => 'Ostrava',
     231  'olomouc' => 'Olomouc',
     232  'liberec' => 'Liberec',
     233  'opava' => 'Opava',
     234  'opave' => 'Opava',
     235  'plzeň' => 'Plzeň',
     236  'plzni' => 'Plzeň',
     237  'vyškov' => 'Vyškov',
     238  'mladá boleslav' => 'Mladá Boleslav',
     239  'mladé boleslavi' => 'Mladá Boleslav',
     240  'litoměřice' => 'Litoměřice',
     241  'sokolov' => 'Sokolov',
     242  'mikulov' => 'Mikulov',
    226243);
    227244
     
    229246{
    230247  global $Locations;
     248 
     249  $Text = strtolower($Text);
    231250
    232251  foreach ($Locations as $Index => $Location)
     
    256275      else if ($Method == 'amblar') $Source = new MeetSourceAmblar();
    257276      else if ($Method == 'majkluvsvet') $Source = new MeetSourceMajkluvSvet();
     277      else if ($Method == 'csts') $Source = new MeetSourceCsts();
    258278      else {
    259279        echo('Unsupported parse method: '.$Method.'<br/>');
Note: See TracChangeset for help on using the changeset viewer.