} if (preg_match("~score|results?~", $spell_checked)) { $isscr = true; } else { $isscr = false; } if (preg_match("~fixtures?|schdules?|time(ings?)?~", $spell_checked)) { $isfix = true; } else { $isfix = false; } $limitcond = ''; echo "<br>EPL DETAILS<br>"; $isscore = true; $epl_req = $spell_checked; $splited = matchdate($epl_req); if (isset($splited[2])) { $epl_req = $splited[0]; $getdate = $splited[2]; echo "<br> Matched part {$splited['1']}"; } $epl_req = preg_replace("~\\b((epl|football|score|live|matches|match|points?|goals?|counts?|against|english|premier|League|fixture|Championship|england|local|time|timing)s?|which|when|give|tell|me|please|pleese|what|go|show|me|long|do|have|been|the|of|in|no|journey|need|know|help|all|or|before|after|then|list|first|last|i want to|want|for|go|is|was|i|express|mail|ticket|charge|fron|metro|next|hour)\\b~", "", $epl_req); $epl_req = preg_replace("~[^\\w\\s]|\\d~", " ", $epl_req); $epl_req = trim(preg_replace("~[\\s]+~", " ", $epl_req)); $isqueryset = false; $epl_result = ''; if (str_word_count($epl_req) <= 2 || $spell_checked == 'epl') { echo "<br>less than two words"; echo $query = "select team from epl_team where srch = '" . mysql_real_escape_string($epl_req) . "' or team = '" . mysql_real_escape_string($epl_req) . "'"; $result = mysql_query($query) or trigger_error(mysql_error(), E_USER_ERROR); if (mysql_num_rows($result)) {
<?php if (preg_match("~^(namaz|loc change)\\b~", $spell_checked, $match)) { echo "<br>CHANGE NAMAZ LOCATION<br>"; $loc_req = str_replace($match[1], '', $spell_checked); $loc_req = preg_replace("~(<|>|\\(|\\))~", ' ', $loc_req); print_r($match); if (!preg_match("~\\b(who|where)\\b~", $loc_req, $match)) { $splited = matchdate($loc_req); if (isset($splited[2])) { $loc_req = $splited[0]; $getdate = $splited[2]; $istoday = false; } else { $getdate = strtotime('today'); $istoday = TRUE; } $loc_req = preg_replace("~\\b((namaz|loc|change|set|place|move|get|time|timing)s?|which|when|give|tell me|please|pleese|go|show|me|do|have|been|the|of|in|need|all|and|or|list|to|want|for|is|was|i|from)\\b~", '', $loc_req); echo $loc_req = trim(preg_replace("~[\\s]+~", " ", $loc_req)); include 'namazloc.php'; if ($total_return != '') { if ($istoday) { $options_list[] = "Tomorrow"; $list[] = array("content" => "namaz tomorrow"); } $to_logserver['source'] = 'namaz'; include 'allmanip.php'; putOutput($total_return); exit; } else { $list = array();
<?php include_once 'check_tvchannel.php'; //check whether any channel name present without keywords if (preg_match("~\\b(t\\.?v|channel|schedule|programs?|(timing)s?)\\b~", $spell_checked)) { echo "<br>TV SCHDULE<br>"; if (preg_match("~^[^\\w]*tv~", $spell_checked)) { $tvmust = true; } else { $tvmust = false; } if (!preg_match("~\\b(who|where|how|route|direction|poem|climate|cri|score|review|train)\\b~", $spell_checked) || $tvmust) { $tv_req = preg_replace("~\\b(t\\.?v|channel|schedule|programs?|(timing)s?|name|which|when|give me|tell me|please|pleese|what|long|have|been|of|in|no|pnr|journey|need|help|all|or|before|after|then|list|i want to|want|for|is|was|i|mail|charge|fron|murder|metro)\\b~", "", $spell_checked); $splited = matchdate($tv_req); if (isset($splited[2])) { $tv_req = $splited[0]; $getdate = $splited[2]; } $tv_srch = $tv_req; $tv_req = preg_replace("~[^\\w\\s]~", " ", $tv_req); $tv_req = preg_replace("~\\btv|channel\\b~i", "", $tv_req); $tv_req = trim(preg_replace("~[\\s]+~", "", $tv_req)); echo "<br>keyword {$tv_req}<br>"; if (strlen($tv_req) > 0) { echo "<br>Including tvnow<br>"; include 'tvin_guide.php'; } else { if ($tvmust) { $total_return = "Sorry, we could not find a tv channel name in your query."; $free = TRUE; $to_logserver['isresult'] = 0;
echo "<br>HOROSCOPE PAKISTAN<br>"; $total_return = "Please select your zodiac sign"; foreach ($zodiac as $key => $ti) { $options_list[] = strtoupper($ti); $list[] = array('content' => "horoscope {$ti}"); } $to_logserver['source'] = 'horoscope'; include 'allmanip.php'; putOutput($total_return); exit; } elseif (preg_match("~^[^\\w]*(horoscope|kismat)~", $spell_checked)) { $horo_must = true; } if (!preg_match("~\\b(who|where|route|direction|poem|climate|cri|score|review|train)\\b~", $spell_checked) || $horo_must) { $hor_req = remwords($spell_checked); $splited = matchdate($hor_req); if (isset($splited[2])) { $hor_req = $splited[0]; $getdate = $splited[2]; } $hor_req = preg_replace("~[^\\w\\d]~", " ", $hor_req); $hor_req = preg_replace("~\\b(horo?scope?|zodiac|astrology|star sign|sun sign|kismat)\\b~i", "", $hor_req); $hor_req = trim(preg_replace("~[\\s]+~", " ", $hor_req)); echo "<br>{$hor_req}<br>"; if (strlen($hor_req) > 0) { include 'horoscope.php'; if ($return_zodiac) { $total_return = $return_zodiac; $source_machine = $machine_id; $current_file = "/temp/{$numbers}"; file_put_contents(DATA_PATH . $current_file, $total_return);
<?php if (preg_match("~\\b^(lucky|bday|lucky number|birthday|blk|luck)\\b~", $req)) { $spell_checked = trim(str_replace("/", " ", $spell_checked)); $spell_checked = trim(str_replace("-", " ", $spell_checked)); $spell_checked = trim(str_replace(".", " ", $spell_checked)); $spell_checked = trim(str_replace("th", "", $spell_checked)); $spell_checked = trim(str_replace("lucky", "", $spell_checked)); $spell_checked = trim(str_replace("bday", "", $spell_checked)); $spell_checked = trim(str_replace("lucky number", "", $spell_checked)); $spell_checked = trim(str_replace("birthday", "", $spell_checked)); $spell_checked = trim(str_replace("blk", "", $spell_checked)); //$spell_checked = trim(str_replace(" ", "", $spell_checked)); $arDate = matchdate($spell_checked); var_dump($arDate); if (!empty($arDate[2])) { $month = $arDate[1]; $month = explode(" ", $month); // $month = explode(" ", $month); echo "<h2>Month</h2>"; var_dump($month); echo "<h3>MONTH:<h3>" . $month[1]; if (!is_numeric($month[0])) { $lucky_no = $month[1]; } else { switch ($month[1]) { case 'january': case 'jan': $month[1] = '01'; break; case 'february':
<?php if (preg_match("~\\b(b[au]s)\\b~", $req, $match)) { if (strpos($spell_checked, 'bus') === 0 || strpos($spell_checked, 'bas') === 0) { $first_BUS = true; } else { $first_BUS = false; } if (!preg_match("~\\b(who|how|route|direction|movie|song|poem|weather|climate|cricket|cri|score|review)\\b~", $req)) { echo 'bus 1 ' . ($bus_req = preg_replace("~\\b((trains?|trauns?|tran|trn|local|busstop|bus|number|time|timing)s?|stations?|which|when|give me|tell me|please|pleese|what|go|show|me|long|travel|do|have|been|the|of|in|no|pnr|journey|need|know|help|all|and|or|before|after|then|list|first|last|i want to|want|for|go|is|was|i|express|exp|passenger|passanger|pasienger|mail|ticket|charge|fron|murder|metro|next|hour)\\b~", "", $req)); $splited = matchdate($bus_req); if (isset($splited[2])) { $bus_req = $splited[0]; $getdate = $splited[2]; } echo '<br>bus 2 ' . ($bus_req = trim(preg_replace("~[\\s]+~", " ", $bus_req))); //removing more spaces $bus_route = trim($bus_req); //regaining value $bus_req = preg_replace("~[^\\w\\s]~", " ", $bus_req); //replacing special chars with space $ismatched = false; if (preg_match("~\\bto\\b ([\\w\\s]+) fro?m ([\\w\\s]+)~", $bus_req, $match)) { echo '<br>Reg 1:'; print_r($match); $placeFrom = $match[2]; $placeTo = $match[1]; $ismatched = true; } else { if (preg_match("~.*(\\b(fro?m)\\b) ?([\\w\\s]+) to ([\\w\\s]+)~", $bus_req, $match)) { echo '<br>Reg 2:';
} $datemust = false; if ($match[1] == 'to' || $match[1] == ' 2 ') { $datemust = true; $train_req = preg_replace("~\\b(to|fro?m)\\b~", '', $req); } else { $train_req = $req; } if (!preg_match("~\\b(who|where|how|route|direction|movie|song|poem|weather|climate|cricket|cri|score|review)\\b~", $req)) { $train_req = preg_replace("~\\b((trains?|trauns?|tran|trn|local|time|timing)s?|stations?|which|when|give me|tell me|please|pleese|what|go|show|me|long|travel|do|have|been|the|of|in|no|pnr|journey|need|know|help|all|and|or|before|after|then|list|first|last|i want to|want|for|go|is|was|i|express|exp|passenger|passanger|pasienger|mail|ticket|charge|fron|murder|metro|next|hour)\\b~", "", $train_req); if (!($islocalmust || $datemust)) { $train_num = $train_req; } else { $train_num = ''; } $splited = matchdate($train_req); if (isset($splited[2])) { $train_req = $splited[0]; $getdate = $splited[2]; } $splited = matchtime($train_req); if (isset($splited[2])) { $train_req = $splited[0]; $gettime = $splited[2]; } if ($match[1] == 'to' || $match[1] == ' 2 ') { $train_req = preg_replace("~ 2 ~", " ", $train_req); } else { $train_req = preg_replace("~ 2 ~", " to ", $train_req); } $train_req = preg_replace("~[^\\w\\s]|\\d~", " ", $train_req);