www.webdeveloper.com
Results 1 to 7 of 7

Thread: please help ,algorithm has this guy used for the spellcheck?

  1. #1
    Join Date
    Jul 2013
    Posts
    5

    Talking please help ,algorithm has this guy used for the spellcheck?

    i want to get the result on the same page with the form too!! anyone please!!

    <?


    }
    else


    require 'db.php';
    function spellcheck($word) {
    $output = array();
    $word = mysql_real_escape_string($word);

    $words = mysql_query("SELECT `word` FROM `english` WHERE LEFT( `word`, 1) = '".substr($word, 0, 1)."'");
    if (!$words) {
    die('Invalid query: ' . mysql_error());
    }

    while(($words_row = mysql_fetch_assoc($words)) !== false && (in_array($word, $words_row) == false)) {
    similar_text($word, $words_row['word'], $percent) ;
    // echo $words_row['word'].' presentasi ' .$percent .' <p>';
    if ($percent > 75) {


    echo '<p>'. 'do you mean' . '<p>'. $words_row['word']. '<br>';
    echo '<p>';

    }

    }
    return (empty($output)) ? false : $output;

    }
    if (isset($_POST ['word']) && trim($_POST['word']) != null) {

    $word = $_POST['word'];
    $spellcheck = spellcheck ($word);

    if($spellcheck !== false){
    echo '<pre> ',print_r($spellcheck, true), ' </prev>' ;



    }


    }


    // echo("dont know dat word!! Data w blum updated lu!");
    //}
    mysql_close($link);


    }

    ?>

    <form id="main" class="form-wrapper" name=frm method="POST" action="securedpage.php?act=sm">
    <link rel="stylesheet" type="text/css" href="login.css">
    Word : <input type=text class="text-field" name="word"> <input class="button" type="submit" name="submit" value="translate" >
    <input name="clear" class="button" type="reset" value="Clear" >
    <script>$("#main").submit();</script>

  2. #2
    Join Date
    Aug 2012
    Location
    Canada
    Posts
    56
    Why don't you just ask them?
    Cd&
    one of my toys And my repository and my old self ranting plus a bonus Getting the most out of Q/A sites
    Code that is 100% standards compliant is 100% correct 100% of the time... anything else is just a hack

  3. #3
    Join Date
    Jul 2013
    Posts
    5
    i did ask them! and tweeted them but no answer until now, so please if anybody knows , just reply me, thx

  4. #4
    Join Date
    Jul 2013
    Posts
    5
    Quote Originally Posted by COBOLdinosaur View Post
    Why don't you just ask them?
    do u know what algorithm is this please?

  5. #5
    Join Date
    Aug 2012
    Location
    Canada
    Posts
    56
    Probably something custom, and the code is worthless without the database and included file anyway.
    Cd&
    one of my toys And my repository and my old self ranting plus a bonus Getting the most out of Q/A sites
    Code that is 100% standards compliant is 100% correct 100% of the time... anything else is just a hack

  6. #6
    Join Date
    Jul 2013
    Posts
    5
    Quote Originally Posted by COBOLdinosaur View Post
    Probably something custom, and the code is worthless without the database and included file anyway.
    well the included file is just the connection to the database and the database table is called english and it has one row called words which all words are saved.

  7. #7
    Join Date
    Aug 2012
    Location
    Canada
    Posts
    56
    Then you already have everything. If you don't understand the functions, that is what the php and mysql manuals are for. You either understand the code or you don't. There is no magic it is just string comparisons.
    Cd&
    one of my toys And my repository and my old self ranting plus a bonus Getting the most out of Q/A sites
    Code that is 100% standards compliant is 100% correct 100% of the time... anything else is just a hack

Thread Information

Users Browsing this Thread

There are currently 2 users browsing this thread. (0 members and 2 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles