Source

uchardet-enhanced / libcharsetdetect / mozilla / extensions / universalchardet / src / base / LangSpanishModel.cpp

Full commit
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
 *
 * The contents of this file are subject to the Mozilla Public License Version
 * 1.1 (the "License"); you may not use this file except in compliance with
 * the License. You may obtain a copy of the License at
 * http://www.mozilla.org/MPL/
 *
 * Software distributed under the License is distributed on an "AS IS" basis,
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 * for the specific language governing rights and limitations under the
 * License.
 *
 * The Original Code is Mozilla Communicator client code.
 *
 * The Initial Developer of the Original Code is
 * Netscape Communications Corporation.
 * Portions created by the Initial Developer are Copyright (C) 1998
 * the Initial Developer. All Rights Reserved.
 *
 * Contributor(s):
 *
 * Alternatively, the contents of this file may be used under the terms of
 * either the GNU General Public License Version 2 or later (the "GPL"), or
 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
 * in which case the provisions of the GPL or the LGPL are applicable instead
 * of those above. If you wish to allow use of your version of this file only
 * under the terms of either the GPL or the LGPL, and not to allow others to
 * use your version of this file under the terms of the MPL, indicate your
 * decision by deleting the provisions above and replace them with the notice
 * and other provisions required by the GPL or the LGPL. If you do not delete
 * the provisions above, a recipient may use your version of this file under
 * the terms of any one of the MPL, the GPL or the LGPL.
 *
 * ***** END LICENSE BLOCK ***** */

#include "nsSBCharSetProber.h"

static const unsigned char spanish_windows_1252CharToOrderMap[] = 
{
255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
255, 32, 44, 29, 38, 26, 48, 49, 53, 37, 55, 63, 31, 35, 40, 46,
 30, 58, 36, 33, 41, 47, 54, 52, 64, 51, 67,255,255,255,255,255,
255,  2, 15, 11,  9,  1, 19, 16, 21,  6, 27, 43,  8, 13,  4,  3,
 14, 22,  7,  5, 10, 12, 17, 42, 39, 18, 24,255,255,255,255,255,
180,179,178,177,176, 71,175,174,173,172,171,170,169,168,167,166,
165, 76, 70, 61, 62,164, 57,163,162,161,160,159,158,157,156,155,
154, 56,153,152,151,150,149,148,147, 79, 73, 59,146,145,144,143,
 83, 82,142,141,140,139,138,137,136,135, 78, 60,134,133,132, 50,
131, 72,130,129,128,127,126,125,124, 66,123,122,121, 68,120,119,
118, 74,117, 69,116,115,114,113,112,111, 81,110,109,108,107,106,
105, 25,104,103,102,101,100, 77, 75, 28, 99, 98, 97, 23, 96, 95,
 94, 34, 80, 20, 93, 92, 91, 90, 89, 88, 45, 87, 65, 86, 85, 84,
};

static const PRUint8 spanishLangModel[] = 
{
3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,2,3,3,3,2,0,3,0,0,2,2,0,
2,3,0,0,0,0,3,0,2,3,2,3,2,0,0,0,0,0,0,2,0,0,0,0,2,0,0,2,0,2,0,2,
3,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,0,3,3,3,3,0,0,3,0,0,0,0,0,
0,3,0,0,0,0,2,0,0,2,2,0,3,0,0,0,0,0,0,0,0,2,0,0,2,0,0,2,0,2,0,0,
2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,0,3,2,2,3,0,0,3,2,0,0,0,0,
3,3,2,0,0,0,2,0,0,2,3,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,2,0,2,0,0,
3,3,3,3,3,3,3,3,3,3,3,3,3,0,3,3,3,3,3,3,2,3,3,3,2,0,3,3,2,0,0,0,
0,0,0,0,0,2,0,0,0,0,3,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
3,3,3,2,3,3,0,3,3,3,3,3,3,3,3,3,2,2,3,3,3,3,3,0,2,0,0,2,0,0,0,0,
0,0,0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