Page 2 of 2 FirstFirst 12
Results 11 to 16 of 16

Thread: German spell does not work with 6.0.2

  1. #11
    ramsesfred is offline Starter Member
    Join Date
    Oct 2009
    Posts
    2
    Rep Power
    5

    Default Spanish aspell 6.0.2

    <?php
    #
    # ***** BEGIN LICENSE BLOCK *****
    # Zimbra Collaboration Suite Server
    # Copyright (C) 2005, 2006, 2007, 2008, 2009 Zimbra, Inc.
    #
    # The contents of this file are subject to the Yahoo! Public License
    # Version 1.0 ("License"); you may not use this file except in
    # compliance with the License. You may obtain a copy of the License at
    # Licensing for open source server & client technology: enterprise messaging and collaboration software by Zimbra.
    #
    # Software distributed under the License is distributed on an "AS IS"
    # basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.
    # ***** END LICENSE BLOCK *****
    #

    $filename = "";
    $text = "";
    $dictionary = "en_EN";

    if (isset($_FILES["text"])) {
    $text = file_get_contents($_FILES["text"]);
    } else if (isset($_REQUEST["text"])){
    $text = $_REQUEST["text"];
    }

    if (isset($_REQUEST["dictionary"])) {
    $dictionary = $_REQUEST["dictionary"];
    }

    if (get_magic_quotes_gpc()) {
    $text = stripslashes($text);
    }

    if ($text != NULL) {
    header("Content-Type: text/plain");
    set_error_handler("returnError");

    setlocale(LC_ALL, $dictionary);

    // Get rid of double-dashes, since we ignore dashes
    // when splitting words
    $text = preg_replace('/--+/', ' ', $text);

    // Convert to ISO-8859-1
    //$text = iconv("UTF-8","iso-8859-1", $text);


    // Split on anything that's not a word character, quote or dash
    $words = preg_split('/[^\w\'\xc0-\xfd-]+/', $text);
    //$words = preg_split('/[^\w\xc0-\xfd-\']+/', $text);


    // Load dictionary
    $dictionary = pspell_new($dictionary);
    if ($dictionary == 0) {
    returnError("Unable to open dictionary " . $dictionary);
    }

    $skip = FALSE;
    $checked_words = array();
    $misspelled = "";

    foreach ($words as $word) {
    if ($skip) {
    $skip = FALSE;
    continue;
    }

    // Ignore hyphenations
    if (preg_match('/-$/', $word)) {
    // Skip the next word too
    $skip = TRUE;
    continue;
    }

    // Skip numbers
    if (preg_match('/[0-9\-]+/', $word)) {
    continue;
    }

    // Skip duplicates
    if (array_key_exists($word, $checked_words)) {
    continue;
    } else {
    $checked_words[$word] = 1;
    }

    // Check spelling
    if (!pspell_check($dictionary, $word)) {
    $suggestions = implode(",", pspell_suggest($dictionary, $word));
    $suggestions = iconv("UTF-8","iso-8859-1//IGNORE",$suggestions);
    $misspelled .= "$word:$suggestions\n";


    }
    }

    echo $misspelled;
    } else {
    ?>

    <html>
    <head>
    <title>Spell Checker</title>
    </head>
    <body>

    <form action="aspell.php" method="post" enctype="multipart/form-data">
    <p>Type in some words to spell check:</p>
    <textarea NAME="text" ROWS="10" COLS="80"></textarea>
    <p>Dictionary:<input type="text" name="dictionary" value="<?=$dictionary; ?>" size="8"/></p>
    <p><input type="submit" /></p>
    </form>

    </body>
    </html>

    <?php
    }

    function returnError($errno, $message) {
    header("HTTP/1.1 500 Internal Server Error");
    error_log("Error $errno: " . $message);
    exit($message);
    }

    ?>

  2. #12
    eloi is offline Junior Member
    Join Date
    Jul 2009
    Posts
    5
    Rep Power
    6

    Default

    I prove this spanish aspell 6.0.2 in http://localhost:7780/aspell.php and..

    http://localhost:7780/aspell.php (MULTIPART FORM DATA)
    iconv() [<a href='function.iconv'>function.iconv</a>]: Detected an illegal character in input string


    obiously in zimbra redaction doesn't work

    any solution? Am I doing someting wrong?

    thanks
    Last edited by eloi; 10-27-2009 at 03:26 PM.

  3. #13
    ramsesfred is offline Starter Member
    Join Date
    Oct 2009
    Posts
    2
    Rep Power
    5

    Default

    Quote Originally Posted by eloi View Post
    I prove this spanish aspell 6.0.2 in http://localhost:7780/aspell.php and..

    http://localhost:7780/aspell.php (MULTIPART FORM DATA)
    iconv() [<a href='function.iconv'>function.iconv</a>]: Detected an illegal character in input string


    obiously in zimbra redaction doesn't work

    any solution? Am I doing someting wrong?

    thanks
    you can prove with this code

    // Convert to ISO-8859-1
    //$text = iconv("UTF-8","iso-8859-1", $text);

    // Split on anything that's not a word character, quote or dash
    $words = preg_split('/[^\w\'\xc0-\xfd-]+/', $text);
    //$words = preg_split('/[^\w\xc0-\xfd-\']+/', $text);

    // Check spelling
    if (!pspell_check($dictionary, $word)) {
    $suggestions = implode(",", pspell_suggest($dictionary, $word));
    $suggestions = iconv("UTF-8","iso-8859-1//IGNORE",$suggestions);
    $misspelled .= "$word:$suggestions\n";

  4. #14
    eloi is offline Junior Member
    Join Date
    Jul 2009
    Posts
    5
    Rep Power
    6

    Default

    I don't see the diference with Spanish aspell 6.0.2 that you put before.

  5. #15
    eloi is offline Junior Member
    Join Date
    Jul 2009
    Posts
    5
    Rep Power
    6

    Default

    Doesn't work this solution. I have Release 6.0.2_GA_1912.UBUNTU8 UBUNTU8 NETWORK edition.

    What can I do?

  6. #16
    hmmblah is offline Active Member
    Join Date
    Aug 2008
    Location
    Michigan
    Posts
    38
    Rep Power
    6

    Default

    My users couldn't use spell check yesterday. I applied the fix from the first page of this topic and it seems to be working now.

    English - 6.0.2 NE on RHEL 5 64-bit.

Page 2 of 2 FirstFirst 12

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Fresh Zimbra installation does not work
    By Datax in forum Installation
    Replies: 4
    Last Post: 08-18-2008, 01:18 PM
  2. Replies: 0
    Last Post: 01-31-2008, 04:34 AM
  3. Linux Firefox Clients Don't Work with Spell Check
    By SiennaWarrior in forum Users
    Replies: 12
    Last Post: 04-03-2006, 10:07 AM

Posting Permissions

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