Changeset 26 for trunk/Meet.php


Ignore:
Timestamp:
Dec 27, 2018, 3:47:30 PM (6 years ago)
Author:
chronos
Message:
  • Modified: Improved information parsing from message text.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Meet.php

    r25 r26  
    129129      $Start++;
    130130      $Result = trim(substr($Result, $Start, $Pos - $Start));
    131       break;
     131      if (is_numeric($Result)) break;
    132132    } else break;
    133133  }
     
    165165{
    166166  $Text = strtolower($Text);
    167   $Result = GetNumberBeforeText($Text, 'let');
     167  $Result = GetNumberAfterText($Text, 'je mi');
     168  if ($Result == '') $Result = GetNumberAfterText($Text, 'jsem');
    168169  if ($Result == '') $Result = GetNumberBeforeText($Text, 'rokov');
    169170  if ($Result == '') $Result = GetNumberBeforeText($Text, 'letou');
    170   if ($Result == '') $Result = GetNumberAfterText($Text, 'je mi');
    171   if ($Result == '') $Result = GetNumberAfterText($Text, 'jsem');
     171  if ($Result == '') $Result = GetNumberBeforeText($Text, 'let');
    172172  if ($Result == '') $Result = GetNumberAfterText($Text, 'čerstvých');
    173173  if ($Result == '') $Result = GetAgeHeightWeightFromText($Text)[0];
     
    181181function GetHeightFromText($Text)
    182182{
    183   $Text = strtolower($Text);
    184   $Result = GetNumberBeforeText($Text, 'cm');
    185   if ($Result == '') $Result = GetNumberAfterText($Text, 'měřím');
     183  $Text = strtolower($Text); 
     184  $Result = GetNumberAfterText($Text, 'měřím');
    186185  if ($Result == '') $Result = GetNumberAfterText($Text, 'merim');
     186  if ($Result == '') $Result = GetNumberBeforeText($Text, 'cm'); 
    187187  if ($Result == '') $Result = GetNumberBeforeText($Text, 'bez podpatků');
    188188  if ($Result == '') $Result = GetAgeHeightWeightFromText($Text)[1];
Note: See TracChangeset for help on using the changeset viewer.