engine: Remove in-tree unicodesn stemmer

Now that search is using libstemmer, the in-tree stemmer is no longer
needed and can be removed.
This commit is contained in:
Michael Gratton 2020-09-13 23:46:53 +10:00 committed by Michael James Gratton
parent 968bc1a9e8
commit 4f9df7d74a
100 changed files with 178 additions and 30417 deletions

View file

@ -1,23 +0,0 @@
Copyright (c) 2001, Dr Martin Porter, and (for the Java developments) Copyright
(c) 2002, Richard Boulton
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View file

@ -27,6 +27,7 @@ sql_files = [
'version-026.sql',
'version-027.sql',
'version-028.sql',
'version-029.sql',
]
install_data(sql_files,

View file

@ -1,5 +1,16 @@
--
-- Dummy database upgrade to add MessageSearchTable, whose parameters depend on
-- things we need at run-time. See src/engine/imap-db/imap-db-database.vala in
-- post_upgrade() for the code that runs the upgrade.
-- Create MessageSearchTable
--
CREATE VIRTUAL TABLE MessageSearchTable USING fts4(
body,
attachment,
subject,
from_field,
receivers,
cc,
bcc,
tokenize=simple,
prefix="2,4,6,8,10",
);

5
sql/version-029.sql Normal file
View file

@ -0,0 +1,5 @@
--
-- Use libstemmer for stemming rather than SQLite.
--
DROP TABLE IF EXISTS TokenizerTable;

View file

@ -224,7 +224,6 @@ client_internal_header_fixup = custom_target(
client_dep = declare_dependency(
link_with: [
client_lib,
sqlite3_unicodesn_lib
],
include_directories: include_directories('.')
)
@ -236,9 +235,6 @@ client_internal_dep = declare_dependency(
'-L' + client_build_dir,
'-l' + client_package
],
link_with: [
sqlite3_unicodesn_lib,
],
include_directories: include_directories('.'),
sources: client_internal_header_fixup
)

View file

@ -7,7 +7,7 @@
[CCode (cname = "g_utf8_collate_key")]
extern string utf8_collate_key(string data, ssize_t len);
extern int sqlite3_unicodesn_register_tokenizer(Sqlite.Database db);
extern int sqlite3_register_legacy_tokenizer(Sqlite.Database db);
private class Geary.ImapDB.Database : Geary.Db.VersionedDatabase {
@ -73,6 +73,7 @@ private class Geary.ImapDB.Database : Geary.Db.VersionedDatabase {
private ProgressMonitor upgrade_monitor;
private ProgressMonitor vacuum_monitor;
private bool new_db = false;
private bool is_open_in_progress = false;
private GC? gc = null;
private Cancellable gc_cancellable = new Cancellable();
@ -93,7 +94,9 @@ private class Geary.ImapDB.Database : Geary.Db.VersionedDatabase {
*/
public new async void open(Db.DatabaseFlags flags, Cancellable? cancellable)
throws Error {
this.is_open_in_progress = true;
yield base.open(flags, cancellable);
this.is_open_in_progress = false;
yield run_gc(NONE, null, cancellable);
}
@ -251,10 +254,6 @@ private class Geary.ImapDB.Database : Geary.Db.VersionedDatabase {
yield post_upgrade_encode_folder_names(cancellable);
break;
case 11:
yield post_upgrade_add_search_table(cancellable);
break;
case 12:
yield post_upgrade_populate_internal_date_time_t(cancellable);
break;
@ -282,10 +281,6 @@ private class Geary.ImapDB.Database : Geary.Db.VersionedDatabase {
case 22:
yield post_upgrade_rebuild_attachments(cancellable);
break;
case 23:
yield post_upgrade_add_tokenizer_table(cancellable);
break;
}
}
@ -317,67 +312,6 @@ private class Geary.ImapDB.Database : Geary.Db.VersionedDatabase {
}, cancellable);
}
// Version 11.
private async void post_upgrade_add_search_table(Cancellable? cancellable)
throws Error {
yield exec_transaction_async(Db.TransactionType.RW, (cx) => {
string stemmer = find_appropriate_search_stemmer();
debug("Creating search table using %s stemmer", stemmer);
// This can't go in the .sql file because its schema (the stemmer
// algorithm) is determined at runtime.
cx.exec("""
CREATE VIRTUAL TABLE MessageSearchTable USING fts4(
body,
attachment,
subject,
from_field,
receivers,
cc,
bcc,
tokenize=unicodesn "stemmer=%s",
prefix="2,4,6,8,10",
);
""".printf(stemmer));
return Geary.Db.TransactionOutcome.COMMIT;
}, cancellable);
}
private string find_appropriate_search_stemmer() {
// Unfortunately, the stemmer library only accepts the full language
// name for the stemming algorithm. This translates between the user's
// preferred language ISO 639-1 code and our available stemmers.
// FIXME: the available list here is determined by what's included in
// src/sqlite3-unicodesn/CMakeLists.txt. We should pass that list in
// instead of hardcoding it here.
foreach (string l in Intl.get_language_names()) {
switch (l) {
case "da": return "danish";
case "nl": return "dutch";
case "en": return "english";
case "fi": return "finnish";
case "fr": return "french";
case "de": return "german";
case "hu": return "hungarian";
case "it": return "italian";
case "no": return "norwegian";
case "pt": return "portuguese";
case "ro": return "romanian";
case "ru": return "russian";
case "es": return "spanish";
case "sv": return "swedish";
case "tr": return "turkish";
}
}
// Default to English because it seems to be on average the language
// most likely to be present in emails, regardless of the user's
// language setting. This is not an exact science, and search results
// should be ok either way in most cases.
return "english";
}
// Versions 12 and 18.
private async void
post_upgrade_populate_internal_date_time_t(Cancellable? cancellable)
@ -635,25 +569,6 @@ private class Geary.ImapDB.Database : Geary.Db.VersionedDatabase {
}, cancellable);
}
// Version 23
private async void post_upgrade_add_tokenizer_table(Cancellable? cancellable)
throws Error {
yield exec_transaction_async(Db.TransactionType.RW, (cx) => {
string stemmer = find_appropriate_search_stemmer();
debug("Creating tokenizer table using %s stemmer", stemmer);
// These can't go in the .sql file because its schema (the stemmer
// algorithm) is determined at runtime.
cx.exec("""
CREATE VIRTUAL TABLE TokenizerTable USING fts3tokenize(
unicodesn,
"stemmer=%s"
);
""".printf(stemmer));
return Db.TransactionOutcome.COMMIT;
}, cancellable);
}
/**
* Determines if the database's FTS table indexes are valid.
*/
@ -706,7 +621,13 @@ private class Geary.ImapDB.Database : Geary.Db.VersionedDatabase {
cx.set_foreign_keys(true);
cx.set_recursive_triggers(true);
cx.set_synchronous(Db.SynchronousMode.NORMAL);
sqlite3_unicodesn_register_tokenizer(cx.db);
if (this.is_open_in_progress) {
// Register a tokenizer with old "unicodesn" name so that
// upgrades for existing databases that still reference it
// don't fail.
sqlite3_register_legacy_tokenizer(cx.db);
}
if (cx.db.create_function(
UTF8_CASE_INSENSITIVE_FN,

View file

@ -0,0 +1,143 @@
/*
* Parts of the code below have been taken from
* `ext/fts3/fts3_tokenizer.h` SQLite source code repository with the
* following copyright notice:
*
* "The author disclaims copyright to this source code."
*
* Parts of this code have been taken from
* <https://www.sqlite.org/fts3.html>, which carries the following
* copyright notice:
*
* All of the code and documentation in SQLite has been dedicated to
* the public domain by the authors. All code authors, and
* representatives of the companies they work for, have signed
* affidavits dedicating their contributions to the public domain and
* originals of those signed affidavits are stored in a firesafe at
* the main offices of Hwaci. Anyone is free to copy, modify, publish,
* use, compile, sell, or distribute the original SQLite code, either
* in source code form or as a compiled binary, for any purpose,
* commercial or non-commercial, and by any means.
*
* --- <https://www.sqlite.org/copyright.html>
*/
/*
* Defines SQLite FTS3/4 tokeniser with the same name as the one used
* in Geary prior to version 3.40, so that database upgrades that
* still reference this tokeniser can complete successfully.
*/
#define TOKENIZER_NAME "unicodesn"
#include <sqlite3.h>
#include <string.h>
#ifndef _FTS3_TOKENIZER_H_
#define _FTS3_TOKENIZER_H_
typedef struct sqlite3_tokenizer_module sqlite3_tokenizer_module;
typedef struct sqlite3_tokenizer sqlite3_tokenizer;
typedef struct sqlite3_tokenizer_cursor sqlite3_tokenizer_cursor;
struct sqlite3_tokenizer_module {
int iVersion;
int (*xCreate)(
int argc, /* Size of argv array */
const char *const*argv, /* Tokenizer argument strings */
sqlite3_tokenizer **ppTokenizer /* OUT: Created tokenizer */
);
int (*xDestroy)(sqlite3_tokenizer *pTokenizer);
int (*xOpen)(
sqlite3_tokenizer *pTokenizer, /* Tokenizer object */
const char *pInput, int nBytes, /* Input buffer */
sqlite3_tokenizer_cursor **ppCursor /* OUT: Created tokenizer cursor */
);
int (*xClose)(sqlite3_tokenizer_cursor *pCursor);
int (*xNext)(
sqlite3_tokenizer_cursor *pCursor, /* Tokenizer cursor */
const char **ppToken, int *pnBytes, /* OUT: Normalized text for token */
int *piStartOffset, /* OUT: Byte offset of token in input buffer */
int *piEndOffset, /* OUT: Byte offset of end of token in input buffer */
int *piPosition /* OUT: Number of tokens returned before this one */
);
int (*xLanguageid)(sqlite3_tokenizer_cursor *pCsr, int iLangid);
};
struct sqlite3_tokenizer {
const sqlite3_tokenizer_module *pModule; /* The module for this tokenizer */
/* Tokenizer implementations will typically add additional fields */
};
struct sqlite3_tokenizer_cursor {
sqlite3_tokenizer *pTokenizer; /* Tokenizer for this cursor. */
/* Tokenizer implementations will typically add additional fields */
};
int fts3_global_term_cnt(int iTerm, int iCol);
int fts3_term_cnt(int iTerm, int iCol);
#endif /* _FTS3_TOKENIZER_H_ */
static int registerTokenizer(
sqlite3 *db,
char *zName,
const sqlite3_tokenizer_module *p
){
int rc;
sqlite3_stmt *pStmt;
const char *zSql = "SELECT fts3_tokenizer(?, ?)";
/* Enable the 2-argument form of fts3_tokenizer in SQLite >= 3.12 */
rc = sqlite3_db_config(db,SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER,1,0);
if( rc!=SQLITE_OK ){
return rc;
}
rc = sqlite3_prepare_v2(db, zSql, -1, &pStmt, 0);
if( rc!=SQLITE_OK ){
return rc;
}
sqlite3_bind_text(pStmt, 1, zName, -1, SQLITE_STATIC);
sqlite3_bind_blob(pStmt, 2, &p, sizeof(p), SQLITE_STATIC);
sqlite3_step(pStmt);
return sqlite3_finalize(pStmt);
}
int queryTokenizer(
sqlite3 *db,
char *zName,
const sqlite3_tokenizer_module **pp
){
int rc;
sqlite3_stmt *pStmt;
const char *zSql = "SELECT fts3_tokenizer(?)";
*pp = 0;
rc = sqlite3_prepare_v2(db, zSql, -1, &pStmt, 0);
if( rc!=SQLITE_OK ){
return rc;
}
sqlite3_bind_text(pStmt, 1, zName, -1, SQLITE_STATIC);
if( SQLITE_ROW==sqlite3_step(pStmt) ){
if( sqlite3_column_type(pStmt, 0)==SQLITE_BLOB ){
memcpy(pp, sqlite3_column_blob(pStmt, 0), sizeof(*pp));
}
}
return sqlite3_finalize(pStmt);
}
#include <stdio.h>
int sqlite3_register_legacy_tokenizer(sqlite3 *db) {
static const sqlite3_tokenizer_module *tokenizer = 0;
if (!tokenizer) {
queryTokenizer(db, "simple", &tokenizer);
}
return registerTokenizer(db, TOKENIZER_NAME, tokenizer);
}

View file

@ -179,6 +179,7 @@ engine_vala_sources = files(
'imap-db/imap-db-gc.vala',
'imap-db/imap-db-message-row.vala',
'imap-db/imap-db-search-query.vala',
'imap-db/imap-db-sqlite.c',
'imap-engine/imap-engine.vala',
'imap-engine/imap-engine-account-operation.vala',
@ -386,7 +387,6 @@ engine_internal_header_fixup = custom_target(
engine_dep = declare_dependency(
link_with: [
engine_lib,
sqlite3_unicodesn_lib
],
include_directories: include_directories('.')
)
@ -398,9 +398,6 @@ engine_internal_dep = declare_dependency(
'-L' + engine_build_dir,
'-lgeary-engine'
],
link_with: [
sqlite3_unicodesn_lib,
],
include_directories: include_directories('.'),
sources: engine_internal_header_fixup
)

View file

@ -49,9 +49,10 @@ geary_c_args = [
'-DGCK_API_SUBJECT_TO_CHANGE',
'-DGCR_API_SUBJECT_TO_CHANGE',
'-DGOA_API_IS_SUBJECT_TO_CHANGE',
'-DSQLITE_ENABLE_FTS4',
'-DSQLITE_ENABLE_FTS4_UNICODE61'
]
subdir('sqlite3-unicodesn')
subdir('engine')
subdir('client')
subdir('console')

View file

@ -1,57 +0,0 @@
CC?=gcc
#CFLAGS=-W -Wall -g -O0
CFLAGS?= -Os -DNDEBUG -s
DESTDIR?= /usr
STEMMERS?= danish dutch english finnish french german hungarian \
italian norwegian porter portuguese romanian russian \
spanish swedish turkish
CFLAGS+= \
-DSQLITE_ENABLE_FTS4 \
-DSQLITE_ENABLE_FTS4_UNICODE61
SOURCES= \
fts3_unicode2.c \
fts3_unicodesn.c \
extension.c
HEADERS= fts3_tokenizer.h
INCLUDES= \
-Ilibstemmer_c/runtime \
-Ilibstemmer_c/src_c
LIBRARIES= -lsqlite3
SNOWBALL_SOURCES= \
libstemmer_c/runtime/api_sq3.c \
libstemmer_c/runtime/utilities_sq3.c
SNOWBALL_HEADERS= \
libstemmer_c/include/libstemmer.h \
libstemmer_c/runtime/api.h \
libstemmer_c/runtime/header.h
SNOWBALL_SOURCES+= $(foreach s, $(STEMMERS), libstemmer_c/src_c/stem_UTF_8_$(s).c)
SNOWBALL_HEADERS+= $(foreach s, $(STEMMERS), libstemmer_c/src_c/stem_UTF_8_$(s).h)
SNOWBALL_FLAGS+= $(foreach s, $(STEMMERS), -DWITH_STEMMER_$(s))
all: unicodesn.sqlext
unicodesn.sqlext: $(HEADERS) $(SOURCES) $(SNOWBALL_HEADERS) $(SNOWBALL_SOURCES)
$(CC) $(CFLAGS) $(SNOWBALL_FLAGS) $(INCLUDES) -fPIC -shared -fvisibility=hidden -o $@ \
$(SOURCES) $(SNOWBALL_SOURCES) $(LIBRARIES)
clean:
rm -f *.o unicodesn.sqlext
install: unicodesn.sqlext
mkdir -p ${DESTDIR}/lib 2> /dev/null
install -D -o root -g root -m 644 unicodesn.sqlext ${DESTDIR}/lib
.PHONY: clean install

View file

@ -1,33 +0,0 @@
SQLite3-unicodesn
==============
SQLite "unicode" full-text-search tokenizer with Snowball stemming
Installation
============
$ git clone git://github.com/littlesavage/sqlite3-unicodesn.git
$ cd sqlite3-unicodesn
$ make
$ su
# make install
Usage
======
$ sqlite3
sqlite> .load unicodesn.sqlext
sqlite> CREATE VIRTUAL TABLE fts USING fts3(text, tokenize=unicodesn "stemmer=russian");
sqlite> INSERT INTO fts VALUES ("Пионэры! Идите в жопу!");
sqlite> SELECT * FROM fts WHERE text MATCH 'Жопа';
Пионэры! Идите в жопу!
License
=======
Snowball files and stemmers are covered by the BSD license.
SQLite is in the Public Domain.
SQLite3-unicodesn code is in the Public Domain.

View file

@ -1,68 +0,0 @@
/*
** 2012 November 11
**
** The author disclaims copyright to this source code. In place of
** a legal notice, here is a blessing:
**
** May you do good and not evil.
** May you find forgiveness for yourself and forgive others.
** May you share freely, never taking more than you give.
**
******************************************************************************
**
*/
#include <sqlite3.h>
#include <sqlite3ext.h>
#include "fts3_unicodesn.h"
SQLITE_EXTENSION_INIT1
/*
** Register a tokenizer implementation with FTS3 or FTS4.
*/
static int registerTokenizer(
sqlite3 *db,
char *zName,
const sqlite3_tokenizer_module *p
){
int rc;
sqlite3_stmt *pStmt;
const char *zSql = "SELECT fts3_tokenizer(?, ?)";
rc = sqlite3_prepare_v2(db, zSql, -1, &pStmt, 0);
if( rc!=SQLITE_OK ){
return rc;
}
sqlite3_bind_text(pStmt, 1, zName, -1, SQLITE_STATIC);
sqlite3_bind_blob(pStmt, 2, &p, sizeof(p), SQLITE_STATIC);
sqlite3_step(pStmt);
return sqlite3_finalize(pStmt);
}
/* SQLite invokes this routine once when it loads the extension.
** Create new functions, collating sequences, and virtual table
** modules here. This is usually the only exported symbol in
** the shared library.
*/
int sqlite3_extension_init(
sqlite3 *db, /* The database connection */
char **pzErrMsg, /* Write error messages here */
const sqlite3_api_routines *pApi /* API methods */
)
{
const sqlite3_tokenizer_module *tokenizer;
SQLITE_EXTENSION_INIT2(pApi)
sqlite3Fts3UnicodeSnTokenizer(&tokenizer);
registerTokenizer(db, TOKENIZER_NAME, tokenizer);
return 0;
}

View file

@ -1,35 +0,0 @@
/*
** 2009 Nov 12
**
** The author disclaims copyright to this source code. In place of
** a legal notice, here is a blessing:
**
** May you do good and not evil.
** May you find forgiveness for yourself and forgive others.
** May you share freely, never taking more than you give.
**
******************************************************************************
**
*/
#ifndef _FTSINT_H
#define _FTSINT_H
#include "sqlite3.h"
#include "fts3_tokenizer.h"
typedef unsigned char u8; /* 1-byte (or larger) unsigned integer */
typedef short int i16; /* 2-byte (or larger) signed integer */
typedef unsigned int u32; /* 4-byte unsigned integer */
typedef sqlite3_uint64 u64; /* 8-byte unsigned integer */
typedef sqlite3_int64 i64; /* 8-byte signed integer */
#define UNUSED_PARAMETER(x) (void)(x)
/* fts3_unicode2.c (functions generated by parsing unicode text files) */
#ifdef SQLITE_ENABLE_FTS4_UNICODE61
int sqlite3FtsUnicodeFold(int, int);
int sqlite3FtsUnicodeIsalnum(int);
int sqlite3FtsUnicodeIsdiacritic(int);
#endif
#endif /* _FTSINT_H */

View file

@ -1,161 +0,0 @@
/*
** 2006 July 10
**
** The author disclaims copyright to this source code.
**
*************************************************************************
** Defines the interface to tokenizers used by fulltext-search. There
** are three basic components:
**
** sqlite3_tokenizer_module is a singleton defining the tokenizer
** interface functions. This is essentially the class structure for
** tokenizers.
**
** sqlite3_tokenizer is used to define a particular tokenizer, perhaps
** including customization information defined at creation time.
**
** sqlite3_tokenizer_cursor is generated by a tokenizer to generate
** tokens from a particular input.
*/
#ifndef _FTS3_TOKENIZER_H_
#define _FTS3_TOKENIZER_H_
/* TODO(shess) Only used for SQLITE_OK and SQLITE_DONE at this time.
** If tokenizers are to be allowed to call sqlite3_*() functions, then
** we will need a way to register the API consistently.
*/
#include "sqlite3.h"
/*
** Structures used by the tokenizer interface. When a new tokenizer
** implementation is registered, the caller provides a pointer to
** an sqlite3_tokenizer_module containing pointers to the callback
** functions that make up an implementation.
**
** When an fts3 table is created, it passes any arguments passed to
** the tokenizer clause of the CREATE VIRTUAL TABLE statement to the
** sqlite3_tokenizer_module.xCreate() function of the requested tokenizer
** implementation. The xCreate() function in turn returns an
** sqlite3_tokenizer structure representing the specific tokenizer to
** be used for the fts3 table (customized by the tokenizer clause arguments).
**
** To tokenize an input buffer, the sqlite3_tokenizer_module.xOpen()
** method is called. It returns an sqlite3_tokenizer_cursor object
** that may be used to tokenize a specific input buffer based on
** the tokenization rules supplied by a specific sqlite3_tokenizer
** object.
*/
typedef struct sqlite3_tokenizer_module sqlite3_tokenizer_module;
typedef struct sqlite3_tokenizer sqlite3_tokenizer;
typedef struct sqlite3_tokenizer_cursor sqlite3_tokenizer_cursor;
struct sqlite3_tokenizer_module {
/*
** Structure version. Should always be set to 0 or 1.
*/
int iVersion;
/*
** Create a new tokenizer. The values in the argv[] array are the
** arguments passed to the "tokenizer" clause of the CREATE VIRTUAL
** TABLE statement that created the fts3 table. For example, if
** the following SQL is executed:
**
** CREATE .. USING fts3( ... , tokenizer <tokenizer-name> arg1 arg2)
**
** then argc is set to 2, and the argv[] array contains pointers
** to the strings "arg1" and "arg2".
**
** This method should return either SQLITE_OK (0), or an SQLite error
** code. If SQLITE_OK is returned, then *ppTokenizer should be set
** to point at the newly created tokenizer structure. The generic
** sqlite3_tokenizer.pModule variable should not be initialised by
** this callback. The caller will do so.
*/
int (*xCreate)(
int argc, /* Size of argv array */
const char *const*argv, /* Tokenizer argument strings */
sqlite3_tokenizer **ppTokenizer /* OUT: Created tokenizer */
);
/*
** Destroy an existing tokenizer. The fts3 module calls this method
** exactly once for each successful call to xCreate().
*/
int (*xDestroy)(sqlite3_tokenizer *pTokenizer);
/*
** Create a tokenizer cursor to tokenize an input buffer. The caller
** is responsible for ensuring that the input buffer remains valid
** until the cursor is closed (using the xClose() method).
*/
int (*xOpen)(
sqlite3_tokenizer *pTokenizer, /* Tokenizer object */
const char *pInput, int nBytes, /* Input buffer */
sqlite3_tokenizer_cursor **ppCursor /* OUT: Created tokenizer cursor */
);
/*
** Destroy an existing tokenizer cursor. The fts3 module calls this
** method exactly once for each successful call to xOpen().
*/
int (*xClose)(sqlite3_tokenizer_cursor *pCursor);
/*
** Retrieve the next token from the tokenizer cursor pCursor. This
** method should either return SQLITE_OK and set the values of the
** "OUT" variables identified below, or SQLITE_DONE to indicate that
** the end of the buffer has been reached, or an SQLite error code.
**
** *ppToken should be set to point at a buffer containing the
** normalized version of the token (i.e. after any case-folding and/or
** stemming has been performed). *pnBytes should be set to the length
** of this buffer in bytes. The input text that generated the token is
** identified by the byte offsets returned in *piStartOffset and
** *piEndOffset. *piStartOffset should be set to the index of the first
** byte of the token in the input buffer. *piEndOffset should be set
** to the index of the first byte just past the end of the token in
** the input buffer.
**
** The buffer *ppToken is set to point at is managed by the tokenizer
** implementation. It is only required to be valid until the next call
** to xNext() or xClose().
*/
/* TODO(shess) current implementation requires pInput to be
** nul-terminated. This should either be fixed, or pInput/nBytes
** should be converted to zInput.
*/
int (*xNext)(
sqlite3_tokenizer_cursor *pCursor, /* Tokenizer cursor */
const char **ppToken, int *pnBytes, /* OUT: Normalized text for token */
int *piStartOffset, /* OUT: Byte offset of token in input buffer */
int *piEndOffset, /* OUT: Byte offset of end of token in input buffer */
int *piPosition /* OUT: Number of tokens returned before this one */
);
/***********************************************************************
** Methods below this point are only available if iVersion>=1.
*/
/*
** Configure the language id of a tokenizer cursor.
*/
int (*xLanguageid)(sqlite3_tokenizer_cursor *pCsr, int iLangid);
};
struct sqlite3_tokenizer {
const sqlite3_tokenizer_module *pModule; /* The module for this tokenizer */
/* Tokenizer implementations will typically add additional fields */
};
struct sqlite3_tokenizer_cursor {
sqlite3_tokenizer *pTokenizer; /* Tokenizer for this cursor. */
/* Tokenizer implementations will typically add additional fields */
};
int fts3_global_term_cnt(int iTerm, int iCol);
int fts3_term_cnt(int iTerm, int iCol);
#endif /* _FTS3_TOKENIZER_H_ */

View file

@ -1,366 +0,0 @@
/*
** 2012 May 25
**
** The author disclaims copyright to this source code. In place of
** a legal notice, here is a blessing:
**
** May you do good and not evil.
** May you find forgiveness for yourself and forgive others.
** May you share freely, never taking more than you give.
**
******************************************************************************
*/
/*
** DO NOT EDIT THIS MACHINE GENERATED FILE.
*/
#if defined(SQLITE_ENABLE_FTS4_UNICODE61)
#if defined(SQLITE_ENABLE_FTS3) || defined(SQLITE_ENABLE_FTS4)
#include <assert.h>
/*
** Return true if the argument corresponds to a unicode codepoint
** classified as either a letter or a number. Otherwise false.
**
** The results are undefined if the value passed to this function
** is less than zero.
*/
int sqlite3FtsUnicodeIsalnum(int c){
/* Each unsigned integer in the following array corresponds to a contiguous
** range of unicode codepoints that are not either letters or numbers (i.e.
** codepoints for which this function should return 0).
**
** The most significant 22 bits in each 32-bit value contain the first
** codepoint in the range. The least significant 10 bits are used to store
** the size of the range (always at least 1). In other words, the value
** ((C<<22) + N) represents a range of N codepoints starting with codepoint
** C. It is not possible to represent a range larger than 1023 codepoints
** using this format.
*/
static const unsigned int aEntry[] = {
0x00000030, 0x0000E807, 0x00016C06, 0x0001EC2F, 0x0002AC07,
0x0002D001, 0x0002D803, 0x0002EC01, 0x0002FC01, 0x00035C01,
0x0003DC01, 0x000B0804, 0x000B480E, 0x000B9407, 0x000BB401,
0x000BBC81, 0x000DD401, 0x000DF801, 0x000E1002, 0x000E1C01,
0x000FD801, 0x00120808, 0x00156806, 0x00162402, 0x00163C01,
0x00164437, 0x0017CC02, 0x00180005, 0x00181816, 0x00187802,
0x00192C15, 0x0019A804, 0x0019C001, 0x001B5001, 0x001B580F,
0x001B9C07, 0x001BF402, 0x001C000E, 0x001C3C01, 0x001C4401,
0x001CC01B, 0x001E980B, 0x001FAC09, 0x001FD804, 0x00205804,
0x00206C09, 0x00209403, 0x0020A405, 0x0020C00F, 0x00216403,
0x00217801, 0x0023901B, 0x00240004, 0x0024E803, 0x0024F812,
0x00254407, 0x00258804, 0x0025C001, 0x00260403, 0x0026F001,
0x0026F807, 0x00271C02, 0x00272C03, 0x00275C01, 0x00278802,
0x0027C802, 0x0027E802, 0x00280403, 0x0028F001, 0x0028F805,
0x00291C02, 0x00292C03, 0x00294401, 0x0029C002, 0x0029D401,
0x002A0403, 0x002AF001, 0x002AF808, 0x002B1C03, 0x002B2C03,
0x002B8802, 0x002BC002, 0x002C0403, 0x002CF001, 0x002CF807,
0x002D1C02, 0x002D2C03, 0x002D5802, 0x002D8802, 0x002DC001,
0x002E0801, 0x002EF805, 0x002F1803, 0x002F2804, 0x002F5C01,
0x002FCC08, 0x00300403, 0x0030F807, 0x00311803, 0x00312804,
0x00315402, 0x00318802, 0x0031FC01, 0x00320802, 0x0032F001,
0x0032F807, 0x00331803, 0x00332804, 0x00335402, 0x00338802,
0x00340802, 0x0034F807, 0x00351803, 0x00352804, 0x00355C01,
0x00358802, 0x0035E401, 0x00360802, 0x00372801, 0x00373C06,
0x00375801, 0x00376008, 0x0037C803, 0x0038C401, 0x0038D007,
0x0038FC01, 0x00391C09, 0x00396802, 0x003AC401, 0x003AD006,
0x003AEC02, 0x003B2006, 0x003C041F, 0x003CD00C, 0x003DC417,
0x003E340B, 0x003E6424, 0x003EF80F, 0x003F380D, 0x0040AC14,
0x00412806, 0x00415804, 0x00417803, 0x00418803, 0x00419C07,
0x0041C404, 0x0042080C, 0x00423C01, 0x00426806, 0x0043EC01,
0x004D740C, 0x004E400A, 0x00500001, 0x0059B402, 0x005A0001,
0x005A6C02, 0x005BAC03, 0x005C4803, 0x005CC805, 0x005D4802,
0x005DC802, 0x005ED023, 0x005F6004, 0x005F7401, 0x0060000F,
0x0062A401, 0x0064800C, 0x0064C00C, 0x00650001, 0x00651002,
0x0066C011, 0x00672002, 0x00677822, 0x00685C05, 0x00687802,
0x0069540A, 0x0069801D, 0x0069FC01, 0x006A8007, 0x006AA006,
0x006C0005, 0x006CD011, 0x006D6823, 0x006E0003, 0x006E840D,
0x006F980E, 0x006FF004, 0x00709014, 0x0070EC05, 0x0071F802,
0x00730008, 0x00734019, 0x0073B401, 0x0073C803, 0x00770027,
0x0077F004, 0x007EF401, 0x007EFC03, 0x007F3403, 0x007F7403,
0x007FB403, 0x007FF402, 0x00800065, 0x0081A806, 0x0081E805,
0x00822805, 0x0082801A, 0x00834021, 0x00840002, 0x00840C04,
0x00842002, 0x00845001, 0x00845803, 0x00847806, 0x00849401,
0x00849C01, 0x0084A401, 0x0084B801, 0x0084E802, 0x00850005,
0x00852804, 0x00853C01, 0x00864264, 0x00900027, 0x0091000B,
0x0092704E, 0x00940200, 0x009C0475, 0x009E53B9, 0x00AD400A,
0x00B39406, 0x00B3BC03, 0x00B3E404, 0x00B3F802, 0x00B5C001,
0x00B5FC01, 0x00B7804F, 0x00B8C00C, 0x00BA001A, 0x00BA6C59,
0x00BC00D6, 0x00BFC00C, 0x00C00005, 0x00C02019, 0x00C0A807,
0x00C0D802, 0x00C0F403, 0x00C26404, 0x00C28001, 0x00C3EC01,
0x00C64002, 0x00C6580A, 0x00C70024, 0x00C8001F, 0x00C8A81E,
0x00C94001, 0x00C98020, 0x00CA2827, 0x00CB003F, 0x00CC0100,
0x01370040, 0x02924037, 0x0293F802, 0x02983403, 0x0299BC10,
0x029A7C01, 0x029BC008, 0x029C0017, 0x029C8002, 0x029E2402,
0x02A00801, 0x02A01801, 0x02A02C01, 0x02A08C09, 0x02A0D804,
0x02A1D004, 0x02A20002, 0x02A2D011, 0x02A33802, 0x02A38012,
0x02A3E003, 0x02A4980A, 0x02A51C0D, 0x02A57C01, 0x02A60004,
0x02A6CC1B, 0x02A77802, 0x02A8A40E, 0x02A90C01, 0x02A93002,
0x02A97004, 0x02A9DC03, 0x02A9EC01, 0x02AAC001, 0x02AAC803,
0x02AADC02, 0x02AAF802, 0x02AB0401, 0x02AB7802, 0x02ABAC07,
0x02ABD402, 0x02AF8C0B, 0x03600001, 0x036DFC02, 0x036FFC02,
0x037FFC02, 0x03E3FC01, 0x03EC7801, 0x03ECA401, 0x03EEC810,
0x03F4F802, 0x03F7F002, 0x03F8001A, 0x03F88007, 0x03F8C023,
0x03F95013, 0x03F9A004, 0x03FBFC01, 0x03FC040F, 0x03FC6807,
0x03FCEC06, 0x03FD6C0B, 0x03FF8007, 0x03FFA007, 0x03FFE405,
0x04040003, 0x0404DC09, 0x0405E411, 0x0406400C, 0x0407402E,
0x040E7C01, 0x040F4001, 0x04215C01, 0x04247C01, 0x0424FC01,
0x04280403, 0x04281402, 0x04283004, 0x0428E003, 0x0428FC01,
0x04294009, 0x0429FC01, 0x042CE407, 0x04400003, 0x0440E016,
0x04420003, 0x0442C012, 0x04440003, 0x04449C0E, 0x04450004,
0x04460003, 0x0446CC0E, 0x04471404, 0x045AAC0D, 0x0491C004,
0x05BD442E, 0x05BE3C04, 0x074000F6, 0x07440027, 0x0744A4B5,
0x07480046, 0x074C0057, 0x075B0401, 0x075B6C01, 0x075BEC01,
0x075C5401, 0x075CD401, 0x075D3C01, 0x075DBC01, 0x075E2401,
0x075EA401, 0x075F0C01, 0x07BBC002, 0x07C0002C, 0x07C0C064,
0x07C2800F, 0x07C2C40E, 0x07C3040F, 0x07C3440F, 0x07C4401F,
0x07C4C03C, 0x07C5C02B, 0x07C7981D, 0x07C8402B, 0x07C90009,
0x07C94002, 0x07CC0021, 0x07CCC006, 0x07CCDC46, 0x07CE0014,
0x07CE8025, 0x07CF1805, 0x07CF8011, 0x07D0003F, 0x07D10001,
0x07D108B6, 0x07D3E404, 0x07D4003E, 0x07D50004, 0x07D54018,
0x07D7EC46, 0x07D9140B, 0x07DA0046, 0x07DC0074, 0x38000401,
0x38008060, 0x380400F0, 0x3C000001, 0x3FFFF401, 0x40000001,
0x43FFF401,
};
static const unsigned int aAscii[4] = {
0xFFFFFFFF, 0xFC00FFFF, 0xF8000001, 0xF8000001,
};
if( c<128 ){
return ( (aAscii[c >> 5] & (1 << (c & 0x001F)))==0 );
}else if( c<(1<<22) ){
unsigned int key = (((unsigned int)c)<<10) | 0x000003FF;
int iRes= 0;
int iHi = sizeof(aEntry)/sizeof(aEntry[0]) - 1;
int iLo = 0;
while( iHi>=iLo ){
int iTest = (iHi + iLo) / 2;
if( key >= aEntry[iTest] ){
iRes = iTest;
iLo = iTest+1;
}else{
iHi = iTest-1;
}
}
assert( aEntry[0]<key );
assert( key>=aEntry[iRes] );
return (((unsigned int)c) >= ((aEntry[iRes]>>10) + (aEntry[iRes]&0x3FF)));
}
return 1;
}
/*
** If the argument is a codepoint corresponding to a lowercase letter
** in the ASCII range with a diacritic added, return the codepoint
** of the ASCII letter only. For example, if passed 235 - "LATIN
** SMALL LETTER E WITH DIAERESIS" - return 65 ("LATIN SMALL LETTER
** E"). The resuls of passing a codepoint that corresponds to an
** uppercase letter are undefined.
*/
static int remove_diacritic(int c){
unsigned short aDia[] = {
0, 1797, 1848, 1859, 1891, 1928, 1940, 1995,
2024, 2040, 2060, 2110, 2168, 2206, 2264, 2286,
2344, 2383, 2472, 2488, 2516, 2596, 2668, 2732,
2782, 2842, 2894, 2954, 2984, 3000, 3028, 3336,
3456, 3696, 3712, 3728, 3744, 3896, 3912, 3928,
3968, 4008, 4040, 4106, 4138, 4170, 4202, 4234,
4266, 4296, 4312, 4344, 4408, 4424, 4472, 4504,
6148, 6198, 6264, 6280, 6360, 6429, 6505, 6529,
61448, 61468, 61534, 61592, 61642, 61688, 61704, 61726,
61784, 61800, 61836, 61880, 61914, 61948, 61998, 62122,
62154, 62200, 62218, 62302, 62364, 62442, 62478, 62536,
62554, 62584, 62604, 62640, 62648, 62656, 62664, 62730,
62924, 63050, 63082, 63274, 63390,
};
char aChar[] = {
'\0', 'a', 'c', 'e', 'i', 'n', 'o', 'u', 'y', 'y', 'a', 'c',
'd', 'e', 'e', 'g', 'h', 'i', 'j', 'k', 'l', 'n', 'o', 'r',
's', 't', 'u', 'u', 'w', 'y', 'z', 'o', 'u', 'a', 'i', 'o',
'u', 'g', 'k', 'o', 'j', 'g', 'n', 'a', 'e', 'i', 'o', 'r',
'u', 's', 't', 'h', 'a', 'e', 'o', 'y', '\0', '\0', '\0', '\0',
'\0', '\0', '\0', '\0', 'a', 'b', 'd', 'd', 'e', 'f', 'g', 'h',
'h', 'i', 'k', 'l', 'l', 'm', 'n', 'p', 'r', 'r', 's', 't',
'u', 'v', 'w', 'w', 'x', 'y', 'z', 'h', 't', 'w', 'y', 'a',
'e', 'i', 'o', 'u', 'y',
};
unsigned int key = (((unsigned int)c)<<3) | 0x00000007;
int iRes = 0;
int iHi = sizeof(aDia)/sizeof(aDia[0]) - 1;
int iLo = 0;
while( iHi>=iLo ){
int iTest = (iHi + iLo) / 2;
if( key >= aDia[iTest] ){
iRes = iTest;
iLo = iTest+1;
}else{
iHi = iTest-1;
}
}
assert( key>=aDia[iRes] );
return ((c > (aDia[iRes]>>3) + (aDia[iRes]&0x07)) ? c : (int)aChar[iRes]);
}
/*
** Return true if the argument interpreted as a unicode codepoint
** is a diacritical modifier character.
*/
int sqlite3FtsUnicodeIsdiacritic(int c){
unsigned int mask0 = 0x08029FDF;
unsigned int mask1 = 0x000361F8;
if( c<768 || c>817 ) return 0;
return (c < 768+32) ?
(mask0 & (1 << (c-768))) :
(mask1 & (1 << (c-768-32)));
}
/*
** Interpret the argument as a unicode codepoint. If the codepoint
** is an upper case character that has a lower case equivalent,
** return the codepoint corresponding to the lower case version.
** Otherwise, return a copy of the argument.
**
** The results are undefined if the value passed to this function
** is less than zero.
*/
int sqlite3FtsUnicodeFold(int c, int bRemoveDiacritic){
/* Each entry in the following array defines a rule for folding a range
** of codepoints to lower case. The rule applies to a range of nRange
** codepoints starting at codepoint iCode.
**
** If the least significant bit in flags is clear, then the rule applies
** to all nRange codepoints (i.e. all nRange codepoints are upper case and
** need to be folded). Or, if it is set, then the rule only applies to
** every second codepoint in the range, starting with codepoint C.
**
** The 7 most significant bits in flags are an index into the aiOff[]
** array. If a specific codepoint C does require folding, then its lower
** case equivalent is ((C + aiOff[flags>>1]) & 0xFFFF).
**
** The contents of this array are generated by parsing the CaseFolding.txt
** file distributed as part of the "Unicode Character Database". See
** http://www.unicode.org for details.
*/
static const struct TableEntry {
unsigned short iCode;
unsigned char flags;
unsigned char nRange;
} aEntry[] = {
{65, 14, 26}, {181, 64, 1}, {192, 14, 23},
{216, 14, 7}, {256, 1, 48}, {306, 1, 6},
{313, 1, 16}, {330, 1, 46}, {376, 116, 1},
{377, 1, 6}, {383, 104, 1}, {385, 50, 1},
{386, 1, 4}, {390, 44, 1}, {391, 0, 1},
{393, 42, 2}, {395, 0, 1}, {398, 32, 1},
{399, 38, 1}, {400, 40, 1}, {401, 0, 1},
{403, 42, 1}, {404, 46, 1}, {406, 52, 1},
{407, 48, 1}, {408, 0, 1}, {412, 52, 1},
{413, 54, 1}, {415, 56, 1}, {416, 1, 6},
{422, 60, 1}, {423, 0, 1}, {425, 60, 1},
{428, 0, 1}, {430, 60, 1}, {431, 0, 1},
{433, 58, 2}, {435, 1, 4}, {439, 62, 1},
{440, 0, 1}, {444, 0, 1}, {452, 2, 1},
{453, 0, 1}, {455, 2, 1}, {456, 0, 1},
{458, 2, 1}, {459, 1, 18}, {478, 1, 18},
{497, 2, 1}, {498, 1, 4}, {502, 122, 1},
{503, 134, 1}, {504, 1, 40}, {544, 110, 1},
{546, 1, 18}, {570, 70, 1}, {571, 0, 1},
{573, 108, 1}, {574, 68, 1}, {577, 0, 1},
{579, 106, 1}, {580, 28, 1}, {581, 30, 1},
{582, 1, 10}, {837, 36, 1}, {880, 1, 4},
{886, 0, 1}, {902, 18, 1}, {904, 16, 3},
{908, 26, 1}, {910, 24, 2}, {913, 14, 17},
{931, 14, 9}, {962, 0, 1}, {975, 4, 1},
{976, 140, 1}, {977, 142, 1}, {981, 146, 1},
{982, 144, 1}, {984, 1, 24}, {1008, 136, 1},
{1009, 138, 1}, {1012, 130, 1}, {1013, 128, 1},
{1015, 0, 1}, {1017, 152, 1}, {1018, 0, 1},
{1021, 110, 3}, {1024, 34, 16}, {1040, 14, 32},
{1120, 1, 34}, {1162, 1, 54}, {1216, 6, 1},
{1217, 1, 14}, {1232, 1, 88}, {1329, 22, 38},
{4256, 66, 38}, {4295, 66, 1}, {4301, 66, 1},
{7680, 1, 150}, {7835, 132, 1}, {7838, 96, 1},
{7840, 1, 96}, {7944, 150, 8}, {7960, 150, 6},
{7976, 150, 8}, {7992, 150, 8}, {8008, 150, 6},
{8025, 151, 8}, {8040, 150, 8}, {8072, 150, 8},
{8088, 150, 8}, {8104, 150, 8}, {8120, 150, 2},
{8122, 126, 2}, {8124, 148, 1}, {8126, 100, 1},
{8136, 124, 4}, {8140, 148, 1}, {8152, 150, 2},
{8154, 120, 2}, {8168, 150, 2}, {8170, 118, 2},
{8172, 152, 1}, {8184, 112, 2}, {8186, 114, 2},
{8188, 148, 1}, {8486, 98, 1}, {8490, 92, 1},
{8491, 94, 1}, {8498, 12, 1}, {8544, 8, 16},
{8579, 0, 1}, {9398, 10, 26}, {11264, 22, 47},
{11360, 0, 1}, {11362, 88, 1}, {11363, 102, 1},
{11364, 90, 1}, {11367, 1, 6}, {11373, 84, 1},
{11374, 86, 1}, {11375, 80, 1}, {11376, 82, 1},
{11378, 0, 1}, {11381, 0, 1}, {11390, 78, 2},
{11392, 1, 100}, {11499, 1, 4}, {11506, 0, 1},
{42560, 1, 46}, {42624, 1, 24}, {42786, 1, 14},
{42802, 1, 62}, {42873, 1, 4}, {42877, 76, 1},
{42878, 1, 10}, {42891, 0, 1}, {42893, 74, 1},
{42896, 1, 4}, {42912, 1, 10}, {42922, 72, 1},
{65313, 14, 26},
};
static const unsigned short aiOff[] = {
1, 2, 8, 15, 16, 26, 28, 32,
37, 38, 40, 48, 63, 64, 69, 71,
79, 80, 116, 202, 203, 205, 206, 207,
209, 210, 211, 213, 214, 217, 218, 219,
775, 7264, 10792, 10795, 23228, 23256, 30204, 54721,
54753, 54754, 54756, 54787, 54793, 54809, 57153, 57274,
57921, 58019, 58363, 61722, 65268, 65341, 65373, 65406,
65408, 65410, 65415, 65424, 65436, 65439, 65450, 65462,
65472, 65476, 65478, 65480, 65482, 65488, 65506, 65511,
65514, 65521, 65527, 65528, 65529,
};
int ret = c;
assert( c>=0 );
assert( sizeof(unsigned short)==2 && sizeof(unsigned char)==1 );
if( c<128 ){
if( c>='A' && c<='Z' ) ret = c + ('a' - 'A');
}else if( c<65536 ){
int iHi = sizeof(aEntry)/sizeof(aEntry[0]) - 1;
int iLo = 0;
int iRes = -1;
while( iHi>=iLo ){
int iTest = (iHi + iLo) / 2;
int cmp = (c - aEntry[iTest].iCode);
if( cmp>=0 ){
iRes = iTest;
iLo = iTest+1;
}else{
iHi = iTest-1;
}
}
assert( iRes<0 || c>=aEntry[iRes].iCode );
if( iRes>=0 ){
const struct TableEntry *p = &aEntry[iRes];
if( c<(p->iCode + p->nRange) && 0==(0x01 & p->flags & (p->iCode ^ c)) ){
ret = (c + (aiOff[p->flags>>1])) & 0x0000FFFF;
assert( ret>0 );
}
}
if( bRemoveDiacritic ) ret = remove_diacritic(ret);
}
else if( c>=66560 && c<66600 ){
ret = c + 40;
}
return ret;
}
#endif /* defined(SQLITE_ENABLE_FTS3) || defined(SQLITE_ENABLE_FTS4) */
#endif /* !defined(SQLITE_ENABLE_FTS4_UNICODE61) */

View file

@ -1,583 +0,0 @@
/*
** 2012 Nov 11
**
** The author disclaims copyright to this source code. In place of
** a legal notice, here is a blessing:
**
** May you do good and not evil.
** May you find forgiveness for yourself and forgive others.
** May you share freely, never taking more than you give.
**
******************************************************************************
**
** Implementation of the "unicode" full-text-search tokenizer with Snowball stemming
*/
#include "fts3_unicodesn.h"
/* Snowball stemmer */
#include "api.h"
#ifdef SQLITE_ENABLE_FTS4_UNICODE61
#include "fts3Int.h"
#if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3)
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "fts3_tokenizer.h"
/*
** The following two macros - READ_UTF8 and WRITE_UTF8 - have been copied
** from the sqlite3 source file utf.c. If this file is compiled as part
** of the amalgamation, they are not required.
*/
#ifndef SQLITE_AMALGAMATION
static const unsigned char sqlite3Utf8Trans1[] = {
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x00, 0x01, 0x02, 0x03, 0x00, 0x01, 0x00, 0x00,
};
#define READ_UTF8(zIn, zTerm, c) \
c = *(zIn++); \
if( c>=0xc0 ){ \
c = sqlite3Utf8Trans1[c-0xc0]; \
while( zIn!=zTerm && (*zIn & 0xc0)==0x80 ){ \
c = (c<<6) + (0x3f & *(zIn++)); \
} \
if( c<0x80 \
|| (c&0xFFFFF800)==0xD800 \
|| (c&0xFFFFFFFE)==0xFFFE ){ c = 0xFFFD; } \
}
#define WRITE_UTF8(zOut, c) { \
if( c<0x00080 ){ \
*zOut++ = (u8)(c&0xFF); \
} \
else if( c<0x00800 ){ \
*zOut++ = 0xC0 + (u8)((c>>6)&0x1F); \
*zOut++ = 0x80 + (u8)(c & 0x3F); \
} \
else if( c<0x10000 ){ \
*zOut++ = 0xE0 + (u8)((c>>12)&0x0F); \
*zOut++ = 0x80 + (u8)((c>>6) & 0x3F); \
*zOut++ = 0x80 + (u8)(c & 0x3F); \
}else{ \
*zOut++ = 0xF0 + (u8)((c>>18) & 0x07); \
*zOut++ = 0x80 + (u8)((c>>12) & 0x3F); \
*zOut++ = 0x80 + (u8)((c>>6) & 0x3F); \
*zOut++ = 0x80 + (u8)(c & 0x3F); \
} \
}
#endif /* ifndef SQLITE_AMALGAMATION */
typedef struct unicode_tokenizer unicode_tokenizer;
typedef struct unicode_cursor unicode_cursor;
struct unicode_tokenizer {
sqlite3_tokenizer base;
int bRemoveDiacritic;
int nException;
int *aiException;
/* Snowball stemmer */
struct {
struct SN_env * (*create)(void);
void (*close)(struct SN_env *);
int (*stem)(struct SN_env *);
} stemmer;
};
struct unicode_cursor {
sqlite3_tokenizer_cursor base;
const unsigned char *aInput; /* Input text being tokenized */
int nInput; /* Size of aInput[] in bytes */
int iOff; /* Current offset within aInput[] */
int iToken; /* Index of next token to be returned */
char *zToken; /* storage for current token */
int nAlloc; /* space allocated at zToken */
struct SN_env *pStemmer; /* Snowball stemmer */
};
/*
** Destroy a tokenizer allocated by unicodeCreate().
*/
static int unicodeDestroy(sqlite3_tokenizer *pTokenizer){
if( pTokenizer ){
unicode_tokenizer *p = (unicode_tokenizer *)pTokenizer;
sqlite3_free(p->aiException);
sqlite3_free(p);
}
return SQLITE_OK;
}
/*
** As part of a tokenchars= or separators= option, the CREATE VIRTUAL TABLE
** statement has specified that the tokenizer for this table shall consider
** all characters in string zIn/nIn to be separators (if bAlnum==0) or
** token characters (if bAlnum==1).
**
** For each codepoint in the zIn/nIn string, this function checks if the
** sqlite3FtsUnicodeIsalnum() function already returns the desired result.
** If so, no action is taken. Otherwise, the codepoint is added to the
** unicode_tokenizer.aiException[] array. For the purposes of tokenization,
** the return value of sqlite3FtsUnicodeIsalnum() is inverted for all
** codepoints in the aiException[] array.
**
** If a standalone diacritic mark (one that sqlite3FtsUnicodeIsdiacritic()
** identifies as a diacritic) occurs in the zIn/nIn string it is ignored.
** It is not possible to change the behaviour of the tokenizer with respect
** to these codepoints.
*/
static int unicodeAddExceptions(
unicode_tokenizer *p, /* Tokenizer to add exceptions to */
int bAlnum, /* Replace Isalnum() return value with this */
const char *zIn, /* Array of characters to make exceptions */
int nIn /* Length of z in bytes */
){
const unsigned char *z = (const unsigned char *)zIn;
const unsigned char *zTerm = &z[nIn];
int iCode;
int nEntry = 0;
assert( bAlnum==0 || bAlnum==1 );
while( z<zTerm ){
READ_UTF8(z, zTerm, iCode);
assert( (sqlite3FtsUnicodeIsalnum(iCode) & 0xFFFFFFFE)==0 );
if( sqlite3FtsUnicodeIsalnum(iCode)!=bAlnum
&& sqlite3FtsUnicodeIsdiacritic(iCode)==0
){
nEntry++;
}
}
if( nEntry ){
int *aNew; /* New aiException[] array */
int nNew; /* Number of valid entries in array aNew[] */
aNew = sqlite3_realloc(p->aiException, (p->nException+nEntry)*sizeof(int));
if( aNew==0 ) return SQLITE_NOMEM;
nNew = p->nException;
z = (const unsigned char *)zIn;
while( z<zTerm ){
READ_UTF8(z, zTerm, iCode);
if( sqlite3FtsUnicodeIsalnum(iCode)!=bAlnum
&& sqlite3FtsUnicodeIsdiacritic(iCode)==0
){
int i, j;
for(i=0; i<nNew && aNew[i]<iCode; i++);
for(j=nNew; j>i; j--) aNew[j] = aNew[j-1];
aNew[i] = iCode;
nNew++;
}
}
p->aiException = aNew;
p->nException = nNew;
}
return SQLITE_OK;
}
/*
** Return true if the p->aiException[] array contains the value iCode.
*/
static int unicodeIsException(unicode_tokenizer *p, int iCode){
if( p->nException>0 ){
int *a = p->aiException;
int iLo = 0;
int iHi = p->nException-1;
while( iHi>=iLo ){
int iTest = (iHi + iLo) / 2;
if( iCode==a[iTest] ){
return 1;
}else if( iCode>a[iTest] ){
iLo = iTest+1;
}else{
iHi = iTest-1;
}
}
}
return 0;
}
/*
** Return true if, for the purposes of tokenization, codepoint iCode is
** considered a token character (not a separator).
*/
static int unicodeIsAlnum(unicode_tokenizer *p, int iCode){
assert( (sqlite3FtsUnicodeIsalnum(iCode) & 0xFFFFFFFE)==0 );
return sqlite3FtsUnicodeIsalnum(iCode) ^ unicodeIsException(p, iCode);
}
static int unicodeSetStemmer(
unicode_tokenizer *p,
const char *zIn, /* Array of characters to make exceptions */
int nIn /* Length of z in bytes */
)
{
int rc = SQLITE_OK;
if (0) {
}
#ifdef WITH_STEMMER_danish
else if ( nIn==6 && memcmp("danish", zIn, 6)==0 ) {
#include "libstemmer_c/src_c/stem_UTF_8_danish.h"
p->stemmer.create = danish_UTF_8_create_env;
p->stemmer.close = danish_UTF_8_close_env;
p->stemmer.stem = danish_UTF_8_stem;
}
#endif
#ifdef WITH_STEMMER_dutch
else if ( nIn==5 && memcmp("dutch", zIn, 5)==0 ) {
#include "libstemmer_c/src_c/stem_UTF_8_dutch.h"
p->stemmer.create = dutch_UTF_8_create_env;
p->stemmer.close = dutch_UTF_8_close_env;
p->stemmer.stem = dutch_UTF_8_stem;
}
#endif
#ifdef WITH_STEMMER_english
else if ( nIn==7 && memcmp("english", zIn, 7)==0 ) {
#include "libstemmer_c/src_c/stem_UTF_8_english.h"
p->stemmer.create = english_UTF_8_create_env;
p->stemmer.close = english_UTF_8_close_env;
p->stemmer.stem = english_UTF_8_stem;
}
#endif
#ifdef WITH_STEMMER_finnish
else if ( nIn==7 && memcmp("finnish", zIn, 7)==0 ) {
#include "libstemmer_c/src_c/stem_UTF_8_finnish.h"
p->stemmer.create = finnish_UTF_8_create_env;
p->stemmer.close = finnish_UTF_8_close_env;
p->stemmer.stem = finnish_UTF_8_stem;
}
#endif
#ifdef WITH_STEMMER_french
else if ( nIn==6 && memcmp("french", zIn, 6)==0 ) {
#include "libstemmer_c/src_c/stem_UTF_8_french.h"
p->stemmer.create = french_UTF_8_create_env;
p->stemmer.close = french_UTF_8_close_env;
p->stemmer.stem = french_UTF_8_stem;
}
#endif
#ifdef WITH_STEMMER_german
else if ( nIn==6 && memcmp("german", zIn, 6)==0 ) {
#include "libstemmer_c/src_c/stem_UTF_8_german.h"
p->stemmer.create = german_UTF_8_create_env;
p->stemmer.close = german_UTF_8_close_env;
p->stemmer.stem = german_UTF_8_stem;
}
#endif
#ifdef WITH_STEMMER_hungarian
else if ( nIn==9 && memcmp("hungarian", zIn, 9)==0 ) {
#include "libstemmer_c/src_c/stem_UTF_8_hungarian.h"
p->stemmer.create = hungarian_UTF_8_create_env;
p->stemmer.close = hungarian_UTF_8_close_env;
p->stemmer.stem = hungarian_UTF_8_stem;
}
#endif
#ifdef WITH_STEMMER_italian
else if ( nIn==7 && memcmp("italian", zIn, 7)==0 ) {
#include "libstemmer_c/src_c/stem_UTF_8_italian.h"
p->stemmer.create = italian_UTF_8_create_env;
p->stemmer.close = italian_UTF_8_close_env;
p->stemmer.stem = italian_UTF_8_stem;
}
#endif
#ifdef WITH_STEMMER_norwegian
else if ( nIn==9 && memcmp("norwegian", zIn, 9)==0 ) {
#include "libstemmer_c/src_c/stem_UTF_8_norwegian.h"
p->stemmer.create = norwegian_UTF_8_create_env;
p->stemmer.close = norwegian_UTF_8_close_env;
p->stemmer.stem = norwegian_UTF_8_stem;
}
#endif
#ifdef WITH_STEMMER_porter
else if ( nIn==6 && memcmp("porter", zIn, 6)==0 ) {
#include "libstemmer_c/src_c/stem_UTF_8_porter.h"
p->stemmer.create = porter_UTF_8_create_env;
p->stemmer.close = porter_UTF_8_close_env;
p->stemmer.stem = porter_UTF_8_stem;
}
#endif
#ifdef WITH_STEMMER_portuguese
else if ( nIn==10 && memcmp("portuguese", zIn, 10)==0 ) {
#include "libstemmer_c/src_c/stem_UTF_8_portuguese.h"
p->stemmer.create = portuguese_UTF_8_create_env;
p->stemmer.close = portuguese_UTF_8_close_env;
p->stemmer.stem = portuguese_UTF_8_stem;
}
#endif
#ifdef WITH_STEMMER_romanian
else if ( nIn==8 && memcmp("romanian", zIn, 8)==0 ) {
#include "libstemmer_c/src_c/stem_UTF_8_romanian.h"
p->stemmer.create = romanian_UTF_8_create_env;
p->stemmer.close = romanian_UTF_8_close_env;
p->stemmer.stem = romanian_UTF_8_stem;
}
#endif
#ifdef WITH_STEMMER_russian
else if ( nIn==7 && memcmp("russian", zIn, 7)==0 ) {
#include "libstemmer_c/src_c/stem_UTF_8_russian.h"
p->stemmer.create = russian_UTF_8_create_env;
p->stemmer.close = russian_UTF_8_close_env;
p->stemmer.stem = russian_UTF_8_stem;
}
#endif
#ifdef WITH_STEMMER_spanish
else if ( nIn==7 && memcmp("spanish", zIn, 7)==0 ) {
#include "libstemmer_c/src_c/stem_UTF_8_spanish.h"
p->stemmer.create = spanish_UTF_8_create_env;
p->stemmer.close = spanish_UTF_8_close_env;
p->stemmer.stem = spanish_UTF_8_stem;
}
#endif
#ifdef WITH_STEMMER_swedish
else if ( nIn==7 && memcmp("swedish", zIn, 7)==0 ) {
#include "libstemmer_c/src_c/stem_UTF_8_swedish.h"
p->stemmer.create = swedish_UTF_8_create_env;
p->stemmer.close = swedish_UTF_8_close_env;
p->stemmer.stem = swedish_UTF_8_stem;
}
#endif
#ifdef WITH_STEMMER_turkish
else if ( nIn==7 && memcmp("turkish", zIn, 7)==0 ) {
#include "libstemmer_c/src_c/stem_UTF_8_turkish.h"
p->stemmer.create = turkish_UTF_8_create_env;
p->stemmer.close = turkish_UTF_8_close_env;
p->stemmer.stem = turkish_UTF_8_stem;
}
#endif
else {
rc = SQLITE_ERROR;
}
return rc;
}
/*
** Create a new tokenizer instance.
*/
static int unicodeCreate(
int nArg, /* Size of array argv[] */
const char * const *azArg, /* Tokenizer creation arguments */
sqlite3_tokenizer **pp /* OUT: New tokenizer handle */
){
unicode_tokenizer *pNew; /* New tokenizer object */
int i;
int rc = SQLITE_OK;
pNew = (unicode_tokenizer *) sqlite3_malloc(sizeof(unicode_tokenizer));
if( pNew==NULL ) return SQLITE_NOMEM;
memset(pNew, 0, sizeof(unicode_tokenizer));
pNew->bRemoveDiacritic = 1;
pNew->stemmer.create = NULL;
pNew->stemmer.close = NULL;
pNew->stemmer.stem = NULL;
for(i=0; rc==SQLITE_OK && i<nArg; i++){
const char *z = azArg[i];
int n = strlen(z);
if( n==19 && memcmp("remove_diacritics=1", z, 19)==0 ){
pNew->bRemoveDiacritic = 1;
}
else if( n==19 && memcmp("remove_diacritics=0", z, 19)==0 ){
pNew->bRemoveDiacritic = 0;
}
else if( n>=11 && memcmp("tokenchars=", z, 11)==0 ){
rc = unicodeAddExceptions(pNew, 1, &z[11], n-11);
}
else if( n>=11 && memcmp("separators=", z, 11)==0 ){
rc = unicodeAddExceptions(pNew, 0, &z[11], n-11);
}
else if( n>=8 && memcmp("stemmer=", z, 8)==0 ){
rc = unicodeSetStemmer(pNew, &z[8], n-8);
}
else{
/* Unrecognized argument */
rc = SQLITE_ERROR;
}
}
if( rc!=SQLITE_OK ){
unicodeDestroy((sqlite3_tokenizer *)pNew);
pNew = 0;
}
*pp = (sqlite3_tokenizer *)pNew;
return rc;
}
/*
** Prepare to begin tokenizing a particular string. The input
** string to be tokenized is pInput[0..nBytes-1]. A cursor
** used to incrementally tokenize this string is returned in
** *ppCursor.
*/
static int unicodeOpen(
sqlite3_tokenizer *p, /* The tokenizer */
const char *aInput, /* Input string */
int nInput, /* Size of string aInput in bytes */
sqlite3_tokenizer_cursor **pp /* OUT: New cursor object */
){
unicode_tokenizer *pTokenizer;
unicode_cursor *pCsr;
pCsr = (unicode_cursor *)sqlite3_malloc(sizeof(unicode_cursor));
if( pCsr==0 ){
return SQLITE_NOMEM;
}
memset(pCsr, 0, sizeof(unicode_cursor));
pCsr->aInput = (const unsigned char *)aInput;
if( aInput==0 ){
pCsr->nInput = 0;
}else if( nInput<0 ){
pCsr->nInput = (int)strlen(aInput);
}else{
pCsr->nInput = nInput;
}
pTokenizer = (unicode_tokenizer *)p;
if ( pTokenizer->stemmer.create!=NULL ) {
pCsr->pStemmer = pTokenizer->stemmer.create();
if ( pCsr->pStemmer==0 ) {
sqlite3_free(p);
return SQLITE_NOMEM;
}
}else {
pCsr->pStemmer = NULL;
}
*pp = &pCsr->base;
UNUSED_PARAMETER(p);
return SQLITE_OK;
}
/*
** Close a tokenization cursor previously opened by a call to
** simpleOpen() above.
*/
static int unicodeClose(sqlite3_tokenizer_cursor *pCursor){
unicode_cursor *pCsr = (unicode_cursor *) pCursor;
if ( pCsr->pStemmer != NULL ) {
unicode_tokenizer *p = ((unicode_tokenizer *)pCsr->base.pTokenizer);
p->stemmer.close(pCsr->pStemmer);
}
sqlite3_free(pCsr->zToken);
sqlite3_free(pCsr);
return SQLITE_OK;
}
/*
** Extract the next token from a tokenization cursor. The cursor must
** have been opened by a prior call to simpleOpen().
*/
static int unicodeNext(
sqlite3_tokenizer_cursor *pC, /* Cursor returned by simpleOpen */
const char **paToken, /* OUT: Token text */
int *pnToken, /* OUT: Number of bytes at *paToken */
int *piStart, /* OUT: Starting offset of token */
int *piEnd, /* OUT: Ending offset of token */
int *piPos /* OUT: Position integer of token */
){
unicode_cursor *pCsr = (unicode_cursor *)pC;
unicode_tokenizer *p = ((unicode_tokenizer *)pCsr->base.pTokenizer);
int iCode;
char *zOut;
const unsigned char *z = &pCsr->aInput[pCsr->iOff];
const unsigned char *zStart = z;
const unsigned char *zEnd;
const unsigned char *zTerm = &pCsr->aInput[pCsr->nInput];
/* Scan past any delimiter characters before the start of the next token.
** Return SQLITE_DONE early if this takes us all the way to the end of
** the input. */
while( z<zTerm ){
READ_UTF8(z, zTerm, iCode);
if( unicodeIsAlnum(p, iCode) ) break;
zStart = z;
}
if( zStart>=zTerm ) return SQLITE_DONE;
zOut = pCsr->zToken;
do {
int iOut;
/* Grow the output buffer if required. */
if( (zOut-pCsr->zToken)>=(pCsr->nAlloc-4) ){
char *zNew = sqlite3_realloc(pCsr->zToken, pCsr->nAlloc+64);
if( !zNew ) return SQLITE_NOMEM;
zOut = &zNew[zOut - pCsr->zToken];
pCsr->zToken = zNew;
pCsr->nAlloc += 64;
}
/* Write the folded case of the last character read to the output */
zEnd = z;
iOut = sqlite3FtsUnicodeFold(iCode, p->bRemoveDiacritic);
if( iOut ){
WRITE_UTF8(zOut, iOut);
}
/* If the cursor is not at EOF, read the next character */
if( z>=zTerm ) break;
READ_UTF8(z, zTerm, iCode);
}while( unicodeIsAlnum(p, iCode)
|| sqlite3FtsUnicodeIsdiacritic(iCode)
);
if ( pCsr->pStemmer!=NULL ) {
SN_set_current(pCsr->pStemmer, zOut - pCsr->zToken, (unsigned char *)pCsr->zToken);
if ( p->stemmer.stem(pCsr->pStemmer)<0 ) {
*paToken = pCsr->zToken;
*pnToken = zOut - pCsr->zToken;
}else {
pCsr->pStemmer->p[pCsr->pStemmer->l] = '\0';
*paToken = (char *)pCsr->pStemmer->p;
*pnToken = pCsr->pStemmer->l;
}
}else {
*paToken = pCsr->zToken;
*pnToken = zOut - pCsr->zToken;
}
/* Set the output variables and return. */
pCsr->iOff = (z - pCsr->aInput);
*piStart = (zStart - pCsr->aInput);
*piEnd = (zEnd - pCsr->aInput);
*piPos = pCsr->iToken++;
return SQLITE_OK;
}
/*
** Set *ppModule to a pointer to the sqlite3_tokenizer_module
** structure for the unicode tokenizer.
*/
void sqlite3Fts3UnicodeSnTokenizer(sqlite3_tokenizer_module const **ppModule){
static const sqlite3_tokenizer_module module = {
0,
unicodeCreate,
unicodeDestroy,
unicodeOpen,
unicodeClose,
unicodeNext,
0,
};
*ppModule = &module;
}
#endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */
#endif /* ifndef SQLITE_ENABLE_FTS4_UNICODE61 */

View file

@ -1,21 +0,0 @@
#ifndef _FTS3_UNICODE_SN_H
#define _FTS3_UNICODE_SN_H
#include "fts3_tokenizer.h"
#define TOKENIZER_NAME "unicodesn"
#define UNICODE0_DLL_EXPORTED __attribute__((__visibility__("default")))
struct sqlite3_api_routines;
void sqlite3Fts3UnicodeSnTokenizer(sqlite3_tokenizer_module const **ppModule);
UNICODE0_DLL_EXPORTED int sqlite3_extension_init(
sqlite3 *db, /* The database connection */
char **pzErrMsg, /* Write error messages here */
const struct sqlite3_api_routines *pApi /* API methods */
);
#endif /* _FTS3_UNICODE0_H */

View file

@ -1,72 +0,0 @@
README
src_c/stem_ISO_8859_1_danish.c
src_c/stem_ISO_8859_1_danish.h
src_c/stem_ISO_8859_1_dutch.c
src_c/stem_ISO_8859_1_dutch.h
src_c/stem_ISO_8859_1_english.c
src_c/stem_ISO_8859_1_english.h
src_c/stem_ISO_8859_1_finnish.c
src_c/stem_ISO_8859_1_finnish.h
src_c/stem_ISO_8859_1_french.c
src_c/stem_ISO_8859_1_french.h
src_c/stem_ISO_8859_1_german.c
src_c/stem_ISO_8859_1_german.h
src_c/stem_ISO_8859_1_hungarian.c
src_c/stem_ISO_8859_1_hungarian.h
src_c/stem_ISO_8859_1_italian.c
src_c/stem_ISO_8859_1_italian.h
src_c/stem_ISO_8859_1_norwegian.c
src_c/stem_ISO_8859_1_norwegian.h
src_c/stem_ISO_8859_1_porter.c
src_c/stem_ISO_8859_1_porter.h
src_c/stem_ISO_8859_1_portuguese.c
src_c/stem_ISO_8859_1_portuguese.h
src_c/stem_ISO_8859_1_spanish.c
src_c/stem_ISO_8859_1_spanish.h
src_c/stem_ISO_8859_1_swedish.c
src_c/stem_ISO_8859_1_swedish.h
src_c/stem_ISO_8859_2_romanian.c
src_c/stem_ISO_8859_2_romanian.h
src_c/stem_KOI8_R_russian.c
src_c/stem_KOI8_R_russian.h
src_c/stem_UTF_8_danish.c
src_c/stem_UTF_8_danish.h
src_c/stem_UTF_8_dutch.c
src_c/stem_UTF_8_dutch.h
src_c/stem_UTF_8_english.c
src_c/stem_UTF_8_english.h
src_c/stem_UTF_8_finnish.c
src_c/stem_UTF_8_finnish.h
src_c/stem_UTF_8_french.c
src_c/stem_UTF_8_french.h
src_c/stem_UTF_8_german.c
src_c/stem_UTF_8_german.h
src_c/stem_UTF_8_hungarian.c
src_c/stem_UTF_8_hungarian.h
src_c/stem_UTF_8_italian.c
src_c/stem_UTF_8_italian.h
src_c/stem_UTF_8_norwegian.c
src_c/stem_UTF_8_norwegian.h
src_c/stem_UTF_8_porter.c
src_c/stem_UTF_8_porter.h
src_c/stem_UTF_8_portuguese.c
src_c/stem_UTF_8_portuguese.h
src_c/stem_UTF_8_romanian.c
src_c/stem_UTF_8_romanian.h
src_c/stem_UTF_8_russian.c
src_c/stem_UTF_8_russian.h
src_c/stem_UTF_8_spanish.c
src_c/stem_UTF_8_spanish.h
src_c/stem_UTF_8_swedish.c
src_c/stem_UTF_8_swedish.h
src_c/stem_UTF_8_turkish.c
src_c/stem_UTF_8_turkish.h
runtime/api.c
runtime/api.h
runtime/header.h
runtime/utilities.c
libstemmer/libstemmer.c
libstemmer/libstemmer_utf8.c
libstemmer/modules.h
libstemmer/modules_utf8.h
include/libstemmer.h

View file

@ -1,9 +0,0 @@
include mkinc.mak
CFLAGS=-Iinclude
all: libstemmer.o stemwords
libstemmer.o: $(snowball_sources:.c=.o)
$(AR) -cru $@ $^
stemwords: examples/stemwords.o libstemmer.o
$(CC) -o $@ $^
clean:
rm -f stemwords *.o src_c/*.o runtime/*.o libstemmer/*.o

View file

@ -1,125 +0,0 @@
libstemmer_c
============
This document pertains to the C version of the libstemmer distribution,
available for download from:
http://snowball.tartarus.org/dist/libstemmer_c.tgz
Compiling the library
=====================
A simple makefile is provided for Unix style systems. On such systems, it
should be possible simply to run "make", and the file "libstemmer.o"
and the example program "stemwords" will be generated.
If this doesn't work on your system, you need to write your own build
system (or call the compiler directly). The files to compile are
all contained in the "libstemmer", "runtime" and "src_c" directories,
and the public header file is contained in the "include" directory.
The library comes in two flavours; UTF-8 only, and UTF-8 plus other character
sets. To use the utf-8 only flavour, compile "libstemmer_utf8.c" instead of
"libstemmer.c".
For convenience "mkinc.mak" is a makefile fragment listing the source files and
header files used to compile the standard version of the library.
"mkinc_utf8.mak" is a comparable makefile fragment listing just the source
files for the UTF-8 only version of the library.
Using the library
=================
The library provides a simple C API. Essentially, a new stemmer can
be obtained by using "sb_stemmer_new". "sb_stemmer_stem" is then
used to stem a word, "sb_stemmer_length" returns the stemmed
length of the last word processed, and "sb_stemmer_delete" is
used to delete a stemmer.
Creating a stemmer is a relatively expensive operation - the expected
usage pattern is that a new stemmer is created when needed, used
to stem many words, and deleted after some time.
Stemmers are re-entrant, but not threadsafe. In other words, if
you wish to access the same stemmer object from multiple threads,
you must ensure that all access is protected by a mutex or similar
device.
libstemmer does not currently incorporate any mechanism for caching the results
of stemming operations. Such caching can greatly increase the performance of a
stemmer under certain situations, so suitable patches will be considered for
inclusion.
The standard libstemmer sources contain an algorithm for each of the supported
languages. The algorithm may be selected using the english name of the
language, or using the 2 or 3 letter ISO 639 language codes. In addition,
the traditional "Porter" stemming algorithm for english is included for
backwards compatibility purposes, but we recommend use of the "English"
stemmer in preference for new projects.
(Some minor algorithms which are included only as curiosities in the snowball
website, such as the Lovins stemmer and the Kraaij Pohlmann stemmer, are not
included in the standard libstemmer sources. These are not really supported by
the snowball project, but it would be possible to compile a modified libstemmer
library containing these if desired.)
The stemwords example
=====================
The stemwords example program allows you to run any of the stemmers
compiled into the libstemmer library on a sample vocabulary. For
details on how to use it, run it with the "-h" command line option.
Using the library in a larger system
====================================
If you are incorporating the library into the build system of a larger
program, I recommend copying the unpacked tarball without modification into
a subdirectory of the sources of your program. Future versions of the
library are intended to keep the same structure, so this will keep the
work required to move to a new version of the library to a minimum.
As an additional convenience, the list of source and header files used
in the library is detailed in mkinc.mak - a file which is in a suitable
format for inclusion by a Makefile. By including this file in your build
system, you can link the snowball system into your program with a few
extra rules.
Using the library in a system using GNU autotools
=================================================
The libstemmer_c library can be integrated into a larger system which uses the
GNU autotool framework (and in particular, automake and autoconf) as follows:
1) Unpack libstemmer_c.tgz in the top level project directory so that there is
a libstemmer_c subdirectory of the top level directory of the project.
2) Add a file "Makefile.am" to the unpacked libstemmer_c folder, containing:
noinst_LTLIBRARIES = libstemmer.la
include $(srcdir)/mkinc.mak
noinst_HEADERS = $(snowball_headers)
libstemmer_la_SOURCES = $(snowball_sources)
(You may also need to add other lines to this, for example, if you are using
compiler options which are not compatible with compiling the libstemmer
library.)
3) Add libstemmer_c to the AC_CONFIG_FILES declaration in the project's
configure.ac file.
4) Add to the top level makefile the following lines (or modify existing
assignments to these variables appropriately):
AUTOMAKE_OPTIONS = subdir-objects
AM_CPPFLAGS = -I$(top_srcdir)/libstemmer_c/include
SUBDIRS=libstemmer_c
<name>_LIBADD = libstemmer_c/libstemmer.la
(Where <name> is the name of the library or executable which links against
libstemmer.)

View file

@ -1,209 +0,0 @@
/* This is a simple program which uses libstemmer to provide a command
* line interface for stemming using any of the algorithms provided.
*/
#include <stdio.h>
#include <stdlib.h> /* for malloc, free */
#include <string.h> /* for memmove */
#include <ctype.h> /* for isupper, tolower */
#include "libstemmer.h"
const char * progname;
static int pretty = 1;
static void
stem_file(struct sb_stemmer * stemmer, FILE * f_in, FILE * f_out)
{
#define INC 10
int lim = INC;
sb_symbol * b = (sb_symbol *) malloc(lim * sizeof(sb_symbol));
while(1) {
int ch = getc(f_in);
if (ch == EOF) {
free(b); return;
}
{
int i = 0;
int inlen = 0;
while(1) {
if (ch == '\n' || ch == EOF) break;
if (i == lim) {
sb_symbol * newb;
newb = (sb_symbol *)
realloc(b, (lim + INC) * sizeof(sb_symbol));
if (newb == 0) goto error;
b = newb;
lim = lim + INC;
}
/* Update count of utf-8 characters. */
if (ch < 0x80 || ch > 0xBF) inlen += 1;
/* force lower case: */
if (isupper(ch)) ch = tolower(ch);
b[i] = ch;
i++;
ch = getc(f_in);
}
{
const sb_symbol * stemmed = sb_stemmer_stem(stemmer, b, i);
if (stemmed == NULL)
{
fprintf(stderr, "Out of memory");
exit(1);
}
else
{
if (pretty == 1) {
fwrite(b, i, 1, f_out);
fputs(" -> ", f_out);
} else if (pretty == 2) {
fwrite(b, i, 1, f_out);
if (sb_stemmer_length(stemmer) > 0) {
int j;
if (inlen < 30) {
for (j = 30 - inlen; j > 0; j--)
fputs(" ", f_out);
} else {
fputs("\n", f_out);
for (j = 30; j > 0; j--)
fputs(" ", f_out);
}
}
}
fputs((char *)stemmed, f_out);
putc('\n', f_out);
}
}
}
}
error:
if (b != 0) free(b);
return;
}
/** Display the command line syntax, and then exit.
* @param n The value to exit with.
*/
static void
usage(int n)
{
printf("usage: %s [-l <language>] [-i <input file>] [-o <output file>] [-c <character encoding>] [-p[2]] [-h]\n"
"\n"
"The input file consists of a list of words to be stemmed, one per\n"
"line. Words should be in lower case, but (for English) A-Z letters\n"
"are mapped to their a-z equivalents anyway. If omitted, stdin is\n"
"used.\n"
"\n"
"If -c is given, the argument is the character encoding of the input\n"
"and output files. If it is omitted, the UTF-8 encoding is used.\n"
"\n"
"If -p is given the output file consists of each word of the input\n"
"file followed by \"->\" followed by its stemmed equivalent.\n"
"If -p2 is given the output file is a two column layout containing\n"
"the input words in the first column and the stemmed eqivalents in\n"
"the second column.\n"
"Otherwise, the output file consists of the stemmed words, one per\n"
"line.\n"
"\n"
"-h displays this help\n",
progname);
exit(n);
}
int
main(int argc, char * argv[])
{
char * in = 0;
char * out = 0;
FILE * f_in;
FILE * f_out;
struct sb_stemmer * stemmer;
char * language = "english";
char * charenc = NULL;
char * s;
int i = 1;
pretty = 0;
progname = argv[0];
while(i < argc) {
s = argv[i++];
if (s[0] == '-') {
if (strcmp(s, "-o") == 0) {
if (i >= argc) {
fprintf(stderr, "%s requires an argument\n", s);
exit(1);
}
out = argv[i++];
} else if (strcmp(s, "-i") == 0) {
if (i >= argc) {
fprintf(stderr, "%s requires an argument\n", s);
exit(1);
}
in = argv[i++];
} else if (strcmp(s, "-l") == 0) {
if (i >= argc) {
fprintf(stderr, "%s requires an argument\n", s);
exit(1);
}
language = argv[i++];
} else if (strcmp(s, "-c") == 0) {
if (i >= argc) {
fprintf(stderr, "%s requires an argument\n", s);
exit(1);
}
charenc = argv[i++];
} else if (strcmp(s, "-p2") == 0) {
pretty = 2;
} else if (strcmp(s, "-p") == 0) {
pretty = 1;
} else if (strcmp(s, "-h") == 0) {
usage(0);
} else {
fprintf(stderr, "option %s unknown\n", s);
usage(1);
}
} else {
fprintf(stderr, "unexpected parameter %s\n", s);
usage(1);
}
}
/* prepare the files */
f_in = (in == 0) ? stdin : fopen(in, "r");
if (f_in == 0) {
fprintf(stderr, "file %s not found\n", in);
exit(1);
}
f_out = (out == 0) ? stdout : fopen(out, "w");
if (f_out == 0) {
fprintf(stderr, "file %s cannot be opened\n", out);
exit(1);
}
/* do the stemming process: */
stemmer = sb_stemmer_new(language, charenc);
if (stemmer == 0) {
if (charenc == NULL) {
fprintf(stderr, "language `%s' not available for stemming\n", language);
exit(1);
} else {
fprintf(stderr, "language `%s' not available for stemming in encoding `%s'\n", language, charenc);
exit(1);
}
}
stem_file(stemmer, f_in, f_out);
sb_stemmer_delete(stemmer);
if (in != 0) (void) fclose(f_in);
if (out != 0) (void) fclose(f_out);
return 0;
}

View file

@ -1,79 +0,0 @@
/* Make header file work when included from C++ */
#ifdef __cplusplus
extern "C" {
#endif
struct sb_stemmer;
typedef unsigned char sb_symbol;
/* FIXME - should be able to get a version number for each stemming
* algorithm (which will be incremented each time the output changes). */
/** Returns an array of the names of the available stemming algorithms.
* Note that these are the canonical names - aliases (ie, other names for
* the same algorithm) will not be included in the list.
* The list is terminated with a null pointer.
*
* The list must not be modified in any way.
*/
const char ** sb_stemmer_list(void);
/** Create a new stemmer object, using the specified algorithm, for the
* specified character encoding.
*
* All algorithms will usually be available in UTF-8, but may also be
* available in other character encodings.
*
* @param algorithm The algorithm name. This is either the english
* name of the algorithm, or the 2 or 3 letter ISO 639 codes for the
* language. Note that case is significant in this parameter - the
* value should be supplied in lower case.
*
* @param charenc The character encoding. NULL may be passed as
* this value, in which case UTF-8 encoding will be assumed. Otherwise,
* the argument may be one of "UTF_8", "ISO_8859_1" (ie, Latin 1),
* "CP850" (ie, MS-DOS Latin 1) or "KOI8_R" (Russian). Note that
* case is significant in this parameter.
*
* @return NULL if the specified algorithm is not recognised, or the
* algorithm is not available for the requested encoding. Otherwise,
* returns a pointer to a newly created stemmer for the requested algorithm.
* The returned pointer must be deleted by calling sb_stemmer_delete().
*
* @note NULL will also be returned if an out of memory error occurs.
*/
struct sb_stemmer * sb_stemmer_new(const char * algorithm, const char * charenc);
/** Delete a stemmer object.
*
* This frees all resources allocated for the stemmer. After calling
* this function, the supplied stemmer may no longer be used in any way.
*
* It is safe to pass a null pointer to this function - this will have
* no effect.
*/
void sb_stemmer_delete(struct sb_stemmer * stemmer);
/** Stem a word.
*
* The return value is owned by the stemmer - it must not be freed or
* modified, and it will become invalid when the stemmer is called again,
* or if the stemmer is freed.
*
* The length of the return value can be obtained using sb_stemmer_length().
*
* If an out-of-memory error occurs, this will return NULL.
*/
const sb_symbol * sb_stemmer_stem(struct sb_stemmer * stemmer,
const sb_symbol * word, int size);
/** Get the length of the result of the last stemmed word.
* This should not be called before sb_stemmer_stem() has been called.
*/
int sb_stemmer_length(struct sb_stemmer * stemmer);
#ifdef __cplusplus
}
#endif

View file

@ -1,95 +0,0 @@
#include <stdlib.h>
#include <string.h>
#include "../include/libstemmer.h"
#include "../runtime/api.h"
#include "modules.h"
struct sb_stemmer {
struct SN_env * (*create)(void);
void (*close)(struct SN_env *);
int (*stem)(struct SN_env *);
struct SN_env * env;
};
extern const char **
sb_stemmer_list(void)
{
return algorithm_names;
}
static stemmer_encoding_t
sb_getenc(const char * charenc)
{
struct stemmer_encoding * encoding;
if (charenc == NULL) return ENC_UTF_8;
for (encoding = encodings; encoding->name != 0; encoding++) {
if (strcmp(encoding->name, charenc) == 0) break;
}
if (encoding->name == NULL) return ENC_UNKNOWN;
return encoding->enc;
}
extern struct sb_stemmer *
sb_stemmer_new(const char * algorithm, const char * charenc)
{
stemmer_encoding_t enc;
struct stemmer_modules * module;
struct sb_stemmer * stemmer;
enc = sb_getenc(charenc);
if (enc == ENC_UNKNOWN) return NULL;
for (module = modules; module->name != 0; module++) {
if (strcmp(module->name, algorithm) == 0 && module->enc == enc) break;
}
if (module->name == NULL) return NULL;
stemmer = (struct sb_stemmer *) malloc(sizeof(struct sb_stemmer));
if (stemmer == NULL) return NULL;
stemmer->create = module->create;
stemmer->close = module->close;
stemmer->stem = module->stem;
stemmer->env = stemmer->create();
if (stemmer->env == NULL)
{
sb_stemmer_delete(stemmer);
return NULL;
}
return stemmer;
}
void
sb_stemmer_delete(struct sb_stemmer * stemmer)
{
if (stemmer == 0) return;
if (stemmer->close == 0) return;
stemmer->close(stemmer->env);
stemmer->close = 0;
free(stemmer);
}
const sb_symbol *
sb_stemmer_stem(struct sb_stemmer * stemmer, const sb_symbol * word, int size)
{
int ret;
if (SN_set_current(stemmer->env, size, (const symbol *)(word)))
{
stemmer->env->l = 0;
return NULL;
}
ret = stemmer->stem(stemmer->env);
if (ret < 0) return NULL;
stemmer->env->p[stemmer->env->l] = 0;
return (const sb_symbol *)(stemmer->env->p);
}
int
sb_stemmer_length(struct sb_stemmer * stemmer)
{
return stemmer->env->l;
}

View file

@ -1,95 +0,0 @@
#include <stdlib.h>
#include <string.h>
#include "../include/libstemmer.h"
#include "../runtime/api.h"
#include "@MODULES_H@"
struct sb_stemmer {
struct SN_env * (*create)(void);
void (*close)(struct SN_env *);
int (*stem)(struct SN_env *);
struct SN_env * env;
};
extern const char **
sb_stemmer_list(void)
{
return algorithm_names;
}
static stemmer_encoding_t
sb_getenc(const char * charenc)
{
struct stemmer_encoding * encoding;
if (charenc == NULL) return ENC_UTF_8;
for (encoding = encodings; encoding->name != 0; encoding++) {
if (strcmp(encoding->name, charenc) == 0) break;
}
if (encoding->name == NULL) return ENC_UNKNOWN;
return encoding->enc;
}
extern struct sb_stemmer *
sb_stemmer_new(const char * algorithm, const char * charenc)
{
stemmer_encoding_t enc;
struct stemmer_modules * module;
struct sb_stemmer * stemmer;
enc = sb_getenc(charenc);
if (enc == ENC_UNKNOWN) return NULL;
for (module = modules; module->name != 0; module++) {
if (strcmp(module->name, algorithm) == 0 && module->enc == enc) break;
}
if (module->name == NULL) return NULL;
stemmer = (struct sb_stemmer *) malloc(sizeof(struct sb_stemmer));
if (stemmer == NULL) return NULL;
stemmer->create = module->create;
stemmer->close = module->close;
stemmer->stem = module->stem;
stemmer->env = stemmer->create();
if (stemmer->env == NULL)
{
sb_stemmer_delete(stemmer);
return NULL;
}
return stemmer;
}
void
sb_stemmer_delete(struct sb_stemmer * stemmer)
{
if (stemmer == 0) return;
if (stemmer->close == 0) return;
stemmer->close(stemmer->env);
stemmer->close = 0;
free(stemmer);
}
const sb_symbol *
sb_stemmer_stem(struct sb_stemmer * stemmer, const sb_symbol * word, int size)
{
int ret;
if (SN_set_current(stemmer->env, size, (const symbol *)(word)))
{
stemmer->env->l = 0;
return NULL;
}
ret = stemmer->stem(stemmer->env);
if (ret < 0) return NULL;
stemmer->env->p[stemmer->env->l] = 0;
return (const sb_symbol *)(stemmer->env->p);
}
int
sb_stemmer_length(struct sb_stemmer * stemmer)
{
return stemmer->env->l;
}

View file

@ -1,95 +0,0 @@
#include <stdlib.h>
#include <string.h>
#include "../include/libstemmer.h"
#include "../runtime/api.h"
#include "modules_utf8.h"
struct sb_stemmer {
struct SN_env * (*create)(void);
void (*close)(struct SN_env *);
int (*stem)(struct SN_env *);
struct SN_env * env;
};
extern const char **
sb_stemmer_list(void)
{
return algorithm_names;
}
static stemmer_encoding_t
sb_getenc(const char * charenc)
{
struct stemmer_encoding * encoding;
if (charenc == NULL) return ENC_UTF_8;
for (encoding = encodings; encoding->name != 0; encoding++) {
if (strcmp(encoding->name, charenc) == 0) break;
}
if (encoding->name == NULL) return ENC_UNKNOWN;
return encoding->enc;
}
extern struct sb_stemmer *
sb_stemmer_new(const char * algorithm, const char * charenc)
{
stemmer_encoding_t enc;
struct stemmer_modules * module;
struct sb_stemmer * stemmer;
enc = sb_getenc(charenc);
if (enc == ENC_UNKNOWN) return NULL;
for (module = modules; module->name != 0; module++) {
if (strcmp(module->name, algorithm) == 0 && module->enc == enc) break;
}
if (module->name == NULL) return NULL;
stemmer = (struct sb_stemmer *) malloc(sizeof(struct sb_stemmer));
if (stemmer == NULL) return NULL;
stemmer->create = module->create;
stemmer->close = module->close;
stemmer->stem = module->stem;
stemmer->env = stemmer->create();
if (stemmer->env == NULL)
{
sb_stemmer_delete(stemmer);
return NULL;
}
return stemmer;
}
void
sb_stemmer_delete(struct sb_stemmer * stemmer)
{
if (stemmer == 0) return;
if (stemmer->close == 0) return;
stemmer->close(stemmer->env);
stemmer->close = 0;
free(stemmer);
}
const sb_symbol *
sb_stemmer_stem(struct sb_stemmer * stemmer, const sb_symbol * word, int size)
{
int ret;
if (SN_set_current(stemmer->env, size, (const symbol *)(word)))
{
stemmer->env->l = 0;
return NULL;
}
ret = stemmer->stem(stemmer->env);
if (ret < 0) return NULL;
stemmer->env->p[stemmer->env->l] = 0;
return (const sb_symbol *)(stemmer->env->p);
}
int
sb_stemmer_length(struct sb_stemmer * stemmer)
{
return stemmer->env->l;
}

View file

@ -1,190 +0,0 @@
/* libstemmer/modules.h: List of stemming modules.
*
* This file is generated by mkmodules.pl from a list of module names.
* Do not edit manually.
*
* Modules included by this file are: danish, dutch, english, finnish, french,
* german, hungarian, italian, norwegian, porter, portuguese, romanian,
* russian, spanish, swedish, turkish
*/
#include "../src_c/stem_ISO_8859_1_danish.h"
#include "../src_c/stem_UTF_8_danish.h"
#include "../src_c/stem_ISO_8859_1_dutch.h"
#include "../src_c/stem_UTF_8_dutch.h"
#include "../src_c/stem_ISO_8859_1_english.h"
#include "../src_c/stem_UTF_8_english.h"
#include "../src_c/stem_ISO_8859_1_finnish.h"
#include "../src_c/stem_UTF_8_finnish.h"
#include "../src_c/stem_ISO_8859_1_french.h"
#include "../src_c/stem_UTF_8_french.h"
#include "../src_c/stem_ISO_8859_1_german.h"
#include "../src_c/stem_UTF_8_german.h"
#include "../src_c/stem_ISO_8859_1_hungarian.h"
#include "../src_c/stem_UTF_8_hungarian.h"
#include "../src_c/stem_ISO_8859_1_italian.h"
#include "../src_c/stem_UTF_8_italian.h"
#include "../src_c/stem_ISO_8859_1_norwegian.h"
#include "../src_c/stem_UTF_8_norwegian.h"
#include "../src_c/stem_ISO_8859_1_porter.h"
#include "../src_c/stem_UTF_8_porter.h"
#include "../src_c/stem_ISO_8859_1_portuguese.h"
#include "../src_c/stem_UTF_8_portuguese.h"
#include "../src_c/stem_ISO_8859_2_romanian.h"
#include "../src_c/stem_UTF_8_romanian.h"
#include "../src_c/stem_KOI8_R_russian.h"
#include "../src_c/stem_UTF_8_russian.h"
#include "../src_c/stem_ISO_8859_1_spanish.h"
#include "../src_c/stem_UTF_8_spanish.h"
#include "../src_c/stem_ISO_8859_1_swedish.h"
#include "../src_c/stem_UTF_8_swedish.h"
#include "../src_c/stem_UTF_8_turkish.h"
typedef enum {
ENC_UNKNOWN=0,
ENC_ISO_8859_1,
ENC_ISO_8859_2,
ENC_KOI8_R,
ENC_UTF_8
} stemmer_encoding_t;
struct stemmer_encoding {
const char * name;
stemmer_encoding_t enc;
};
static struct stemmer_encoding encodings[] = {
{"ISO_8859_1", ENC_ISO_8859_1},
{"ISO_8859_2", ENC_ISO_8859_2},
{"KOI8_R", ENC_KOI8_R},
{"UTF_8", ENC_UTF_8},
{0,ENC_UNKNOWN}
};
struct stemmer_modules {
const char * name;
stemmer_encoding_t enc;
struct SN_env * (*create)(void);
void (*close)(struct SN_env *);
int (*stem)(struct SN_env *);
};
static struct stemmer_modules modules[] = {
{"da", ENC_ISO_8859_1, danish_ISO_8859_1_create_env, danish_ISO_8859_1_close_env, danish_ISO_8859_1_stem},
{"da", ENC_UTF_8, danish_UTF_8_create_env, danish_UTF_8_close_env, danish_UTF_8_stem},
{"dan", ENC_ISO_8859_1, danish_ISO_8859_1_create_env, danish_ISO_8859_1_close_env, danish_ISO_8859_1_stem},
{"dan", ENC_UTF_8, danish_UTF_8_create_env, danish_UTF_8_close_env, danish_UTF_8_stem},
{"danish", ENC_ISO_8859_1, danish_ISO_8859_1_create_env, danish_ISO_8859_1_close_env, danish_ISO_8859_1_stem},
{"danish", ENC_UTF_8, danish_UTF_8_create_env, danish_UTF_8_close_env, danish_UTF_8_stem},
{"de", ENC_ISO_8859_1, german_ISO_8859_1_create_env, german_ISO_8859_1_close_env, german_ISO_8859_1_stem},
{"de", ENC_UTF_8, german_UTF_8_create_env, german_UTF_8_close_env, german_UTF_8_stem},
{"deu", ENC_ISO_8859_1, german_ISO_8859_1_create_env, german_ISO_8859_1_close_env, german_ISO_8859_1_stem},
{"deu", ENC_UTF_8, german_UTF_8_create_env, german_UTF_8_close_env, german_UTF_8_stem},
{"dut", ENC_ISO_8859_1, dutch_ISO_8859_1_create_env, dutch_ISO_8859_1_close_env, dutch_ISO_8859_1_stem},
{"dut", ENC_UTF_8, dutch_UTF_8_create_env, dutch_UTF_8_close_env, dutch_UTF_8_stem},
{"dutch", ENC_ISO_8859_1, dutch_ISO_8859_1_create_env, dutch_ISO_8859_1_close_env, dutch_ISO_8859_1_stem},
{"dutch", ENC_UTF_8, dutch_UTF_8_create_env, dutch_UTF_8_close_env, dutch_UTF_8_stem},
{"en", ENC_ISO_8859_1, english_ISO_8859_1_create_env, english_ISO_8859_1_close_env, english_ISO_8859_1_stem},
{"en", ENC_UTF_8, english_UTF_8_create_env, english_UTF_8_close_env, english_UTF_8_stem},
{"eng", ENC_ISO_8859_1, english_ISO_8859_1_create_env, english_ISO_8859_1_close_env, english_ISO_8859_1_stem},
{"eng", ENC_UTF_8, english_UTF_8_create_env, english_UTF_8_close_env, english_UTF_8_stem},
{"english", ENC_ISO_8859_1, english_ISO_8859_1_create_env, english_ISO_8859_1_close_env, english_ISO_8859_1_stem},
{"english", ENC_UTF_8, english_UTF_8_create_env, english_UTF_8_close_env, english_UTF_8_stem},
{"es", ENC_ISO_8859_1, spanish_ISO_8859_1_create_env, spanish_ISO_8859_1_close_env, spanish_ISO_8859_1_stem},
{"es", ENC_UTF_8, spanish_UTF_8_create_env, spanish_UTF_8_close_env, spanish_UTF_8_stem},
{"esl", ENC_ISO_8859_1, spanish_ISO_8859_1_create_env, spanish_ISO_8859_1_close_env, spanish_ISO_8859_1_stem},
{"esl", ENC_UTF_8, spanish_UTF_8_create_env, spanish_UTF_8_close_env, spanish_UTF_8_stem},
{"fi", ENC_ISO_8859_1, finnish_ISO_8859_1_create_env, finnish_ISO_8859_1_close_env, finnish_ISO_8859_1_stem},
{"fi", ENC_UTF_8, finnish_UTF_8_create_env, finnish_UTF_8_close_env, finnish_UTF_8_stem},
{"fin", ENC_ISO_8859_1, finnish_ISO_8859_1_create_env, finnish_ISO_8859_1_close_env, finnish_ISO_8859_1_stem},
{"fin", ENC_UTF_8, finnish_UTF_8_create_env, finnish_UTF_8_close_env, finnish_UTF_8_stem},
{"finnish", ENC_ISO_8859_1, finnish_ISO_8859_1_create_env, finnish_ISO_8859_1_close_env, finnish_ISO_8859_1_stem},
{"finnish", ENC_UTF_8, finnish_UTF_8_create_env, finnish_UTF_8_close_env, finnish_UTF_8_stem},
{"fr", ENC_ISO_8859_1, french_ISO_8859_1_create_env, french_ISO_8859_1_close_env, french_ISO_8859_1_stem},
{"fr", ENC_UTF_8, french_UTF_8_create_env, french_UTF_8_close_env, french_UTF_8_stem},
{"fra", ENC_ISO_8859_1, french_ISO_8859_1_create_env, french_ISO_8859_1_close_env, french_ISO_8859_1_stem},
{"fra", ENC_UTF_8, french_UTF_8_create_env, french_UTF_8_close_env, french_UTF_8_stem},
{"fre", ENC_ISO_8859_1, french_ISO_8859_1_create_env, french_ISO_8859_1_close_env, french_ISO_8859_1_stem},
{"fre", ENC_UTF_8, french_UTF_8_create_env, french_UTF_8_close_env, french_UTF_8_stem},
{"french", ENC_ISO_8859_1, french_ISO_8859_1_create_env, french_ISO_8859_1_close_env, french_ISO_8859_1_stem},
{"french", ENC_UTF_8, french_UTF_8_create_env, french_UTF_8_close_env, french_UTF_8_stem},
{"ger", ENC_ISO_8859_1, german_ISO_8859_1_create_env, german_ISO_8859_1_close_env, german_ISO_8859_1_stem},
{"ger", ENC_UTF_8, german_UTF_8_create_env, german_UTF_8_close_env, german_UTF_8_stem},
{"german", ENC_ISO_8859_1, german_ISO_8859_1_create_env, german_ISO_8859_1_close_env, german_ISO_8859_1_stem},
{"german", ENC_UTF_8, german_UTF_8_create_env, german_UTF_8_close_env, german_UTF_8_stem},
{"hu", ENC_ISO_8859_1, hungarian_ISO_8859_1_create_env, hungarian_ISO_8859_1_close_env, hungarian_ISO_8859_1_stem},
{"hu", ENC_UTF_8, hungarian_UTF_8_create_env, hungarian_UTF_8_close_env, hungarian_UTF_8_stem},
{"hun", ENC_ISO_8859_1, hungarian_ISO_8859_1_create_env, hungarian_ISO_8859_1_close_env, hungarian_ISO_8859_1_stem},
{"hun", ENC_UTF_8, hungarian_UTF_8_create_env, hungarian_UTF_8_close_env, hungarian_UTF_8_stem},
{"hungarian", ENC_ISO_8859_1, hungarian_ISO_8859_1_create_env, hungarian_ISO_8859_1_close_env, hungarian_ISO_8859_1_stem},
{"hungarian", ENC_UTF_8, hungarian_UTF_8_create_env, hungarian_UTF_8_close_env, hungarian_UTF_8_stem},
{"it", ENC_ISO_8859_1, italian_ISO_8859_1_create_env, italian_ISO_8859_1_close_env, italian_ISO_8859_1_stem},
{"it", ENC_UTF_8, italian_UTF_8_create_env, italian_UTF_8_close_env, italian_UTF_8_stem},
{"ita", ENC_ISO_8859_1, italian_ISO_8859_1_create_env, italian_ISO_8859_1_close_env, italian_ISO_8859_1_stem},
{"ita", ENC_UTF_8, italian_UTF_8_create_env, italian_UTF_8_close_env, italian_UTF_8_stem},
{"italian", ENC_ISO_8859_1, italian_ISO_8859_1_create_env, italian_ISO_8859_1_close_env, italian_ISO_8859_1_stem},
{"italian", ENC_UTF_8, italian_UTF_8_create_env, italian_UTF_8_close_env, italian_UTF_8_stem},
{"nl", ENC_ISO_8859_1, dutch_ISO_8859_1_create_env, dutch_ISO_8859_1_close_env, dutch_ISO_8859_1_stem},
{"nl", ENC_UTF_8, dutch_UTF_8_create_env, dutch_UTF_8_close_env, dutch_UTF_8_stem},
{"nld", ENC_ISO_8859_1, dutch_ISO_8859_1_create_env, dutch_ISO_8859_1_close_env, dutch_ISO_8859_1_stem},
{"nld", ENC_UTF_8, dutch_UTF_8_create_env, dutch_UTF_8_close_env, dutch_UTF_8_stem},
{"no", ENC_ISO_8859_1, norwegian_ISO_8859_1_create_env, norwegian_ISO_8859_1_close_env, norwegian_ISO_8859_1_stem},
{"no", ENC_UTF_8, norwegian_UTF_8_create_env, norwegian_UTF_8_close_env, norwegian_UTF_8_stem},
{"nor", ENC_ISO_8859_1, norwegian_ISO_8859_1_create_env, norwegian_ISO_8859_1_close_env, norwegian_ISO_8859_1_stem},
{"nor", ENC_UTF_8, norwegian_UTF_8_create_env, norwegian_UTF_8_close_env, norwegian_UTF_8_stem},
{"norwegian", ENC_ISO_8859_1, norwegian_ISO_8859_1_create_env, norwegian_ISO_8859_1_close_env, norwegian_ISO_8859_1_stem},
{"norwegian", ENC_UTF_8, norwegian_UTF_8_create_env, norwegian_UTF_8_close_env, norwegian_UTF_8_stem},
{"por", ENC_ISO_8859_1, portuguese_ISO_8859_1_create_env, portuguese_ISO_8859_1_close_env, portuguese_ISO_8859_1_stem},
{"por", ENC_UTF_8, portuguese_UTF_8_create_env, portuguese_UTF_8_close_env, portuguese_UTF_8_stem},
{"porter", ENC_ISO_8859_1, porter_ISO_8859_1_create_env, porter_ISO_8859_1_close_env, porter_ISO_8859_1_stem},
{"porter", ENC_UTF_8, porter_UTF_8_create_env, porter_UTF_8_close_env, porter_UTF_8_stem},
{"portuguese", ENC_ISO_8859_1, portuguese_ISO_8859_1_create_env, portuguese_ISO_8859_1_close_env, portuguese_ISO_8859_1_stem},
{"portuguese", ENC_UTF_8, portuguese_UTF_8_create_env, portuguese_UTF_8_close_env, portuguese_UTF_8_stem},
{"pt", ENC_ISO_8859_1, portuguese_ISO_8859_1_create_env, portuguese_ISO_8859_1_close_env, portuguese_ISO_8859_1_stem},
{"pt", ENC_UTF_8, portuguese_UTF_8_create_env, portuguese_UTF_8_close_env, portuguese_UTF_8_stem},
{"ro", ENC_ISO_8859_2, romanian_ISO_8859_2_create_env, romanian_ISO_8859_2_close_env, romanian_ISO_8859_2_stem},
{"ro", ENC_UTF_8, romanian_UTF_8_create_env, romanian_UTF_8_close_env, romanian_UTF_8_stem},
{"romanian", ENC_ISO_8859_2, romanian_ISO_8859_2_create_env, romanian_ISO_8859_2_close_env, romanian_ISO_8859_2_stem},
{"romanian", ENC_UTF_8, romanian_UTF_8_create_env, romanian_UTF_8_close_env, romanian_UTF_8_stem},
{"ron", ENC_ISO_8859_2, romanian_ISO_8859_2_create_env, romanian_ISO_8859_2_close_env, romanian_ISO_8859_2_stem},
{"ron", ENC_UTF_8, romanian_UTF_8_create_env, romanian_UTF_8_close_env, romanian_UTF_8_stem},
{"ru", ENC_KOI8_R, russian_KOI8_R_create_env, russian_KOI8_R_close_env, russian_KOI8_R_stem},
{"ru", ENC_UTF_8, russian_UTF_8_create_env, russian_UTF_8_close_env, russian_UTF_8_stem},
{"rum", ENC_ISO_8859_2, romanian_ISO_8859_2_create_env, romanian_ISO_8859_2_close_env, romanian_ISO_8859_2_stem},
{"rum", ENC_UTF_8, romanian_UTF_8_create_env, romanian_UTF_8_close_env, romanian_UTF_8_stem},
{"rus", ENC_KOI8_R, russian_KOI8_R_create_env, russian_KOI8_R_close_env, russian_KOI8_R_stem},
{"rus", ENC_UTF_8, russian_UTF_8_create_env, russian_UTF_8_close_env, russian_UTF_8_stem},
{"russian", ENC_KOI8_R, russian_KOI8_R_create_env, russian_KOI8_R_close_env, russian_KOI8_R_stem},
{"russian", ENC_UTF_8, russian_UTF_8_create_env, russian_UTF_8_close_env, russian_UTF_8_stem},
{"spa", ENC_ISO_8859_1, spanish_ISO_8859_1_create_env, spanish_ISO_8859_1_close_env, spanish_ISO_8859_1_stem},
{"spa", ENC_UTF_8, spanish_UTF_8_create_env, spanish_UTF_8_close_env, spanish_UTF_8_stem},
{"spanish", ENC_ISO_8859_1, spanish_ISO_8859_1_create_env, spanish_ISO_8859_1_close_env, spanish_ISO_8859_1_stem},
{"spanish", ENC_UTF_8, spanish_UTF_8_create_env, spanish_UTF_8_close_env, spanish_UTF_8_stem},
{"sv", ENC_ISO_8859_1, swedish_ISO_8859_1_create_env, swedish_ISO_8859_1_close_env, swedish_ISO_8859_1_stem},
{"sv", ENC_UTF_8, swedish_UTF_8_create_env, swedish_UTF_8_close_env, swedish_UTF_8_stem},
{"swe", ENC_ISO_8859_1, swedish_ISO_8859_1_create_env, swedish_ISO_8859_1_close_env, swedish_ISO_8859_1_stem},
{"swe", ENC_UTF_8, swedish_UTF_8_create_env, swedish_UTF_8_close_env, swedish_UTF_8_stem},
{"swedish", ENC_ISO_8859_1, swedish_ISO_8859_1_create_env, swedish_ISO_8859_1_close_env, swedish_ISO_8859_1_stem},
{"swedish", ENC_UTF_8, swedish_UTF_8_create_env, swedish_UTF_8_close_env, swedish_UTF_8_stem},
{"tr", ENC_UTF_8, turkish_UTF_8_create_env, turkish_UTF_8_close_env, turkish_UTF_8_stem},
{"tur", ENC_UTF_8, turkish_UTF_8_create_env, turkish_UTF_8_close_env, turkish_UTF_8_stem},
{"turkish", ENC_UTF_8, turkish_UTF_8_create_env, turkish_UTF_8_close_env, turkish_UTF_8_stem},
{0,ENC_UNKNOWN,0,0,0}
};
static const char * algorithm_names[] = {
"danish",
"dutch",
"english",
"finnish",
"french",
"german",
"hungarian",
"italian",
"norwegian",
"porter",
"portuguese",
"romanian",
"russian",
"spanish",
"swedish",
"turkish",
0
};

View file

@ -1,50 +0,0 @@
# This file contains a list of stemmers to include in the distribution.
# The format is a set of space separated lines - on each line:
# First item is name of stemmer.
# Second item is comma separated list of character sets.
# Third item is comma separated list of names to refer to the stemmer by.
#
# Lines starting with a #, or blank lines, are ignored.
# List all the main algorithms for each language, in UTF-8, and also with
# the most commonly used encoding.
danish UTF_8,ISO_8859_1 danish,da,dan
dutch UTF_8,ISO_8859_1 dutch,nl,dut,nld
english UTF_8,ISO_8859_1 english,en,eng
finnish UTF_8,ISO_8859_1 finnish,fi,fin
french UTF_8,ISO_8859_1 french,fr,fre,fra
german UTF_8,ISO_8859_1 german,de,ger,deu
hungarian UTF_8,ISO_8859_1 hungarian,hu,hun
italian UTF_8,ISO_8859_1 italian,it,ita
norwegian UTF_8,ISO_8859_1 norwegian,no,nor
portuguese UTF_8,ISO_8859_1 portuguese,pt,por
romanian UTF_8,ISO_8859_2 romanian,ro,rum,ron
russian UTF_8,KOI8_R russian,ru,rus
spanish UTF_8,ISO_8859_1 spanish,es,esl,spa
swedish UTF_8,ISO_8859_1 swedish,sv,swe
turkish UTF_8 turkish,tr,tur
# Also include the traditional porter algorithm for english.
# The porter algorithm is included in the libstemmer distribution to assist
# with backwards compatibility, but for new systems the english algorithm
# should be used in preference.
porter UTF_8,ISO_8859_1 porter
# Some other stemmers in the snowball project are not included in the standard
# distribution. To compile a libstemmer with them in, add them to this list,
# and regenerate the distribution. (You will need a full source checkout for
# this.) They are included in the snowball website as curiosities, but are not
# intended for general use, and use of them is is not fully supported. These
# algorithms are:
#
# german2 - This is a slight modification of the german stemmer.
#german2 UTF_8,ISO_8859_1 german2
#
# kraaij_pohlmann - This is a different dutch stemmer.
#kraaij_pohlmann UTF_8,ISO_8859_1 kraaij_pohlmann
#
# lovins - This is an english stemmer, but fairly outdated, and
# only really applicable to a restricted type of input text
# (keywords in academic publications).
#lovins UTF_8,ISO_8859_1 lovins

View file

@ -1,121 +0,0 @@
/* libstemmer/modules_utf8.h: List of stemming modules.
*
* This file is generated by mkmodules.pl from a list of module names.
* Do not edit manually.
*
* Modules included by this file are: danish, dutch, english, finnish, french,
* german, hungarian, italian, norwegian, porter, portuguese, romanian,
* russian, spanish, swedish, turkish
*/
#include "../src_c/stem_UTF_8_danish.h"
#include "../src_c/stem_UTF_8_dutch.h"
#include "../src_c/stem_UTF_8_english.h"
#include "../src_c/stem_UTF_8_finnish.h"
#include "../src_c/stem_UTF_8_french.h"
#include "../src_c/stem_UTF_8_german.h"
#include "../src_c/stem_UTF_8_hungarian.h"
#include "../src_c/stem_UTF_8_italian.h"
#include "../src_c/stem_UTF_8_norwegian.h"
#include "../src_c/stem_UTF_8_porter.h"
#include "../src_c/stem_UTF_8_portuguese.h"
#include "../src_c/stem_UTF_8_romanian.h"
#include "../src_c/stem_UTF_8_russian.h"
#include "../src_c/stem_UTF_8_spanish.h"
#include "../src_c/stem_UTF_8_swedish.h"
#include "../src_c/stem_UTF_8_turkish.h"
typedef enum {
ENC_UNKNOWN=0,
ENC_UTF_8
} stemmer_encoding_t;
struct stemmer_encoding {
const char * name;
stemmer_encoding_t enc;
};
static struct stemmer_encoding encodings[] = {
{"UTF_8", ENC_UTF_8},
{0,ENC_UNKNOWN}
};
struct stemmer_modules {
const char * name;
stemmer_encoding_t enc;
struct SN_env * (*create)(void);
void (*close)(struct SN_env *);
int (*stem)(struct SN_env *);
};
static struct stemmer_modules modules[] = {
{"da", ENC_UTF_8, danish_UTF_8_create_env, danish_UTF_8_close_env, danish_UTF_8_stem},
{"dan", ENC_UTF_8, danish_UTF_8_create_env, danish_UTF_8_close_env, danish_UTF_8_stem},
{"danish", ENC_UTF_8, danish_UTF_8_create_env, danish_UTF_8_close_env, danish_UTF_8_stem},
{"de", ENC_UTF_8, german_UTF_8_create_env, german_UTF_8_close_env, german_UTF_8_stem},
{"deu", ENC_UTF_8, german_UTF_8_create_env, german_UTF_8_close_env, german_UTF_8_stem},
{"dut", ENC_UTF_8, dutch_UTF_8_create_env, dutch_UTF_8_close_env, dutch_UTF_8_stem},
{"dutch", ENC_UTF_8, dutch_UTF_8_create_env, dutch_UTF_8_close_env, dutch_UTF_8_stem},
{"en", ENC_UTF_8, english_UTF_8_create_env, english_UTF_8_close_env, english_UTF_8_stem},
{"eng", ENC_UTF_8, english_UTF_8_create_env, english_UTF_8_close_env, english_UTF_8_stem},
{"english", ENC_UTF_8, english_UTF_8_create_env, english_UTF_8_close_env, english_UTF_8_stem},
{"es", ENC_UTF_8, spanish_UTF_8_create_env, spanish_UTF_8_close_env, spanish_UTF_8_stem},
{"esl", ENC_UTF_8, spanish_UTF_8_create_env, spanish_UTF_8_close_env, spanish_UTF_8_stem},
{"fi", ENC_UTF_8, finnish_UTF_8_create_env, finnish_UTF_8_close_env, finnish_UTF_8_stem},
{"fin", ENC_UTF_8, finnish_UTF_8_create_env, finnish_UTF_8_close_env, finnish_UTF_8_stem},
{"finnish", ENC_UTF_8, finnish_UTF_8_create_env, finnish_UTF_8_close_env, finnish_UTF_8_stem},
{"fr", ENC_UTF_8, french_UTF_8_create_env, french_UTF_8_close_env, french_UTF_8_stem},
{"fra", ENC_UTF_8, french_UTF_8_create_env, french_UTF_8_close_env, french_UTF_8_stem},
{"fre", ENC_UTF_8, french_UTF_8_create_env, french_UTF_8_close_env, french_UTF_8_stem},
{"french", ENC_UTF_8, french_UTF_8_create_env, french_UTF_8_close_env, french_UTF_8_stem},
{"ger", ENC_UTF_8, german_UTF_8_create_env, german_UTF_8_close_env, german_UTF_8_stem},
{"german", ENC_UTF_8, german_UTF_8_create_env, german_UTF_8_close_env, german_UTF_8_stem},
{"hu", ENC_UTF_8, hungarian_UTF_8_create_env, hungarian_UTF_8_close_env, hungarian_UTF_8_stem},
{"hun", ENC_UTF_8, hungarian_UTF_8_create_env, hungarian_UTF_8_close_env, hungarian_UTF_8_stem},
{"hungarian", ENC_UTF_8, hungarian_UTF_8_create_env, hungarian_UTF_8_close_env, hungarian_UTF_8_stem},
{"it", ENC_UTF_8, italian_UTF_8_create_env, italian_UTF_8_close_env, italian_UTF_8_stem},
{"ita", ENC_UTF_8, italian_UTF_8_create_env, italian_UTF_8_close_env, italian_UTF_8_stem},
{"italian", ENC_UTF_8, italian_UTF_8_create_env, italian_UTF_8_close_env, italian_UTF_8_stem},
{"nl", ENC_UTF_8, dutch_UTF_8_create_env, dutch_UTF_8_close_env, dutch_UTF_8_stem},
{"nld", ENC_UTF_8, dutch_UTF_8_create_env, dutch_UTF_8_close_env, dutch_UTF_8_stem},
{"no", ENC_UTF_8, norwegian_UTF_8_create_env, norwegian_UTF_8_close_env, norwegian_UTF_8_stem},
{"nor", ENC_UTF_8, norwegian_UTF_8_create_env, norwegian_UTF_8_close_env, norwegian_UTF_8_stem},
{"norwegian", ENC_UTF_8, norwegian_UTF_8_create_env, norwegian_UTF_8_close_env, norwegian_UTF_8_stem},
{"por", ENC_UTF_8, portuguese_UTF_8_create_env, portuguese_UTF_8_close_env, portuguese_UTF_8_stem},
{"porter", ENC_UTF_8, porter_UTF_8_create_env, porter_UTF_8_close_env, porter_UTF_8_stem},
{"portuguese", ENC_UTF_8, portuguese_UTF_8_create_env, portuguese_UTF_8_close_env, portuguese_UTF_8_stem},
{"pt", ENC_UTF_8, portuguese_UTF_8_create_env, portuguese_UTF_8_close_env, portuguese_UTF_8_stem},
{"ro", ENC_UTF_8, romanian_UTF_8_create_env, romanian_UTF_8_close_env, romanian_UTF_8_stem},
{"romanian", ENC_UTF_8, romanian_UTF_8_create_env, romanian_UTF_8_close_env, romanian_UTF_8_stem},
{"ron", ENC_UTF_8, romanian_UTF_8_create_env, romanian_UTF_8_close_env, romanian_UTF_8_stem},
{"ru", ENC_UTF_8, russian_UTF_8_create_env, russian_UTF_8_close_env, russian_UTF_8_stem},
{"rum", ENC_UTF_8, romanian_UTF_8_create_env, romanian_UTF_8_close_env, romanian_UTF_8_stem},
{"rus", ENC_UTF_8, russian_UTF_8_create_env, russian_UTF_8_close_env, russian_UTF_8_stem},
{"russian", ENC_UTF_8, russian_UTF_8_create_env, russian_UTF_8_close_env, russian_UTF_8_stem},
{"spa", ENC_UTF_8, spanish_UTF_8_create_env, spanish_UTF_8_close_env, spanish_UTF_8_stem},
{"spanish", ENC_UTF_8, spanish_UTF_8_create_env, spanish_UTF_8_close_env, spanish_UTF_8_stem},
{"sv", ENC_UTF_8, swedish_UTF_8_create_env, swedish_UTF_8_close_env, swedish_UTF_8_stem},
{"swe", ENC_UTF_8, swedish_UTF_8_create_env, swedish_UTF_8_close_env, swedish_UTF_8_stem},
{"swedish", ENC_UTF_8, swedish_UTF_8_create_env, swedish_UTF_8_close_env, swedish_UTF_8_stem},
{"tr", ENC_UTF_8, turkish_UTF_8_create_env, turkish_UTF_8_close_env, turkish_UTF_8_stem},
{"tur", ENC_UTF_8, turkish_UTF_8_create_env, turkish_UTF_8_close_env, turkish_UTF_8_stem},
{"turkish", ENC_UTF_8, turkish_UTF_8_create_env, turkish_UTF_8_close_env, turkish_UTF_8_stem},
{0,ENC_UNKNOWN,0,0,0}
};
static const char * algorithm_names[] = {
"danish",
"dutch",
"english",
"finnish",
"french",
"german",
"hungarian",
"italian",
"norwegian",
"porter",
"portuguese",
"romanian",
"russian",
"spanish",
"swedish",
"turkish",
0
};

View file

@ -1,49 +0,0 @@
# This file contains a list of stemmers to include in the distribution.
# The format is a set of space separated lines - on each line:
# First item is name of stemmer.
# Second item is comma separated list of character sets.
# Third item is comma separated list of names to refer to the stemmer by.
#
# Lines starting with a #, or blank lines, are ignored.
# List all the main algorithms for each language, in UTF-8.
danish UTF_8 danish,da,dan
dutch UTF_8 dutch,nl,dut,nld
english UTF_8 english,en,eng
finnish UTF_8 finnish,fi,fin
french UTF_8 french,fr,fre,fra
german UTF_8 german,de,ger,deu
hungarian UTF_8 hungarian,hu,hun
italian UTF_8 italian,it,ita
norwegian UTF_8 norwegian,no,nor
portuguese UTF_8 portuguese,pt,por
romanian UTF_8 romanian,ro,rum,ron
russian UTF_8 russian,ru,rus
spanish UTF_8 spanish,es,esl,spa
swedish UTF_8 swedish,sv,swe
turkish UTF_8 turkish,tr,tur
# Also include the traditional porter algorithm for english.
# The porter algorithm is included in the libstemmer distribution to assist
# with backwards compatibility, but for new systems the english algorithm
# should be used in preference.
porter UTF_8 porter
# Some other stemmers in the snowball project are not included in the standard
# distribution. To compile a libstemmer with them in, add them to this list,
# and regenerate the distribution. (You will need a full source checkout for
# this.) They are included in the snowball website as curiosities, but are not
# intended for general use, and use of them is is not fully supported. These
# algorithms are:
#
# german2 - This is a slight modification of the german stemmer.
#german2 UTF_8 german2
#
# kraaij_pohlmann - This is a different dutch stemmer.
#kraaij_pohlmann UTF_8 kraaij_pohlmann
#
# lovins - This is an english stemmer, but fairly outdated, and
# only really applicable to a restricted type of input text
# (keywords in academic publications).
#lovins UTF_8 lovins

View file

@ -1,82 +0,0 @@
# libstemmer/mkinc.mak: List of stemming module source files
#
# This file is generated by mkmodules.pl from a list of module names.
# Do not edit manually.
#
# Modules included by this file are: danish, dutch, english, finnish, french,
# german, hungarian, italian, norwegian, porter, portuguese, romanian,
# russian, spanish, swedish, turkish
snowball_sources= \
src_c/stem_ISO_8859_1_danish.c \
src_c/stem_UTF_8_danish.c \
src_c/stem_ISO_8859_1_dutch.c \
src_c/stem_UTF_8_dutch.c \
src_c/stem_ISO_8859_1_english.c \
src_c/stem_UTF_8_english.c \
src_c/stem_ISO_8859_1_finnish.c \
src_c/stem_UTF_8_finnish.c \
src_c/stem_ISO_8859_1_french.c \
src_c/stem_UTF_8_french.c \
src_c/stem_ISO_8859_1_german.c \
src_c/stem_UTF_8_german.c \
src_c/stem_ISO_8859_1_hungarian.c \
src_c/stem_UTF_8_hungarian.c \
src_c/stem_ISO_8859_1_italian.c \
src_c/stem_UTF_8_italian.c \
src_c/stem_ISO_8859_1_norwegian.c \
src_c/stem_UTF_8_norwegian.c \
src_c/stem_ISO_8859_1_porter.c \
src_c/stem_UTF_8_porter.c \
src_c/stem_ISO_8859_1_portuguese.c \
src_c/stem_UTF_8_portuguese.c \
src_c/stem_ISO_8859_2_romanian.c \
src_c/stem_UTF_8_romanian.c \
src_c/stem_KOI8_R_russian.c \
src_c/stem_UTF_8_russian.c \
src_c/stem_ISO_8859_1_spanish.c \
src_c/stem_UTF_8_spanish.c \
src_c/stem_ISO_8859_1_swedish.c \
src_c/stem_UTF_8_swedish.c \
src_c/stem_UTF_8_turkish.c \
runtime/api.c \
runtime/utilities.c \
libstemmer/libstemmer.c
snowball_headers= \
src_c/stem_ISO_8859_1_danish.h \
src_c/stem_UTF_8_danish.h \
src_c/stem_ISO_8859_1_dutch.h \
src_c/stem_UTF_8_dutch.h \
src_c/stem_ISO_8859_1_english.h \
src_c/stem_UTF_8_english.h \
src_c/stem_ISO_8859_1_finnish.h \
src_c/stem_UTF_8_finnish.h \
src_c/stem_ISO_8859_1_french.h \
src_c/stem_UTF_8_french.h \
src_c/stem_ISO_8859_1_german.h \
src_c/stem_UTF_8_german.h \
src_c/stem_ISO_8859_1_hungarian.h \
src_c/stem_UTF_8_hungarian.h \
src_c/stem_ISO_8859_1_italian.h \
src_c/stem_UTF_8_italian.h \
src_c/stem_ISO_8859_1_norwegian.h \
src_c/stem_UTF_8_norwegian.h \
src_c/stem_ISO_8859_1_porter.h \
src_c/stem_UTF_8_porter.h \
src_c/stem_ISO_8859_1_portuguese.h \
src_c/stem_UTF_8_portuguese.h \
src_c/stem_ISO_8859_2_romanian.h \
src_c/stem_UTF_8_romanian.h \
src_c/stem_KOI8_R_russian.h \
src_c/stem_UTF_8_russian.h \
src_c/stem_ISO_8859_1_spanish.h \
src_c/stem_UTF_8_spanish.h \
src_c/stem_ISO_8859_1_swedish.h \
src_c/stem_UTF_8_swedish.h \
src_c/stem_UTF_8_turkish.h \
include/libstemmer.h \
libstemmer/modules.h \
runtime/api.h \
runtime/header.h

View file

@ -1,52 +0,0 @@
# libstemmer/mkinc_utf8.mak: List of stemming module source files
#
# This file is generated by mkmodules.pl from a list of module names.
# Do not edit manually.
#
# Modules included by this file are: danish, dutch, english, finnish, french,
# german, hungarian, italian, norwegian, porter, portuguese, romanian,
# russian, spanish, swedish, turkish
snowball_sources= \
src_c/stem_UTF_8_danish.c \
src_c/stem_UTF_8_dutch.c \
src_c/stem_UTF_8_english.c \
src_c/stem_UTF_8_finnish.c \
src_c/stem_UTF_8_french.c \
src_c/stem_UTF_8_german.c \
src_c/stem_UTF_8_hungarian.c \
src_c/stem_UTF_8_italian.c \
src_c/stem_UTF_8_norwegian.c \
src_c/stem_UTF_8_porter.c \
src_c/stem_UTF_8_portuguese.c \
src_c/stem_UTF_8_romanian.c \
src_c/stem_UTF_8_russian.c \
src_c/stem_UTF_8_spanish.c \
src_c/stem_UTF_8_swedish.c \
src_c/stem_UTF_8_turkish.c \
runtime/api.c \
runtime/utilities.c \
libstemmer/libstemmer_utf8.c
snowball_headers= \
src_c/stem_UTF_8_danish.h \
src_c/stem_UTF_8_dutch.h \
src_c/stem_UTF_8_english.h \
src_c/stem_UTF_8_finnish.h \
src_c/stem_UTF_8_french.h \
src_c/stem_UTF_8_german.h \
src_c/stem_UTF_8_hungarian.h \
src_c/stem_UTF_8_italian.h \
src_c/stem_UTF_8_norwegian.h \
src_c/stem_UTF_8_porter.h \
src_c/stem_UTF_8_portuguese.h \
src_c/stem_UTF_8_romanian.h \
src_c/stem_UTF_8_russian.h \
src_c/stem_UTF_8_spanish.h \
src_c/stem_UTF_8_swedish.h \
src_c/stem_UTF_8_turkish.h \
include/libstemmer.h \
libstemmer/modules_utf8.h \
runtime/api.h \
runtime/header.h

View file

@ -1,26 +0,0 @@
typedef unsigned char symbol;
/* Or replace 'char' above with 'short' for 16 bit characters.
More precisely, replace 'char' with whatever type guarantees the
character width you need. Note however that sizeof(symbol) should divide
HEAD, defined in header.h as 2*sizeof(int), without remainder, otherwise
there is an alignment problem. In the unlikely event of a problem here,
consult Martin Porter.
*/
struct SN_env {
symbol * p;
int c; int l; int lb; int bra; int ket;
symbol * * S;
int * I;
unsigned char * B;
};
extern struct SN_env * SN_create_env(int S_size, int I_size, int B_size);
extern void SN_close_env(struct SN_env * z, int S_size);
extern int SN_set_current(struct SN_env * z, int size, const symbol * s);

View file

@ -1,75 +0,0 @@
#include <stdlib.h>
#include <string.h>
#include <sqlite3.h> /* for calloc, free */
#include "header.h"
static void *local_calloc(size_t nmemb, size_t size) {
void *p = sqlite3_malloc(nmemb*size);
if (p == NULL)
return NULL;
return memset(p, 0, nmemb*size);
}
extern struct SN_env * SN_create_env(int S_size, int I_size, int B_size)
{
struct SN_env * z = (struct SN_env *) local_calloc(1, sizeof(struct SN_env));
if (z == NULL) return NULL;
z->p = create_s();
if (z->p == NULL) goto error;
if (S_size)
{
int i;
z->S = (symbol * *) local_calloc(S_size, sizeof(symbol *));
if (z->S == NULL) goto error;
for (i = 0; i < S_size; i++)
{
z->S[i] = create_s();
if (z->S[i] == NULL) goto error;
}
}
if (I_size)
{
z->I = (int *) local_calloc(I_size, sizeof(int));
if (z->I == NULL) goto error;
}
if (B_size)
{
z->B = (unsigned char *) local_calloc(B_size, sizeof(unsigned char));
if (z->B == NULL) goto error;
}
return z;
error:
SN_close_env(z, S_size);
return NULL;
}
extern void SN_close_env(struct SN_env * z, int S_size)
{
if (z == NULL) return;
if (S_size)
{
int i;
for (i = 0; i < S_size; i++)
{
lose_s(z->S[i]);
}
sqlite3_free(z->S);
}
sqlite3_free(z->I);
sqlite3_free(z->B);
if (z->p) lose_s(z->p);
sqlite3_free(z);
}
extern int SN_set_current(struct SN_env * z, int size, const symbol * s)
{
int err = replace_s(z, 0, z->l, size, s, NULL);
z->c = 0;
return err;
}

View file

@ -1,58 +0,0 @@
#include <limits.h>
#include "api.h"
#define MAXINT INT_MAX
#define MININT INT_MIN
#define HEAD 2*sizeof(int)
#define SIZE(p) ((int *)(p))[-1]
#define SET_SIZE(p, n) ((int *)(p))[-1] = n
#define CAPACITY(p) ((int *)(p))[-2]
struct among
{ int s_size; /* number of chars in string */
const symbol * s; /* search string */
int substring_i;/* index to longest matching substring */
int result; /* result of the lookup */
int (* function)(struct SN_env *);
};
extern symbol * create_s(void);
extern void lose_s(symbol * p);
extern int skip_utf8(const symbol * p, int c, int lb, int l, int n);
extern int in_grouping_U(struct SN_env * z, const unsigned char * s, int min, int max, int repeat);
extern int in_grouping_b_U(struct SN_env * z, const unsigned char * s, int min, int max, int repeat);
extern int out_grouping_U(struct SN_env * z, const unsigned char * s, int min, int max, int repeat);
extern int out_grouping_b_U(struct SN_env * z, const unsigned char * s, int min, int max, int repeat);
extern int in_grouping(struct SN_env * z, const unsigned char * s, int min, int max, int repeat);
extern int in_grouping_b(struct SN_env * z, const unsigned char * s, int min, int max, int repeat);
extern int out_grouping(struct SN_env * z, const unsigned char * s, int min, int max, int repeat);
extern int out_grouping_b(struct SN_env * z, const unsigned char * s, int min, int max, int repeat);
extern int eq_s(struct SN_env * z, int s_size, const symbol * s);
extern int eq_s_b(struct SN_env * z, int s_size, const symbol * s);
extern int eq_v(struct SN_env * z, const symbol * p);
extern int eq_v_b(struct SN_env * z, const symbol * p);
extern int find_among(struct SN_env * z, const struct among * v, int v_size);
extern int find_among_b(struct SN_env * z, const struct among * v, int v_size);
extern int replace_s(struct SN_env * z, int c_bra, int c_ket, int s_size, const symbol * s, int * adjustment);
extern int slice_from_s(struct SN_env * z, int s_size, const symbol * s);
extern int slice_from_v(struct SN_env * z, const symbol * p);
extern int slice_del(struct SN_env * z);
extern int insert_s(struct SN_env * z, int bra, int ket, int s_size, const symbol * s);
extern int insert_v(struct SN_env * z, int bra, int ket, const symbol * p);
extern symbol * slice_to(struct SN_env * z, symbol * p);
extern symbol * assign_to(struct SN_env * z, symbol * p);
extern void debug(struct SN_env * z, int number, int line_count);

View file

@ -1,480 +0,0 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sqlite3.h>
#include "header.h"
#define unless(C) if(!(C))
#define CREATE_SIZE 1
extern symbol * create_s(void) {
symbol * p;
void * mem = sqlite3_malloc(HEAD + (CREATE_SIZE + 1) * sizeof(symbol));
if (mem == NULL) return NULL;
p = (symbol *) (HEAD + (char *) mem);
CAPACITY(p) = CREATE_SIZE;
SET_SIZE(p, CREATE_SIZE);
return p;
}
extern void lose_s(symbol * p) {
if (p == NULL) return;
sqlite3_free((char *) p - HEAD);
}
/*
new_p = skip_utf8(p, c, lb, l, n); skips n characters forwards from p + c
if n +ve, or n characters backwards from p + c - 1 if n -ve. new_p is the new
position, or 0 on failure.
-- used to implement hop and next in the utf8 case.
*/
extern int skip_utf8(const symbol * p, int c, int lb, int l, int n) {
int b;
if (n >= 0) {
for (; n > 0; n--) {
if (c >= l) return -1;
b = p[c++];
if (b >= 0xC0) { /* 1100 0000 */
while (c < l) {
b = p[c];
if (b >= 0xC0 || b < 0x80) break;
/* break unless b is 10------ */
c++;
}
}
}
} else {
for (; n < 0; n++) {
if (c <= lb) return -1;
b = p[--c];
if (b >= 0x80) { /* 1000 0000 */
while (c > lb) {
b = p[c];
if (b >= 0xC0) break; /* 1100 0000 */
c--;
}
}
}
}
return c;
}
/* Code for character groupings: utf8 cases */
static int get_utf8(const symbol * p, int c, int l, int * slot) {
int b0, b1;
if (c >= l) return 0;
b0 = p[c++];
if (b0 < 0xC0 || c == l) { /* 1100 0000 */
* slot = b0; return 1;
}
b1 = p[c++];
if (b0 < 0xE0 || c == l) { /* 1110 0000 */
* slot = (b0 & 0x1F) << 6 | (b1 & 0x3F); return 2;
}
* slot = (b0 & 0xF) << 12 | (b1 & 0x3F) << 6 | (p[c] & 0x3F); return 3;
}
static int get_b_utf8(const symbol * p, int c, int lb, int * slot) {
int b0, b1;
if (c <= lb) return 0;
b0 = p[--c];
if (b0 < 0x80 || c == lb) { /* 1000 0000 */
* slot = b0; return 1;
}
b1 = p[--c];
if (b1 >= 0xC0 || c == lb) { /* 1100 0000 */
* slot = (b1 & 0x1F) << 6 | (b0 & 0x3F); return 2;
}
* slot = (p[c] & 0xF) << 12 | (b1 & 0x3F) << 6 | (b0 & 0x3F); return 3;
}
extern int in_grouping_U(struct SN_env * z, const unsigned char * s, int min, int max, int repeat) {
do {
int ch;
int w = get_utf8(z->p, z->c, z->l, & ch);
unless (w) return -1;
if (ch > max || (ch -= min) < 0 || (s[ch >> 3] & (0X1 << (ch & 0X7))) == 0)
return w;
z->c += w;
} while (repeat);
return 0;
}
extern int in_grouping_b_U(struct SN_env * z, const unsigned char * s, int min, int max, int repeat) {
do {
int ch;
int w = get_b_utf8(z->p, z->c, z->lb, & ch);
unless (w) return -1;
if (ch > max || (ch -= min) < 0 || (s[ch >> 3] & (0X1 << (ch & 0X7))) == 0)
return w;
z->c -= w;
} while (repeat);
return 0;
}
extern int out_grouping_U(struct SN_env * z, const unsigned char * s, int min, int max, int repeat) {
do {
int ch;
int w = get_utf8(z->p, z->c, z->l, & ch);
unless (w) return -1;
unless (ch > max || (ch -= min) < 0 || (s[ch >> 3] & (0X1 << (ch & 0X7))) == 0)
return w;
z->c += w;
} while (repeat);
return 0;
}
extern int out_grouping_b_U(struct SN_env * z, const unsigned char * s, int min, int max, int repeat) {
do {
int ch;
int w = get_b_utf8(z->p, z->c, z->lb, & ch);
unless (w) return -1;
unless (ch > max || (ch -= min) < 0 || (s[ch >> 3] & (0X1 << (ch & 0X7))) == 0)
return w;
z->c -= w;
} while (repeat);
return 0;
}
/* Code for character groupings: non-utf8 cases */
extern int in_grouping(struct SN_env * z, const unsigned char * s, int min, int max, int repeat) {
do {
int ch;
if (z->c >= z->l) return -1;
ch = z->p[z->c];
if (ch > max || (ch -= min) < 0 || (s[ch >> 3] & (0X1 << (ch & 0X7))) == 0)
return 1;
z->c++;
} while (repeat);
return 0;
}
extern int in_grouping_b(struct SN_env * z, const unsigned char * s, int min, int max, int repeat) {
do {
int ch;
if (z->c <= z->lb) return -1;
ch = z->p[z->c - 1];
if (ch > max || (ch -= min) < 0 || (s[ch >> 3] & (0X1 << (ch & 0X7))) == 0)
return 1;
z->c--;
} while (repeat);
return 0;
}
extern int out_grouping(struct SN_env * z, const unsigned char * s, int min, int max, int repeat) {
do {
int ch;
if (z->c >= z->l) return -1;
ch = z->p[z->c];
unless (ch > max || (ch -= min) < 0 || (s[ch >> 3] & (0X1 << (ch & 0X7))) == 0)
return 1;
z->c++;
} while (repeat);
return 0;
}
extern int out_grouping_b(struct SN_env * z, const unsigned char * s, int min, int max, int repeat) {
do {
int ch;
if (z->c <= z->lb) return -1;
ch = z->p[z->c - 1];
unless (ch > max || (ch -= min) < 0 || (s[ch >> 3] & (0X1 << (ch & 0X7))) == 0)
return 1;
z->c--;
} while (repeat);
return 0;
}
extern int eq_s(struct SN_env * z, int s_size, const symbol * s) {
if (z->l - z->c < s_size || memcmp(z->p + z->c, s, s_size * sizeof(symbol)) != 0) return 0;
z->c += s_size; return 1;
}
extern int eq_s_b(struct SN_env * z, int s_size, const symbol * s) {
if (z->c - z->lb < s_size || memcmp(z->p + z->c - s_size, s, s_size * sizeof(symbol)) != 0) return 0;
z->c -= s_size; return 1;
}
extern int eq_v(struct SN_env * z, const symbol * p) {
return eq_s(z, SIZE(p), p);
}
extern int eq_v_b(struct SN_env * z, const symbol * p) {
return eq_s_b(z, SIZE(p), p);
}
extern int find_among(struct SN_env * z, const struct among * v, int v_size) {
int i = 0;
int j = v_size;
int c = z->c; int l = z->l;
symbol * q = z->p + c;
const struct among * w;
int common_i = 0;
int common_j = 0;
int first_key_inspected = 0;
while(1) {
int k = i + ((j - i) >> 1);
int diff = 0;
int common = common_i < common_j ? common_i : common_j; /* smaller */
w = v + k;
{
int i2; for (i2 = common; i2 < w->s_size; i2++) {
if (c + common == l) { diff = -1; break; }
diff = q[common] - w->s[i2];
if (diff != 0) break;
common++;
}
}
if (diff < 0) { j = k; common_j = common; }
else { i = k; common_i = common; }
if (j - i <= 1) {
if (i > 0) break; /* v->s has been inspected */
if (j == i) break; /* only one item in v */
/* - but now we need to go round once more to get
v->s inspected. This looks messy, but is actually
the optimal approach. */
if (first_key_inspected) break;
first_key_inspected = 1;
}
}
while(1) {
w = v + i;
if (common_i >= w->s_size) {
z->c = c + w->s_size;
if (w->function == 0) return w->result;
{
int res = w->function(z);
z->c = c + w->s_size;
if (res) return w->result;
}
}
i = w->substring_i;
if (i < 0) return 0;
}
}
/* find_among_b is for backwards processing. Same comments apply */
extern int find_among_b(struct SN_env * z, const struct among * v, int v_size) {
int i = 0;
int j = v_size;
int c = z->c; int lb = z->lb;
symbol * q = z->p + c - 1;
const struct among * w;
int common_i = 0;
int common_j = 0;
int first_key_inspected = 0;
while(1) {
int k = i + ((j - i) >> 1);
int diff = 0;
int common = common_i < common_j ? common_i : common_j;
w = v + k;
{
int i2; for (i2 = w->s_size - 1 - common; i2 >= 0; i2--) {
if (c - common == lb) { diff = -1; break; }
diff = q[- common] - w->s[i2];
if (diff != 0) break;
common++;
}
}
if (diff < 0) { j = k; common_j = common; }
else { i = k; common_i = common; }
if (j - i <= 1) {
if (i > 0) break;
if (j == i) break;
if (first_key_inspected) break;
first_key_inspected = 1;
}
}
while(1) {
w = v + i;
if (common_i >= w->s_size) {
z->c = c - w->s_size;
if (w->function == 0) return w->result;
{
int res = w->function(z);
z->c = c - w->s_size;
if (res) return w->result;
}
}
i = w->substring_i;
if (i < 0) return 0;
}
}
/* Increase the size of the buffer pointed to by p to at least n symbols.
* If insufficient memory, returns NULL and frees the old buffer.
*/
static symbol * increase_size(symbol * p, int n) {
symbol * q;
int new_size = n + 20;
void * mem = sqlite3_realloc((char *) p - HEAD,
HEAD + (new_size + 1) * sizeof(symbol));
if (mem == NULL) {
lose_s(p);
return NULL;
}
q = (symbol *) (HEAD + (char *)mem);
CAPACITY(q) = new_size;
return q;
}
/* to replace symbols between c_bra and c_ket in z->p by the
s_size symbols at s.
Returns 0 on success, -1 on error.
Also, frees z->p (and sets it to NULL) on error.
*/
extern int replace_s(struct SN_env * z, int c_bra, int c_ket, int s_size, const symbol * s, int * adjptr)
{
int adjustment;
int len;
if (z->p == NULL) {
z->p = create_s();
if (z->p == NULL) return -1;
}
adjustment = s_size - (c_ket - c_bra);
len = SIZE(z->p);
if (adjustment != 0) {
if (adjustment + len > CAPACITY(z->p)) {
z->p = increase_size(z->p, adjustment + len);
if (z->p == NULL) return -1;
}
memmove(z->p + c_ket + adjustment,
z->p + c_ket,
(len - c_ket) * sizeof(symbol));
SET_SIZE(z->p, adjustment + len);
z->l += adjustment;
if (z->c >= c_ket)
z->c += adjustment;
else
if (z->c > c_bra)
z->c = c_bra;
}
unless (s_size == 0) memmove(z->p + c_bra, s, s_size * sizeof(symbol));
if (adjptr != NULL)
*adjptr = adjustment;
return 0;
}
static int slice_check(struct SN_env * z) {
if (z->bra < 0 ||
z->bra > z->ket ||
z->ket > z->l ||
z->p == NULL ||
z->l > SIZE(z->p)) /* this line could be removed */
{
#if 0
fprintf(stderr, "faulty slice operation:\n");
debug(z, -1, 0);
#endif
return -1;
}
return 0;
}
extern int slice_from_s(struct SN_env * z, int s_size, const symbol * s) {
if (slice_check(z)) return -1;
return replace_s(z, z->bra, z->ket, s_size, s, NULL);
}
extern int slice_from_v(struct SN_env * z, const symbol * p) {
return slice_from_s(z, SIZE(p), p);
}
extern int slice_del(struct SN_env * z) {
return slice_from_s(z, 0, 0);
}
extern int insert_s(struct SN_env * z, int bra, int ket, int s_size, const symbol * s) {
int adjustment;
if (replace_s(z, bra, ket, s_size, s, &adjustment))
return -1;
if (bra <= z->bra) z->bra += adjustment;
if (bra <= z->ket) z->ket += adjustment;
return 0;
}
extern int insert_v(struct SN_env * z, int bra, int ket, const symbol * p) {
int adjustment;
if (replace_s(z, bra, ket, SIZE(p), p, &adjustment))
return -1;
if (bra <= z->bra) z->bra += adjustment;
if (bra <= z->ket) z->ket += adjustment;
return 0;
}
extern symbol * slice_to(struct SN_env * z, symbol * p) {
if (slice_check(z)) {
lose_s(p);
return NULL;
}
{
int len = z->ket - z->bra;
if (CAPACITY(p) < len) {
p = increase_size(p, len);
if (p == NULL)
return NULL;
}
memmove(p, z->p + z->bra, len * sizeof(symbol));
SET_SIZE(p, len);
}
return p;
}
extern symbol * assign_to(struct SN_env * z, symbol * p) {
int len = z->l;
if (CAPACITY(p) < len) {
p = increase_size(p, len);
if (p == NULL)
return NULL;
}
memmove(p, z->p, len * sizeof(symbol));
SET_SIZE(p, len);
return p;
}
#if 0
extern void debug(struct SN_env * z, int number, int line_count) {
int i;
int limit = SIZE(z->p);
/*if (number >= 0) printf("%3d (line %4d): '", number, line_count);*/
if (number >= 0) printf("%3d (line %4d): [%d]'", number, line_count,limit);
for (i = 0; i <= limit; i++) {
if (z->lb == i) printf("{");
if (z->bra == i) printf("[");
if (z->c == i) printf("|");
if (z->ket == i) printf("]");
if (z->l == i) printf("}");
if (i < limit)
{ int ch = z->p[i];
if (ch == 0) ch = '#';
printf("%c", ch);
}
}
printf("'\n");
}
#endif

View file

@ -1,337 +0,0 @@
/* This file was generated automatically by the Snowball to ANSI C compiler */
#include "../runtime/header.h"
#ifdef __cplusplus
extern "C" {
#endif
extern int danish_ISO_8859_1_stem(struct SN_env * z);
#ifdef __cplusplus
}
#endif
static int r_undouble(struct SN_env * z);
static int r_other_suffix(struct SN_env * z);
static int r_consonant_pair(struct SN_env * z);
static int r_main_suffix(struct SN_env * z);
static int r_mark_regions(struct SN_env * z);
#ifdef __cplusplus
extern "C" {
#endif
extern struct SN_env * danish_ISO_8859_1_create_env(void);
extern void danish_ISO_8859_1_close_env(struct SN_env * z);
#ifdef __cplusplus
}
#endif
static const symbol s_0_0[3] = { 'h', 'e', 'd' };
static const symbol s_0_1[5] = { 'e', 't', 'h', 'e', 'd' };
static const symbol s_0_2[4] = { 'e', 'r', 'e', 'd' };
static const symbol s_0_3[1] = { 'e' };
static const symbol s_0_4[5] = { 'e', 'r', 'e', 'd', 'e' };
static const symbol s_0_5[4] = { 'e', 'n', 'd', 'e' };
static const symbol s_0_6[6] = { 'e', 'r', 'e', 'n', 'd', 'e' };
static const symbol s_0_7[3] = { 'e', 'n', 'e' };
static const symbol s_0_8[4] = { 'e', 'r', 'n', 'e' };
static const symbol s_0_9[3] = { 'e', 'r', 'e' };
static const symbol s_0_10[2] = { 'e', 'n' };
static const symbol s_0_11[5] = { 'h', 'e', 'd', 'e', 'n' };
static const symbol s_0_12[4] = { 'e', 'r', 'e', 'n' };
static const symbol s_0_13[2] = { 'e', 'r' };
static const symbol s_0_14[5] = { 'h', 'e', 'd', 'e', 'r' };
static const symbol s_0_15[4] = { 'e', 'r', 'e', 'r' };
static const symbol s_0_16[1] = { 's' };
static const symbol s_0_17[4] = { 'h', 'e', 'd', 's' };
static const symbol s_0_18[2] = { 'e', 's' };
static const symbol s_0_19[5] = { 'e', 'n', 'd', 'e', 's' };
static const symbol s_0_20[7] = { 'e', 'r', 'e', 'n', 'd', 'e', 's' };
static const symbol s_0_21[4] = { 'e', 'n', 'e', 's' };
static const symbol s_0_22[5] = { 'e', 'r', 'n', 'e', 's' };
static const symbol s_0_23[4] = { 'e', 'r', 'e', 's' };
static const symbol s_0_24[3] = { 'e', 'n', 's' };
static const symbol s_0_25[6] = { 'h', 'e', 'd', 'e', 'n', 's' };
static const symbol s_0_26[5] = { 'e', 'r', 'e', 'n', 's' };
static const symbol s_0_27[3] = { 'e', 'r', 's' };
static const symbol s_0_28[3] = { 'e', 't', 's' };
static const symbol s_0_29[5] = { 'e', 'r', 'e', 't', 's' };
static const symbol s_0_30[2] = { 'e', 't' };
static const symbol s_0_31[4] = { 'e', 'r', 'e', 't' };
static const struct among a_0[32] =
{
/* 0 */ { 3, s_0_0, -1, 1, 0},
/* 1 */ { 5, s_0_1, 0, 1, 0},
/* 2 */ { 4, s_0_2, -1, 1, 0},
/* 3 */ { 1, s_0_3, -1, 1, 0},
/* 4 */ { 5, s_0_4, 3, 1, 0},
/* 5 */ { 4, s_0_5, 3, 1, 0},
/* 6 */ { 6, s_0_6, 5, 1, 0},
/* 7 */ { 3, s_0_7, 3, 1, 0},
/* 8 */ { 4, s_0_8, 3, 1, 0},
/* 9 */ { 3, s_0_9, 3, 1, 0},
/* 10 */ { 2, s_0_10, -1, 1, 0},
/* 11 */ { 5, s_0_11, 10, 1, 0},
/* 12 */ { 4, s_0_12, 10, 1, 0},
/* 13 */ { 2, s_0_13, -1, 1, 0},
/* 14 */ { 5, s_0_14, 13, 1, 0},
/* 15 */ { 4, s_0_15, 13, 1, 0},
/* 16 */ { 1, s_0_16, -1, 2, 0},
/* 17 */ { 4, s_0_17, 16, 1, 0},
/* 18 */ { 2, s_0_18, 16, 1, 0},
/* 19 */ { 5, s_0_19, 18, 1, 0},
/* 20 */ { 7, s_0_20, 19, 1, 0},
/* 21 */ { 4, s_0_21, 18, 1, 0},
/* 22 */ { 5, s_0_22, 18, 1, 0},
/* 23 */ { 4, s_0_23, 18, 1, 0},
/* 24 */ { 3, s_0_24, 16, 1, 0},
/* 25 */ { 6, s_0_25, 24, 1, 0},
/* 26 */ { 5, s_0_26, 24, 1, 0},
/* 27 */ { 3, s_0_27, 16, 1, 0},
/* 28 */ { 3, s_0_28, 16, 1, 0},
/* 29 */ { 5, s_0_29, 28, 1, 0},
/* 30 */ { 2, s_0_30, -1, 1, 0},
/* 31 */ { 4, s_0_31, 30, 1, 0}
};
static const symbol s_1_0[2] = { 'g', 'd' };
static const symbol s_1_1[2] = { 'd', 't' };
static const symbol s_1_2[2] = { 'g', 't' };
static const symbol s_1_3[2] = { 'k', 't' };
static const struct among a_1[4] =
{
/* 0 */ { 2, s_1_0, -1, -1, 0},
/* 1 */ { 2, s_1_1, -1, -1, 0},
/* 2 */ { 2, s_1_2, -1, -1, 0},
/* 3 */ { 2, s_1_3, -1, -1, 0}
};
static const symbol s_2_0[2] = { 'i', 'g' };
static const symbol s_2_1[3] = { 'l', 'i', 'g' };
static const symbol s_2_2[4] = { 'e', 'l', 'i', 'g' };
static const symbol s_2_3[3] = { 'e', 'l', 's' };
static const symbol s_2_4[4] = { 'l', 0xF8, 's', 't' };
static const struct among a_2[5] =
{
/* 0 */ { 2, s_2_0, -1, 1, 0},
/* 1 */ { 3, s_2_1, 0, 1, 0},
/* 2 */ { 4, s_2_2, 1, 1, 0},
/* 3 */ { 3, s_2_3, -1, 1, 0},
/* 4 */ { 4, s_2_4, -1, 2, 0}
};
static const unsigned char g_v[] = { 17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 0, 128 };
static const unsigned char g_s_ending[] = { 239, 254, 42, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16 };
static const symbol s_0[] = { 's', 't' };
static const symbol s_1[] = { 'i', 'g' };
static const symbol s_2[] = { 'l', 0xF8, 's' };
static int r_mark_regions(struct SN_env * z) {
z->I[0] = z->l;
{ int c_test = z->c; /* test, line 33 */
{ int ret = z->c + 3;
if (0 > ret || ret > z->l) return 0;
z->c = ret; /* hop, line 33 */
}
z->I[1] = z->c; /* setmark x, line 33 */
z->c = c_test;
}
if (out_grouping(z, g_v, 97, 248, 1) < 0) return 0; /* goto */ /* grouping v, line 34 */
{ /* gopast */ /* non v, line 34 */
int ret = in_grouping(z, g_v, 97, 248, 1);
if (ret < 0) return 0;
z->c += ret;
}
z->I[0] = z->c; /* setmark p1, line 34 */
/* try, line 35 */
if (!(z->I[0] < z->I[1])) goto lab0;
z->I[0] = z->I[1];
lab0:
return 1;
}
static int r_main_suffix(struct SN_env * z) {
int among_var;
{ int mlimit; /* setlimit, line 41 */
int m1 = z->l - z->c; (void)m1;
if (z->c < z->I[0]) return 0;
z->c = z->I[0]; /* tomark, line 41 */
mlimit = z->lb; z->lb = z->c;
z->c = z->l - m1;
z->ket = z->c; /* [, line 41 */
if (z->c <= z->lb || z->p[z->c - 1] >> 5 != 3 || !((1851440 >> (z->p[z->c - 1] & 0x1f)) & 1)) { z->lb = mlimit; return 0; }
among_var = find_among_b(z, a_0, 32); /* substring, line 41 */
if (!(among_var)) { z->lb = mlimit; return 0; }
z->bra = z->c; /* ], line 41 */
z->lb = mlimit;
}
switch(among_var) {
case 0: return 0;
case 1:
{ int ret = slice_del(z); /* delete, line 48 */
if (ret < 0) return ret;
}
break;
case 2:
if (in_grouping_b(z, g_s_ending, 97, 229, 0)) return 0;
{ int ret = slice_del(z); /* delete, line 50 */
if (ret < 0) return ret;
}
break;
}
return 1;
}
static int r_consonant_pair(struct SN_env * z) {
{ int m_test = z->l - z->c; /* test, line 55 */
{ int mlimit; /* setlimit, line 56 */
int m1 = z->l - z->c; (void)m1;
if (z->c < z->I[0]) return 0;
z->c = z->I[0]; /* tomark, line 56 */
mlimit = z->lb; z->lb = z->c;
z->c = z->l - m1;
z->ket = z->c; /* [, line 56 */
if (z->c - 1 <= z->lb || (z->p[z->c - 1] != 100 && z->p[z->c - 1] != 116)) { z->lb = mlimit; return 0; }
if (!(find_among_b(z, a_1, 4))) { z->lb = mlimit; return 0; } /* substring, line 56 */
z->bra = z->c; /* ], line 56 */
z->lb = mlimit;
}
z->c = z->l - m_test;
}
if (z->c <= z->lb) return 0;
z->c--; /* next, line 62 */
z->bra = z->c; /* ], line 62 */
{ int ret = slice_del(z); /* delete, line 62 */
if (ret < 0) return ret;
}
return 1;
}
static int r_other_suffix(struct SN_env * z) {
int among_var;
{ int m1 = z->l - z->c; (void)m1; /* do, line 66 */
z->ket = z->c; /* [, line 66 */
if (!(eq_s_b(z, 2, s_0))) goto lab0;
z->bra = z->c; /* ], line 66 */
if (!(eq_s_b(z, 2, s_1))) goto lab0;
{ int ret = slice_del(z); /* delete, line 66 */
if (ret < 0) return ret;
}
lab0:
z->c = z->l - m1;
}
{ int mlimit; /* setlimit, line 67 */
int m2 = z->l - z->c; (void)m2;
if (z->c < z->I[0]) return 0;
z->c = z->I[0]; /* tomark, line 67 */
mlimit = z->lb; z->lb = z->c;
z->c = z->l - m2;
z->ket = z->c; /* [, line 67 */
if (z->c - 1 <= z->lb || z->p[z->c - 1] >> 5 != 3 || !((1572992 >> (z->p[z->c - 1] & 0x1f)) & 1)) { z->lb = mlimit; return 0; }
among_var = find_among_b(z, a_2, 5); /* substring, line 67 */
if (!(among_var)) { z->lb = mlimit; return 0; }
z->bra = z->c; /* ], line 67 */
z->lb = mlimit;
}
switch(among_var) {
case 0: return 0;
case 1:
{ int ret = slice_del(z); /* delete, line 70 */
if (ret < 0) return ret;
}
{ int m3 = z->l - z->c; (void)m3; /* do, line 70 */
{ int ret = r_consonant_pair(z);
if (ret == 0) goto lab1; /* call consonant_pair, line 70 */
if (ret < 0) return ret;
}
lab1:
z->c = z->l - m3;
}
break;
case 2:
{ int ret = slice_from_s(z, 3, s_2); /* <-, line 72 */
if (ret < 0) return ret;
}
break;
}
return 1;
}
static int r_undouble(struct SN_env * z) {
{ int mlimit; /* setlimit, line 76 */
int m1 = z->l - z->c; (void)m1;
if (z->c < z->I[0]) return 0;
z->c = z->I[0]; /* tomark, line 76 */
mlimit = z->lb; z->lb = z->c;
z->c = z->l - m1;
z->ket = z->c; /* [, line 76 */
if (out_grouping_b(z, g_v, 97, 248, 0)) { z->lb = mlimit; return 0; }
z->bra = z->c; /* ], line 76 */
z->S[0] = slice_to(z, z->S[0]); /* -> ch, line 76 */
if (z->S[0] == 0) return -1; /* -> ch, line 76 */
z->lb = mlimit;
}
if (!(eq_v_b(z, z->S[0]))) return 0; /* name ch, line 77 */
{ int ret = slice_del(z); /* delete, line 78 */
if (ret < 0) return ret;
}
return 1;
}
extern int danish_ISO_8859_1_stem(struct SN_env * z) {
{ int c1 = z->c; /* do, line 84 */
{ int ret = r_mark_regions(z);
if (ret == 0) goto lab0; /* call mark_regions, line 84 */
if (ret < 0) return ret;
}
lab0:
z->c = c1;
}
z->lb = z->c; z->c = z->l; /* backwards, line 85 */
{ int m2 = z->l - z->c; (void)m2; /* do, line 86 */
{ int ret = r_main_suffix(z);
if (ret == 0) goto lab1; /* call main_suffix, line 86 */
if (ret < 0) return ret;
}
lab1:
z->c = z->l - m2;
}
{ int m3 = z->l - z->c; (void)m3; /* do, line 87 */
{ int ret = r_consonant_pair(z);
if (ret == 0) goto lab2; /* call consonant_pair, line 87 */
if (ret < 0) return ret;
}
lab2:
z->c = z->l - m3;
}
{ int m4 = z->l - z->c; (void)m4; /* do, line 88 */
{ int ret = r_other_suffix(z);
if (ret == 0) goto lab3; /* call other_suffix, line 88 */
if (ret < 0) return ret;
}
lab3:
z->c = z->l - m4;
}
{ int m5 = z->l - z->c; (void)m5; /* do, line 89 */
{ int ret = r_undouble(z);
if (ret == 0) goto lab4; /* call undouble, line 89 */
if (ret < 0) return ret;
}
lab4:
z->c = z->l - m5;
}
z->c = z->lb;
return 1;
}
extern struct SN_env * danish_ISO_8859_1_create_env(void) { return SN_create_env(1, 2, 0); }
extern void danish_ISO_8859_1_close_env(struct SN_env * z) { SN_close_env(z, 1); }

View file

@ -1,16 +0,0 @@
/* This file was generated automatically by the Snowball to ANSI C compiler */
#ifdef __cplusplus
extern "C" {
#endif
extern struct SN_env * danish_ISO_8859_1_create_env(void);
extern void danish_ISO_8859_1_close_env(struct SN_env * z);
extern int danish_ISO_8859_1_stem(struct SN_env * z);
#ifdef __cplusplus
}
#endif

View file

@ -1,624 +0,0 @@
/* This file was generated automatically by the Snowball to ANSI C compiler */
#include "../runtime/header.h"
#ifdef __cplusplus
extern "C" {
#endif
extern int dutch_ISO_8859_1_stem(struct SN_env * z);
#ifdef __cplusplus
}
#endif
static int r_standard_suffix(struct SN_env * z);
static int r_undouble(struct SN_env * z);
static int r_R2(struct SN_env * z);
static int r_R1(struct SN_env * z);
static int r_mark_regions(struct SN_env * z);
static int r_en_ending(struct SN_env * z);
static int r_e_ending(struct SN_env * z);
static int r_postlude(struct SN_env * z);
static int r_prelude(struct SN_env * z);
#ifdef __cplusplus
extern "C" {
#endif
extern struct SN_env * dutch_ISO_8859_1_create_env(void);
extern void dutch_ISO_8859_1_close_env(struct SN_env * z);
#ifdef __cplusplus
}
#endif
static const symbol s_0_1[1] = { 0xE1 };
static const symbol s_0_2[1] = { 0xE4 };
static const symbol s_0_3[1] = { 0xE9 };
static const symbol s_0_4[1] = { 0xEB };
static const symbol s_0_5[1] = { 0xED };
static const symbol s_0_6[1] = { 0xEF };
static const symbol s_0_7[1] = { 0xF3 };
static const symbol s_0_8[1] = { 0xF6 };
static const symbol s_0_9[1] = { 0xFA };
static const symbol s_0_10[1] = { 0xFC };
static const struct among a_0[11] =
{
/* 0 */ { 0, 0, -1, 6, 0},
/* 1 */ { 1, s_0_1, 0, 1, 0},
/* 2 */ { 1, s_0_2, 0, 1, 0},
/* 3 */ { 1, s_0_3, 0, 2, 0},
/* 4 */ { 1, s_0_4, 0, 2, 0},
/* 5 */ { 1, s_0_5, 0, 3, 0},
/* 6 */ { 1, s_0_6, 0, 3, 0},
/* 7 */ { 1, s_0_7, 0, 4, 0},
/* 8 */ { 1, s_0_8, 0, 4, 0},
/* 9 */ { 1, s_0_9, 0, 5, 0},
/* 10 */ { 1, s_0_10, 0, 5, 0}
};
static const symbol s_1_1[1] = { 'I' };
static const symbol s_1_2[1] = { 'Y' };
static const struct among a_1[3] =
{
/* 0 */ { 0, 0, -1, 3, 0},
/* 1 */ { 1, s_1_1, 0, 2, 0},
/* 2 */ { 1, s_1_2, 0, 1, 0}
};
static const symbol s_2_0[2] = { 'd', 'd' };
static const symbol s_2_1[2] = { 'k', 'k' };
static const symbol s_2_2[2] = { 't', 't' };
static const struct among a_2[3] =
{
/* 0 */ { 2, s_2_0, -1, -1, 0},
/* 1 */ { 2, s_2_1, -1, -1, 0},
/* 2 */ { 2, s_2_2, -1, -1, 0}
};
static const symbol s_3_0[3] = { 'e', 'n', 'e' };
static const symbol s_3_1[2] = { 's', 'e' };
static const symbol s_3_2[2] = { 'e', 'n' };
static const symbol s_3_3[5] = { 'h', 'e', 'd', 'e', 'n' };
static const symbol s_3_4[1] = { 's' };
static const struct among a_3[5] =
{
/* 0 */ { 3, s_3_0, -1, 2, 0},
/* 1 */ { 2, s_3_1, -1, 3, 0},
/* 2 */ { 2, s_3_2, -1, 2, 0},
/* 3 */ { 5, s_3_3, 2, 1, 0},
/* 4 */ { 1, s_3_4, -1, 3, 0}
};
static const symbol s_4_0[3] = { 'e', 'n', 'd' };
static const symbol s_4_1[2] = { 'i', 'g' };
static const symbol s_4_2[3] = { 'i', 'n', 'g' };
static const symbol s_4_3[4] = { 'l', 'i', 'j', 'k' };
static const symbol s_4_4[4] = { 'b', 'a', 'a', 'r' };
static const symbol s_4_5[3] = { 'b', 'a', 'r' };
static const struct among a_4[6] =
{
/* 0 */ { 3, s_4_0, -1, 1, 0},
/* 1 */ { 2, s_4_1, -1, 2, 0},
/* 2 */ { 3, s_4_2, -1, 1, 0},
/* 3 */ { 4, s_4_3, -1, 3, 0},
/* 4 */ { 4, s_4_4, -1, 4, 0},
/* 5 */ { 3, s_4_5, -1, 5, 0}
};
static const symbol s_5_0[2] = { 'a', 'a' };
static const symbol s_5_1[2] = { 'e', 'e' };
static const symbol s_5_2[2] = { 'o', 'o' };
static const symbol s_5_3[2] = { 'u', 'u' };
static const struct among a_5[4] =
{
/* 0 */ { 2, s_5_0, -1, -1, 0},
/* 1 */ { 2, s_5_1, -1, -1, 0},
/* 2 */ { 2, s_5_2, -1, -1, 0},
/* 3 */ { 2, s_5_3, -1, -1, 0}
};
static const unsigned char g_v[] = { 17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128 };
static const unsigned char g_v_I[] = { 1, 0, 0, 17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128 };
static const unsigned char g_v_j[] = { 17, 67, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128 };
static const symbol s_0[] = { 'a' };
static const symbol s_1[] = { 'e' };
static const symbol s_2[] = { 'i' };
static const symbol s_3[] = { 'o' };
static const symbol s_4[] = { 'u' };
static const symbol s_5[] = { 'y' };
static const symbol s_6[] = { 'Y' };
static const symbol s_7[] = { 'i' };
static const symbol s_8[] = { 'I' };
static const symbol s_9[] = { 'y' };
static const symbol s_10[] = { 'Y' };
static const symbol s_11[] = { 'y' };
static const symbol s_12[] = { 'i' };
static const symbol s_13[] = { 'e' };
static const symbol s_14[] = { 'g', 'e', 'm' };
static const symbol s_15[] = { 'h', 'e', 'i', 'd' };
static const symbol s_16[] = { 'h', 'e', 'i', 'd' };
static const symbol s_17[] = { 'c' };
static const symbol s_18[] = { 'e', 'n' };
static const symbol s_19[] = { 'i', 'g' };
static const symbol s_20[] = { 'e' };
static const symbol s_21[] = { 'e' };
static int r_prelude(struct SN_env * z) {
int among_var;
{ int c_test = z->c; /* test, line 42 */
while(1) { /* repeat, line 42 */
int c1 = z->c;
z->bra = z->c; /* [, line 43 */
if (z->c >= z->l || z->p[z->c + 0] >> 5 != 7 || !((340306450 >> (z->p[z->c + 0] & 0x1f)) & 1)) among_var = 6; else
among_var = find_among(z, a_0, 11); /* substring, line 43 */
if (!(among_var)) goto lab0;
z->ket = z->c; /* ], line 43 */
switch(among_var) {
case 0: goto lab0;
case 1:
{ int ret = slice_from_s(z, 1, s_0); /* <-, line 45 */
if (ret < 0) return ret;
}
break;
case 2:
{ int ret = slice_from_s(z, 1, s_1); /* <-, line 47 */
if (ret < 0) return ret;
}
break;
case 3:
{ int ret = slice_from_s(z, 1, s_2); /* <-, line 49 */
if (ret < 0) return ret;
}
break;
case 4:
{ int ret = slice_from_s(z, 1, s_3); /* <-, line 51 */
if (ret < 0) return ret;
}
break;
case 5:
{ int ret = slice_from_s(z, 1, s_4); /* <-, line 53 */
if (ret < 0) return ret;
}
break;
case 6:
if (z->c >= z->l) goto lab0;
z->c++; /* next, line 54 */
break;
}
continue;
lab0:
z->c = c1;
break;
}
z->c = c_test;
}
{ int c_keep = z->c; /* try, line 57 */
z->bra = z->c; /* [, line 57 */
if (!(eq_s(z, 1, s_5))) { z->c = c_keep; goto lab1; }
z->ket = z->c; /* ], line 57 */
{ int ret = slice_from_s(z, 1, s_6); /* <-, line 57 */
if (ret < 0) return ret;
}
lab1:
;
}
while(1) { /* repeat, line 58 */
int c2 = z->c;
while(1) { /* goto, line 58 */
int c3 = z->c;
if (in_grouping(z, g_v, 97, 232, 0)) goto lab3;
z->bra = z->c; /* [, line 59 */
{ int c4 = z->c; /* or, line 59 */
if (!(eq_s(z, 1, s_7))) goto lab5;
z->ket = z->c; /* ], line 59 */
if (in_grouping(z, g_v, 97, 232, 0)) goto lab5;
{ int ret = slice_from_s(z, 1, s_8); /* <-, line 59 */
if (ret < 0) return ret;
}
goto lab4;
lab5:
z->c = c4;
if (!(eq_s(z, 1, s_9))) goto lab3;
z->ket = z->c; /* ], line 60 */
{ int ret = slice_from_s(z, 1, s_10); /* <-, line 60 */
if (ret < 0) return ret;
}
}
lab4:
z->c = c3;
break;
lab3:
z->c = c3;
if (z->c >= z->l) goto lab2;
z->c++; /* goto, line 58 */
}
continue;
lab2:
z->c = c2;
break;
}
return 1;
}
static int r_mark_regions(struct SN_env * z) {
z->I[0] = z->l;
z->I[1] = z->l;
{ /* gopast */ /* grouping v, line 69 */
int ret = out_grouping(z, g_v, 97, 232, 1);
if (ret < 0) return 0;
z->c += ret;
}
{ /* gopast */ /* non v, line 69 */
int ret = in_grouping(z, g_v, 97, 232, 1);
if (ret < 0) return 0;
z->c += ret;
}
z->I[0] = z->c; /* setmark p1, line 69 */
/* try, line 70 */
if (!(z->I[0] < 3)) goto lab0;
z->I[0] = 3;
lab0:
{ /* gopast */ /* grouping v, line 71 */
int ret = out_grouping(z, g_v, 97, 232, 1);
if (ret < 0) return 0;
z->c += ret;
}
{ /* gopast */ /* non v, line 71 */
int ret = in_grouping(z, g_v, 97, 232, 1);
if (ret < 0) return 0;
z->c += ret;
}
z->I[1] = z->c; /* setmark p2, line 71 */
return 1;
}
static int r_postlude(struct SN_env * z) {
int among_var;
while(1) { /* repeat, line 75 */
int c1 = z->c;
z->bra = z->c; /* [, line 77 */
if (z->c >= z->l || (z->p[z->c + 0] != 73 && z->p[z->c + 0] != 89)) among_var = 3; else
among_var = find_among(z, a_1, 3); /* substring, line 77 */
if (!(among_var)) goto lab0;
z->ket = z->c; /* ], line 77 */
switch(among_var) {
case 0: goto lab0;
case 1:
{ int ret = slice_from_s(z, 1, s_11); /* <-, line 78 */
if (ret < 0) return ret;
}
break;
case 2:
{ int ret = slice_from_s(z, 1, s_12); /* <-, line 79 */
if (ret < 0) return ret;
}
break;
case 3:
if (z->c >= z->l) goto lab0;
z->c++; /* next, line 80 */
break;
}
continue;
lab0:
z->c = c1;
break;
}
return 1;
}
static int r_R1(struct SN_env * z) {
if (!(z->I[0] <= z->c)) return 0;
return 1;
}
static int r_R2(struct SN_env * z) {
if (!(z->I[1] <= z->c)) return 0;
return 1;
}
static int r_undouble(struct SN_env * z) {
{ int m_test = z->l - z->c; /* test, line 91 */
if (z->c - 1 <= z->lb || z->p[z->c - 1] >> 5 != 3 || !((1050640 >> (z->p[z->c - 1] & 0x1f)) & 1)) return 0;
if (!(find_among_b(z, a_2, 3))) return 0; /* among, line 91 */
z->c = z->l - m_test;
}
z->ket = z->c; /* [, line 91 */
if (z->c <= z->lb) return 0;
z->c--; /* next, line 91 */
z->bra = z->c; /* ], line 91 */
{ int ret = slice_del(z); /* delete, line 91 */
if (ret < 0) return ret;
}
return 1;
}
static int r_e_ending(struct SN_env * z) {
z->B[0] = 0; /* unset e_found, line 95 */
z->ket = z->c; /* [, line 96 */
if (!(eq_s_b(z, 1, s_13))) return 0;
z->bra = z->c; /* ], line 96 */
{ int ret = r_R1(z);
if (ret == 0) return 0; /* call R1, line 96 */
if (ret < 0) return ret;
}
{ int m_test = z->l - z->c; /* test, line 96 */
if (out_grouping_b(z, g_v, 97, 232, 0)) return 0;
z->c = z->l - m_test;
}
{ int ret = slice_del(z); /* delete, line 96 */
if (ret < 0) return ret;
}
z->B[0] = 1; /* set e_found, line 97 */
{ int ret = r_undouble(z);
if (ret == 0) return 0; /* call undouble, line 98 */
if (ret < 0) return ret;
}
return 1;
}
static int r_en_ending(struct SN_env * z) {
{ int ret = r_R1(z);
if (ret == 0) return 0; /* call R1, line 102 */
if (ret < 0) return ret;
}
{ int m1 = z->l - z->c; (void)m1; /* and, line 102 */
if (out_grouping_b(z, g_v, 97, 232, 0)) return 0;
z->c = z->l - m1;
{ int m2 = z->l - z->c; (void)m2; /* not, line 102 */
if (!(eq_s_b(z, 3, s_14))) goto lab0;
return 0;
lab0:
z->c = z->l - m2;
}
}
{ int ret = slice_del(z); /* delete, line 102 */
if (ret < 0) return ret;
}
{ int ret = r_undouble(z);
if (ret == 0) return 0; /* call undouble, line 103 */
if (ret < 0) return ret;
}
return 1;
}
static int r_standard_suffix(struct SN_env * z) {
int among_var;
{ int m1 = z->l - z->c; (void)m1; /* do, line 107 */
z->ket = z->c; /* [, line 108 */
if (z->c <= z->lb || z->p[z->c - 1] >> 5 != 3 || !((540704 >> (z->p[z->c - 1] & 0x1f)) & 1)) goto lab0;
among_var = find_among_b(z, a_3, 5); /* substring, line 108 */
if (!(among_var)) goto lab0;
z->bra = z->c; /* ], line 108 */
switch(among_var) {
case 0: goto lab0;
case 1:
{ int ret = r_R1(z);
if (ret == 0) goto lab0; /* call R1, line 110 */
if (ret < 0) return ret;
}
{ int ret = slice_from_s(z, 4, s_15); /* <-, line 110 */
if (ret < 0) return ret;
}
break;
case 2:
{ int ret = r_en_ending(z);
if (ret == 0) goto lab0; /* call en_ending, line 113 */
if (ret < 0) return ret;
}
break;
case 3:
{ int ret = r_R1(z);
if (ret == 0) goto lab0; /* call R1, line 116 */
if (ret < 0) return ret;
}
if (out_grouping_b(z, g_v_j, 97, 232, 0)) goto lab0;
{ int ret = slice_del(z); /* delete, line 116 */
if (ret < 0) return ret;
}
break;
}
lab0:
z->c = z->l - m1;
}
{ int m2 = z->l - z->c; (void)m2; /* do, line 120 */
{ int ret = r_e_ending(z);
if (ret == 0) goto lab1; /* call e_ending, line 120 */
if (ret < 0) return ret;
}
lab1:
z->c = z->l - m2;
}
{ int m3 = z->l - z->c; (void)m3; /* do, line 122 */
z->ket = z->c; /* [, line 122 */
if (!(eq_s_b(z, 4, s_16))) goto lab2;
z->bra = z->c; /* ], line 122 */
{ int ret = r_R2(z);
if (ret == 0) goto lab2; /* call R2, line 122 */
if (ret < 0) return ret;
}
{ int m4 = z->l - z->c; (void)m4; /* not, line 122 */
if (!(eq_s_b(z, 1, s_17))) goto lab3;
goto lab2;
lab3:
z->c = z->l - m4;
}
{ int ret = slice_del(z); /* delete, line 122 */
if (ret < 0) return ret;
}
z->ket = z->c; /* [, line 123 */
if (!(eq_s_b(z, 2, s_18))) goto lab2;
z->bra = z->c; /* ], line 123 */
{ int ret = r_en_ending(z);
if (ret == 0) goto lab2; /* call en_ending, line 123 */
if (ret < 0) return ret;
}
lab2:
z->c = z->l - m3;
}
{ int m5 = z->l - z->c; (void)m5; /* do, line 126 */
z->ket = z->c; /* [, line 127 */
if (z->c - 1 <= z->lb || z->p[z->c - 1] >> 5 != 3 || !((264336 >> (z->p[z->c - 1] & 0x1f)) & 1)) goto lab4;
among_var = find_among_b(z, a_4, 6); /* substring, line 127 */
if (!(among_var)) goto lab4;
z->bra = z->c; /* ], line 127 */
switch(among_var) {
case 0: goto lab4;
case 1:
{ int ret = r_R2(z);
if (ret == 0) goto lab4; /* call R2, line 129 */
if (ret < 0) return ret;
}
{ int ret = slice_del(z); /* delete, line 129 */
if (ret < 0) return ret;
}
{ int m6 = z->l - z->c; (void)m6; /* or, line 130 */
z->ket = z->c; /* [, line 130 */
if (!(eq_s_b(z, 2, s_19))) goto lab6;
z->bra = z->c; /* ], line 130 */
{ int ret = r_R2(z);
if (ret == 0) goto lab6; /* call R2, line 130 */
if (ret < 0) return ret;
}
{ int m7 = z->l - z->c; (void)m7; /* not, line 130 */
if (!(eq_s_b(z, 1, s_20))) goto lab7;
goto lab6;
lab7:
z->c = z->l - m7;
}
{ int ret = slice_del(z); /* delete, line 130 */
if (ret < 0) return ret;
}
goto lab5;
lab6:
z->c = z->l - m6;
{ int ret = r_undouble(z);
if (ret == 0) goto lab4; /* call undouble, line 130 */
if (ret < 0) return ret;
}
}
lab5:
break;
case 2:
{ int ret = r_R2(z);
if (ret == 0) goto lab4; /* call R2, line 133 */
if (ret < 0) return ret;
}
{ int m8 = z->l - z->c; (void)m8; /* not, line 133 */
if (!(eq_s_b(z, 1, s_21))) goto lab8;
goto lab4;
lab8:
z->c = z->l - m8;
}
{ int ret = slice_del(z); /* delete, line 133 */
if (ret < 0) return ret;
}
break;
case 3:
{ int ret = r_R2(z);
if (ret == 0) goto lab4; /* call R2, line 136 */
if (ret < 0) return ret;
}
{ int ret = slice_del(z); /* delete, line 136 */
if (ret < 0) return ret;
}
{ int ret = r_e_ending(z);
if (ret == 0) goto lab4; /* call e_ending, line 136 */
if (ret < 0) return ret;
}
break;
case 4:
{ int ret = r_R2(z);
if (ret == 0) goto lab4; /* call R2, line 139 */
if (ret < 0) return ret;
}
{ int ret = slice_del(z); /* delete, line 139 */
if (ret < 0) return ret;
}
break;
case 5:
{ int ret = r_R2(z);
if (ret == 0) goto lab4; /* call R2, line 142 */
if (ret < 0) return ret;
}
if (!(z->B[0])) goto lab4; /* Boolean test e_found, line 142 */
{ int ret = slice_del(z); /* delete, line 142 */
if (ret < 0) return ret;
}
break;
}
lab4:
z->c = z->l - m5;
}
{ int m9 = z->l - z->c; (void)m9; /* do, line 146 */
if (out_grouping_b(z, g_v_I, 73, 232, 0)) goto lab9;
{ int m_test = z->l - z->c; /* test, line 148 */
if (z->c - 1 <= z->lb || z->p[z->c - 1] >> 5 != 3 || !((2129954 >> (z->p[z->c - 1] & 0x1f)) & 1)) goto lab9;
if (!(find_among_b(z, a_5, 4))) goto lab9; /* among, line 149 */
if (out_grouping_b(z, g_v, 97, 232, 0)) goto lab9;
z->c = z->l - m_test;
}
z->ket = z->c; /* [, line 152 */
if (z->c <= z->lb) goto lab9;
z->c--; /* next, line 152 */
z->bra = z->c; /* ], line 152 */
{ int ret = slice_del(z); /* delete, line 152 */
if (ret < 0) return ret;
}
lab9:
z->c = z->l - m9;
}
return 1;
}
extern int dutch_ISO_8859_1_stem(struct SN_env * z) {
{ int c1 = z->c; /* do, line 159 */
{ int ret = r_prelude(z);
if (ret == 0) goto lab0; /* call prelude, line 159 */
if (ret < 0) return ret;
}
lab0:
z->c = c1;
}
{ int c2 = z->c; /* do, line 160 */
{ int ret = r_mark_regions(z);
if (ret == 0) goto lab1; /* call mark_regions, line 160 */
if (ret < 0) return ret;
}
lab1:
z->c = c2;
}
z->lb = z->c; z->c = z->l; /* backwards, line 161 */
{ int m3 = z->l - z->c; (void)m3; /* do, line 162 */
{ int ret = r_standard_suffix(z);
if (ret == 0) goto lab2; /* call standard_suffix, line 162 */
if (ret < 0) return ret;
}
lab2:
z->c = z->l - m3;
}
z->c = z->lb;
{ int c4 = z->c; /* do, line 163 */
{ int ret = r_postlude(z);
if (ret == 0) goto lab3; /* call postlude, line 163 */
if (ret < 0) return ret;
}
lab3:
z->c = c4;
}
return 1;
}
extern struct SN_env * dutch_ISO_8859_1_create_env(void) { return SN_create_env(0, 2, 1); }
extern void dutch_ISO_8859_1_close_env(struct SN_env * z) { SN_close_env(z, 0); }

View file

@ -1,16 +0,0 @@
/* This file was generated automatically by the Snowball to ANSI C compiler */
#ifdef __cplusplus
extern "C" {
#endif
extern struct SN_env * dutch_ISO_8859_1_create_env(void);
extern void dutch_ISO_8859_1_close_env(struct SN_env * z);
extern int dutch_ISO_8859_1_stem(struct SN_env * z);
#ifdef __cplusplus
}
#endif

View file

@ -1,16 +0,0 @@
/* This file was generated automatically by the Snowball to ANSI C compiler */
#ifdef __cplusplus
extern "C" {
#endif
extern struct SN_env * english_ISO_8859_1_create_env(void);
extern void english_ISO_8859_1_close_env(struct SN_env * z);
extern int english_ISO_8859_1_stem(struct SN_env * z);
#ifdef __cplusplus
}
#endif

View file

@ -1,762 +0,0 @@
/* This file was generated automatically by the Snowball to ANSI C compiler */
#include "../runtime/header.h"
#ifdef __cplusplus
extern "C" {
#endif
extern int finnish_ISO_8859_1_stem(struct SN_env * z);
#ifdef __cplusplus
}
#endif
static int r_tidy(struct SN_env * z);
static int r_other_endings(struct SN_env * z);
static int r_t_plural(struct SN_env * z);
static int r_i_plural(struct SN_env * z);
static int r_case_ending(struct SN_env * z);
static int r_VI(struct SN_env * z);
static int r_LONG(struct SN_env * z);
static int r_possessive(struct SN_env * z);
static int r_particle_etc(struct SN_env * z);
static int r_R2(struct SN_env * z);
static int r_mark_regions(struct SN_env * z);
#ifdef __cplusplus
extern "C" {
#endif
extern struct SN_env * finnish_ISO_8859_1_create_env(void);
extern void finnish_ISO_8859_1_close_env(struct SN_env * z);
#ifdef __cplusplus
}
#endif
static const symbol s_0_0[2] = { 'p', 'a' };
static const symbol s_0_1[3] = { 's', 't', 'i' };
static const symbol s_0_2[4] = { 'k', 'a', 'a', 'n' };
static const symbol s_0_3[3] = { 'h', 'a', 'n' };
static const symbol s_0_4[3] = { 'k', 'i', 'n' };
static const symbol s_0_5[3] = { 'h', 0xE4, 'n' };
static const symbol s_0_6[4] = { 'k', 0xE4, 0xE4, 'n' };
static const symbol s_0_7[2] = { 'k', 'o' };
static const symbol s_0_8[2] = { 'p', 0xE4 };
static const symbol s_0_9[2] = { 'k', 0xF6 };
static const struct among a_0[10] =
{
/* 0 */ { 2, s_0_0, -1, 1, 0},
/* 1 */ { 3, s_0_1, -1, 2, 0},
/* 2 */ { 4, s_0_2, -1, 1, 0},
/* 3 */ { 3, s_0_3, -1, 1, 0},
/* 4 */ { 3, s_0_4, -1, 1, 0},
/* 5 */ { 3, s_0_5, -1, 1, 0},
/* 6 */ { 4, s_0_6, -1, 1, 0},
/* 7 */ { 2, s_0_7, -1, 1, 0},
/* 8 */ { 2, s_0_8, -1, 1, 0},
/* 9 */ { 2, s_0_9, -1, 1, 0}
};
static const symbol s_1_0[3] = { 'l', 'l', 'a' };
static const symbol s_1_1[2] = { 'n', 'a' };
static const symbol s_1_2[3] = { 's', 's', 'a' };
static const symbol s_1_3[2] = { 't', 'a' };
static const symbol s_1_4[3] = { 'l', 't', 'a' };
static const symbol s_1_5[3] = { 's', 't', 'a' };
static const struct among a_1[6] =
{
/* 0 */ { 3, s_1_0, -1, -1, 0},
/* 1 */ { 2, s_1_1, -1, -1, 0},
/* 2 */ { 3, s_1_2, -1, -1, 0},
/* 3 */ { 2, s_1_3, -1, -1, 0},
/* 4 */ { 3, s_1_4, 3, -1, 0},
/* 5 */ { 3, s_1_5, 3, -1, 0}
};
static const symbol s_2_0[3] = { 'l', 'l', 0xE4 };
static const symbol s_2_1[2] = { 'n', 0xE4 };
static const symbol s_2_2[3] = { 's', 's', 0xE4 };
static const symbol s_2_3[2] = { 't', 0xE4 };
static const symbol s_2_4[3] = { 'l', 't', 0xE4 };
static const symbol s_2_5[3] = { 's', 't', 0xE4 };
static const struct among a_2[6] =
{
/* 0 */ { 3, s_2_0, -1, -1, 0},
/* 1 */ { 2, s_2_1, -1, -1, 0},
/* 2 */ { 3, s_2_2, -1, -1, 0},
/* 3 */ { 2, s_2_3, -1, -1, 0},
/* 4 */ { 3, s_2_4, 3, -1, 0},
/* 5 */ { 3, s_2_5, 3, -1, 0}
};
static const symbol s_3_0[3] = { 'l', 'l', 'e' };
static const symbol s_3_1[3] = { 'i', 'n', 'e' };
static const struct among a_3[2] =
{
/* 0 */ { 3, s_3_0, -1, -1, 0},
/* 1 */ { 3, s_3_1, -1, -1, 0}
};
static const symbol s_4_0[3] = { 'n', 's', 'a' };
static const symbol s_4_1[3] = { 'm', 'm', 'e' };
static const symbol s_4_2[3] = { 'n', 'n', 'e' };
static const symbol s_4_3[2] = { 'n', 'i' };
static const symbol s_4_4[2] = { 's', 'i' };
static const symbol s_4_5[2] = { 'a', 'n' };
static const symbol s_4_6[2] = { 'e', 'n' };
static const symbol s_4_7[2] = { 0xE4, 'n' };
static const symbol s_4_8[3] = { 'n', 's', 0xE4 };
static const struct among a_4[9] =
{
/* 0 */ { 3, s_4_0, -1, 3, 0},
/* 1 */ { 3, s_4_1, -1, 3, 0},
/* 2 */ { 3, s_4_2, -1, 3, 0},
/* 3 */ { 2, s_4_3, -1, 2, 0},
/* 4 */ { 2, s_4_4, -1, 1, 0},
/* 5 */ { 2, s_4_5, -1, 4, 0},
/* 6 */ { 2, s_4_6, -1, 6, 0},
/* 7 */ { 2, s_4_7, -1, 5, 0},
/* 8 */ { 3, s_4_8, -1, 3, 0}
};
static const symbol s_5_0[2] = { 'a', 'a' };
static const symbol s_5_1[2] = { 'e', 'e' };
static const symbol s_5_2[2] = { 'i', 'i' };
static const symbol s_5_3[2] = { 'o', 'o' };
static const symbol s_5_4[2] = { 'u', 'u' };
static const symbol s_5_5[2] = { 0xE4, 0xE4 };
static const symbol s_5_6[2] = { 0xF6, 0xF6 };
static const struct among a_5[7] =
{
/* 0 */ { 2, s_5_0, -1, -1, 0},
/* 1 */ { 2, s_5_1, -1, -1, 0},
/* 2 */ { 2, s_5_2, -1, -1, 0},
/* 3 */ { 2, s_5_3, -1, -1, 0},
/* 4 */ { 2, s_5_4, -1, -1, 0},
/* 5 */ { 2, s_5_5, -1, -1, 0},
/* 6 */ { 2, s_5_6, -1, -1, 0}
};
static const symbol s_6_0[1] = { 'a' };
static const symbol s_6_1[3] = { 'l', 'l', 'a' };
static const symbol s_6_2[2] = { 'n', 'a' };
static const symbol s_6_3[3] = { 's', 's', 'a' };
static const symbol s_6_4[2] = { 't', 'a' };
static const symbol s_6_5[3] = { 'l', 't', 'a' };
static const symbol s_6_6[3] = { 's', 't', 'a' };
static const symbol s_6_7[3] = { 't', 't', 'a' };
static const symbol s_6_8[3] = { 'l', 'l', 'e' };
static const symbol s_6_9[3] = { 'i', 'n', 'e' };
static const symbol s_6_10[3] = { 'k', 's', 'i' };
static const symbol s_6_11[1] = { 'n' };
static const symbol s_6_12[3] = { 'h', 'a', 'n' };
static const symbol s_6_13[3] = { 'd', 'e', 'n' };
static const symbol s_6_14[4] = { 's', 'e', 'e', 'n' };
static const symbol s_6_15[3] = { 'h', 'e', 'n' };
static const symbol s_6_16[4] = { 't', 't', 'e', 'n' };
static const symbol s_6_17[3] = { 'h', 'i', 'n' };
static const symbol s_6_18[4] = { 's', 'i', 'i', 'n' };
static const symbol s_6_19[3] = { 'h', 'o', 'n' };
static const symbol s_6_20[3] = { 'h', 0xE4, 'n' };
static const symbol s_6_21[3] = { 'h', 0xF6, 'n' };
static const symbol s_6_22[1] = { 0xE4 };
static const symbol s_6_23[3] = { 'l', 'l', 0xE4 };
static const symbol s_6_24[2] = { 'n', 0xE4 };
static const symbol s_6_25[3] = { 's', 's', 0xE4 };
static const symbol s_6_26[2] = { 't', 0xE4 };
static const symbol s_6_27[3] = { 'l', 't', 0xE4 };
static const symbol s_6_28[3] = { 's', 't', 0xE4 };
static const symbol s_6_29[3] = { 't', 't', 0xE4 };
static const struct among a_6[30] =
{
/* 0 */ { 1, s_6_0, -1, 8, 0},
/* 1 */ { 3, s_6_1, 0, -1, 0},
/* 2 */ { 2, s_6_2, 0, -1, 0},
/* 3 */ { 3, s_6_3, 0, -1, 0},
/* 4 */ { 2, s_6_4, 0, -1, 0},
/* 5 */ { 3, s_6_5, 4, -1, 0},
/* 6 */ { 3, s_6_6, 4, -1, 0},
/* 7 */ { 3, s_6_7, 4, 9, 0},
/* 8 */ { 3, s_6_8, -1, -1, 0},
/* 9 */ { 3, s_6_9, -1, -1, 0},
/* 10 */ { 3, s_6_10, -1, -1, 0},
/* 11 */ { 1, s_6_11, -1, 7, 0},
/* 12 */ { 3, s_6_12, 11, 1, 0},
/* 13 */ { 3, s_6_13, 11, -1, r_VI},
/* 14 */ { 4, s_6_14, 11, -1, r_LONG},
/* 15 */ { 3, s_6_15, 11, 2, 0},
/* 16 */ { 4, s_6_16, 11, -1, r_VI},
/* 17 */ { 3, s_6_17, 11, 3, 0},
/* 18 */ { 4, s_6_18, 11, -1, r_VI},
/* 19 */ { 3, s_6_19, 11, 4, 0},
/* 20 */ { 3, s_6_20, 11, 5, 0},
/* 21 */ { 3, s_6_21, 11, 6, 0},
/* 22 */ { 1, s_6_22, -1, 8, 0},
/* 23 */ { 3, s_6_23, 22, -1, 0},
/* 24 */ { 2, s_6_24, 22, -1, 0},
/* 25 */ { 3, s_6_25, 22, -1, 0},
/* 26 */ { 2, s_6_26, 22, -1, 0},
/* 27 */ { 3, s_6_27, 26, -1, 0},
/* 28 */ { 3, s_6_28, 26, -1, 0},
/* 29 */ { 3, s_6_29, 26, 9, 0}
};
static const symbol s_7_0[3] = { 'e', 'j', 'a' };
static const symbol s_7_1[3] = { 'm', 'm', 'a' };
static const symbol s_7_2[4] = { 'i', 'm', 'm', 'a' };
static const symbol s_7_3[3] = { 'm', 'p', 'a' };
static const symbol s_7_4[4] = { 'i', 'm', 'p', 'a' };
static const symbol s_7_5[3] = { 'm', 'm', 'i' };
static const symbol s_7_6[4] = { 'i', 'm', 'm', 'i' };
static const symbol s_7_7[3] = { 'm', 'p', 'i' };
static const symbol s_7_8[4] = { 'i', 'm', 'p', 'i' };
static const symbol s_7_9[3] = { 'e', 'j', 0xE4 };
static const symbol s_7_10[3] = { 'm', 'm', 0xE4 };
static const symbol s_7_11[4] = { 'i', 'm', 'm', 0xE4 };
static const symbol s_7_12[3] = { 'm', 'p', 0xE4 };
static const symbol s_7_13[4] = { 'i', 'm', 'p', 0xE4 };
static const struct among a_7[14] =
{
/* 0 */ { 3, s_7_0, -1, -1, 0},
/* 1 */ { 3, s_7_1, -1, 1, 0},
/* 2 */ { 4, s_7_2, 1, -1, 0},
/* 3 */ { 3, s_7_3, -1, 1, 0},
/* 4 */ { 4, s_7_4, 3, -1, 0},
/* 5 */ { 3, s_7_5, -1, 1, 0},
/* 6 */ { 4, s_7_6, 5, -1, 0},
/* 7 */ { 3, s_7_7, -1, 1, 0},
/* 8 */ { 4, s_7_8, 7, -1, 0},
/* 9 */ { 3, s_7_9, -1, -1, 0},
/* 10 */ { 3, s_7_10, -1, 1, 0},
/* 11 */ { 4, s_7_11, 10, -1, 0},
/* 12 */ { 3, s_7_12, -1, 1, 0},
/* 13 */ { 4, s_7_13, 12, -1, 0}
};
static const symbol s_8_0[1] = { 'i' };
static const symbol s_8_1[1] = { 'j' };
static const struct among a_8[2] =
{
/* 0 */ { 1, s_8_0, -1, -1, 0},
/* 1 */ { 1, s_8_1, -1, -1, 0}
};
static const symbol s_9_0[3] = { 'm', 'm', 'a' };
static const symbol s_9_1[4] = { 'i', 'm', 'm', 'a' };
static const struct among a_9[2] =
{
/* 0 */ { 3, s_9_0, -1, 1, 0},
/* 1 */ { 4, s_9_1, 0, -1, 0}
};
static const unsigned char g_AEI[] = { 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8 };
static const unsigned char g_V1[] = { 17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 32 };
static const unsigned char g_V2[] = { 17, 65, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 32 };
static const unsigned char g_particle_end[] = { 17, 97, 24, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 32 };
static const symbol s_0[] = { 'k' };
static const symbol s_1[] = { 'k', 's', 'e' };
static const symbol s_2[] = { 'k', 's', 'i' };
static const symbol s_3[] = { 'i' };
static const symbol s_4[] = { 'a' };
static const symbol s_5[] = { 'e' };
static const symbol s_6[] = { 'i' };
static const symbol s_7[] = { 'o' };
static const symbol s_8[] = { 0xE4 };
static const symbol s_9[] = { 0xF6 };
static const symbol s_10[] = { 'i', 'e' };
static const symbol s_11[] = { 'e' };
static const symbol s_12[] = { 'p', 'o' };
static const symbol s_13[] = { 't' };
static const symbol s_14[] = { 'p', 'o' };
static const symbol s_15[] = { 'j' };
static const symbol s_16[] = { 'o' };
static const symbol s_17[] = { 'u' };
static const symbol s_18[] = { 'o' };
static const symbol s_19[] = { 'j' };
static int r_mark_regions(struct SN_env * z) {
z->I[0] = z->l;
z->I[1] = z->l;
if (out_grouping(z, g_V1, 97, 246, 1) < 0) return 0; /* goto */ /* grouping V1, line 46 */
{ /* gopast */ /* non V1, line 46 */
int ret = in_grouping(z, g_V1, 97, 246, 1);
if (ret < 0) return 0;
z->c += ret;
}
z->I[0] = z->c; /* setmark p1, line 46 */
if (out_grouping(z, g_V1, 97, 246, 1) < 0) return 0; /* goto */ /* grouping V1, line 47 */
{ /* gopast */ /* non V1, line 47 */
int ret = in_grouping(z, g_V1, 97, 246, 1);
if (ret < 0) return 0;
z->c += ret;
}
z->I[1] = z->c; /* setmark p2, line 47 */
return 1;
}
static int r_R2(struct SN_env * z) {
if (!(z->I[1] <= z->c)) return 0;
return 1;
}
static int r_particle_etc(struct SN_env * z) {
int among_var;
{ int mlimit; /* setlimit, line 55 */
int m1 = z->l - z->c; (void)m1;
if (z->c < z->I[0]) return 0;
z->c = z->I[0]; /* tomark, line 55 */
mlimit = z->lb; z->lb = z->c;
z->c = z->l - m1;
z->ket = z->c; /* [, line 55 */
among_var = find_among_b(z, a_0, 10); /* substring, line 55 */
if (!(among_var)) { z->lb = mlimit; return 0; }
z->bra = z->c; /* ], line 55 */
z->lb = mlimit;
}
switch(among_var) {
case 0: return 0;
case 1:
if (in_grouping_b(z, g_particle_end, 97, 246, 0)) return 0;
break;
case 2:
{ int ret = r_R2(z);
if (ret == 0) return 0; /* call R2, line 64 */
if (ret < 0) return ret;
}
break;
}
{ int ret = slice_del(z); /* delete, line 66 */
if (ret < 0) return ret;
}
return 1;
}
static int r_possessive(struct SN_env * z) {
int among_var;
{ int mlimit; /* setlimit, line 69 */
int m1 = z->l - z->c; (void)m1;
if (z->c < z->I[0]) return 0;
z->c = z->I[0]; /* tomark, line 69 */
mlimit = z->lb; z->lb = z->c;
z->c = z->l - m1;
z->ket = z->c; /* [, line 69 */
among_var = find_among_b(z, a_4, 9); /* substring, line 69 */
if (!(among_var)) { z->lb = mlimit; return 0; }
z->bra = z->c; /* ], line 69 */
z->lb = mlimit;
}
switch(among_var) {
case 0: return 0;
case 1:
{ int m2 = z->l - z->c; (void)m2; /* not, line 72 */
if (!(eq_s_b(z, 1, s_0))) goto lab0;
return 0;
lab0:
z->c = z->l - m2;
}
{ int ret = slice_del(z); /* delete, line 72 */
if (ret < 0) return ret;
}
break;
case 2:
{ int ret = slice_del(z); /* delete, line 74 */
if (ret < 0) return ret;
}
z->ket = z->c; /* [, line 74 */
if (!(eq_s_b(z, 3, s_1))) return 0;
z->bra = z->c; /* ], line 74 */
{ int ret = slice_from_s(z, 3, s_2); /* <-, line 74 */
if (ret < 0) return ret;
}
break;
case 3:
{ int ret = slice_del(z); /* delete, line 78 */
if (ret < 0) return ret;
}
break;
case 4:
if (z->c - 1 <= z->lb || z->p[z->c - 1] != 97) return 0;
if (!(find_among_b(z, a_1, 6))) return 0; /* among, line 81 */
{ int ret = slice_del(z); /* delete, line 81 */
if (ret < 0) return ret;
}
break;
case 5:
if (z->c - 1 <= z->lb || z->p[z->c - 1] != 228) return 0;
if (!(find_among_b(z, a_2, 6))) return 0; /* among, line 83 */
{ int ret = slice_del(z); /* delete, line 84 */
if (ret < 0) return ret;
}
break;
case 6:
if (z->c - 2 <= z->lb || z->p[z->c - 1] != 101) return 0;
if (!(find_among_b(z, a_3, 2))) return 0; /* among, line 86 */
{ int ret = slice_del(z); /* delete, line 86 */
if (ret < 0) return ret;
}
break;
}
return 1;
}
static int r_LONG(struct SN_env * z) {
if (!(find_among_b(z, a_5, 7))) return 0; /* among, line 91 */
return 1;
}
static int r_VI(struct SN_env * z) {
if (!(eq_s_b(z, 1, s_3))) return 0;
if (in_grouping_b(z, g_V2, 97, 246, 0)) return 0;
return 1;
}
static int r_case_ending(struct SN_env * z) {
int among_var;
{ int mlimit; /* setlimit, line 96 */
int m1 = z->l - z->c; (void)m1;
if (z->c < z->I[0]) return 0;
z->c = z->I[0]; /* tomark, line 96 */
mlimit = z->lb; z->lb = z->c;
z->c = z->l - m1;
z->ket = z->c; /* [, line 96 */
among_var = find_among_b(z, a_6, 30); /* substring, line 96 */
if (!(among_var)) { z->lb = mlimit; return 0; }
z->bra = z->c; /* ], line 96 */
z->lb = mlimit;
}
switch(among_var) {
case 0: return 0;
case 1:
if (!(eq_s_b(z, 1, s_4))) return 0;
break;
case 2:
if (!(eq_s_b(z, 1, s_5))) return 0;
break;
case 3:
if (!(eq_s_b(z, 1, s_6))) return 0;
break;
case 4:
if (!(eq_s_b(z, 1, s_7))) return 0;
break;
case 5:
if (!(eq_s_b(z, 1, s_8))) return 0;
break;
case 6:
if (!(eq_s_b(z, 1, s_9))) return 0;
break;
case 7:
{ int m_keep = z->l - z->c;/* (void) m_keep;*/ /* try, line 111 */
{ int m2 = z->l - z->c; (void)m2; /* and, line 113 */
{ int m3 = z->l - z->c; (void)m3; /* or, line 112 */
{ int ret = r_LONG(z);
if (ret == 0) goto lab2; /* call LONG, line 111 */
if (ret < 0) return ret;
}
goto lab1;
lab2:
z->c = z->l - m3;
if (!(eq_s_b(z, 2, s_10))) { z->c = z->l - m_keep; goto lab0; }
}
lab1:
z->c = z->l - m2;
if (z->c <= z->lb) { z->c = z->l - m_keep; goto lab0; }
z->c--; /* next, line 113 */
}
z->bra = z->c; /* ], line 113 */
lab0:
;
}
break;
case 8:
if (in_grouping_b(z, g_V1, 97, 246, 0)) return 0;
if (out_grouping_b(z, g_V1, 97, 246, 0)) return 0;
break;
case 9:
if (!(eq_s_b(z, 1, s_11))) return 0;
break;
}
{ int ret = slice_del(z); /* delete, line 138 */
if (ret < 0) return ret;
}
z->B[0] = 1; /* set ending_removed, line 139 */
return 1;
}
static int r_other_endings(struct SN_env * z) {
int among_var;
{ int mlimit; /* setlimit, line 142 */
int m1 = z->l - z->c; (void)m1;
if (z->c < z->I[1]) return 0;
z->c = z->I[1]; /* tomark, line 142 */
mlimit = z->lb; z->lb = z->c;
z->c = z->l - m1;
z->ket = z->c; /* [, line 142 */
among_var = find_among_b(z, a_7, 14); /* substring, line 142 */
if (!(among_var)) { z->lb = mlimit; return 0; }
z->bra = z->c; /* ], line 142 */
z->lb = mlimit;
}
switch(among_var) {
case 0: return 0;
case 1:
{ int m2 = z->l - z->c; (void)m2; /* not, line 146 */
if (!(eq_s_b(z, 2, s_12))) goto lab0;
return 0;
lab0:
z->c = z->l - m2;
}
break;
}
{ int ret = slice_del(z); /* delete, line 151 */
if (ret < 0) return ret;
}
return 1;
}
static int r_i_plural(struct SN_env * z) {
{ int mlimit; /* setlimit, line 154 */
int m1 = z->l - z->c; (void)m1;
if (z->c < z->I[0]) return 0;
z->c = z->I[0]; /* tomark, line 154 */
mlimit = z->lb; z->lb = z->c;
z->c = z->l - m1;
z->ket = z->c; /* [, line 154 */
if (z->c <= z->lb || (z->p[z->c - 1] != 105 && z->p[z->c - 1] != 106)) { z->lb = mlimit; return 0; }
if (!(find_among_b(z, a_8, 2))) { z->lb = mlimit; return 0; } /* substring, line 154 */
z->bra = z->c; /* ], line 154 */
z->lb = mlimit;
}
{ int ret = slice_del(z); /* delete, line 158 */
if (ret < 0) return ret;
}
return 1;
}
static int r_t_plural(struct SN_env * z) {
int among_var;
{ int mlimit; /* setlimit, line 161 */
int m1 = z->l - z->c; (void)m1;
if (z->c < z->I[0]) return 0;
z->c = z->I[0]; /* tomark, line 161 */
mlimit = z->lb; z->lb = z->c;
z->c = z->l - m1;
z->ket = z->c; /* [, line 162 */
if (!(eq_s_b(z, 1, s_13))) { z->lb = mlimit; return 0; }
z->bra = z->c; /* ], line 162 */
{ int m_test = z->l - z->c; /* test, line 162 */
if (in_grouping_b(z, g_V1, 97, 246, 0)) { z->lb = mlimit; return 0; }
z->c = z->l - m_test;
}
{ int ret = slice_del(z); /* delete, line 163 */
if (ret < 0) return ret;
}
z->lb = mlimit;
}
{ int mlimit; /* setlimit, line 165 */
int m2 = z->l - z->c; (void)m2;
if (z->c < z->I[1]) return 0;
z->c = z->I[1]; /* tomark, line 165 */
mlimit = z->lb; z->lb = z->c;
z->c = z->l - m2;
z->ket = z->c; /* [, line 165 */
if (z->c - 2 <= z->lb || z->p[z->c - 1] != 97) { z->lb = mlimit; return 0; }
among_var = find_among_b(z, a_9, 2); /* substring, line 165 */
if (!(among_var)) { z->lb = mlimit; return 0; }
z->bra = z->c; /* ], line 165 */
z->lb = mlimit;
}
switch(among_var) {
case 0: return 0;
case 1:
{ int m3 = z->l - z->c; (void)m3; /* not, line 167 */
if (!(eq_s_b(z, 2, s_14))) goto lab0;
return 0;
lab0:
z->c = z->l - m3;
}
break;
}
{ int ret = slice_del(z); /* delete, line 170 */
if (ret < 0) return ret;
}
return 1;
}
static int r_tidy(struct SN_env * z) {
{ int mlimit; /* setlimit, line 173 */
int m1 = z->l - z->c; (void)m1;
if (z->c < z->I[0]) return 0;
z->c = z->I[0]; /* tomark, line 173 */
mlimit = z->lb; z->lb = z->c;
z->c = z->l - m1;
{ int m2 = z->l - z->c; (void)m2; /* do, line 174 */
{ int m3 = z->l - z->c; (void)m3; /* and, line 174 */
{ int ret = r_LONG(z);
if (ret == 0) goto lab0; /* call LONG, line 174 */
if (ret < 0) return ret;
}
z->c = z->l - m3;
z->ket = z->c; /* [, line 174 */
if (z->c <= z->lb) goto lab0;
z->c--; /* next, line 174 */
z->bra = z->c; /* ], line 174 */
{ int ret = slice_del(z); /* delete, line 174 */
if (ret < 0) return ret;
}
}
lab0:
z->c = z->l - m2;
}
{ int m4 = z->l - z->c; (void)m4; /* do, line 175 */
z->ket = z->c; /* [, line 175 */
if (in_grouping_b(z, g_AEI, 97, 228, 0)) goto lab1;
z->bra = z->c; /* ], line 175 */
if (out_grouping_b(z, g_V1, 97, 246, 0)) goto lab1;
{ int ret = slice_del(z); /* delete, line 175 */
if (ret < 0) return ret;
}
lab1:
z->c = z->l - m4;
}
{ int m5 = z->l - z->c; (void)m5; /* do, line 176 */
z->ket = z->c; /* [, line 176 */
if (!(eq_s_b(z, 1, s_15))) goto lab2;
z->bra = z->c; /* ], line 176 */
{ int m6 = z->l - z->c; (void)m6; /* or, line 176 */
if (!(eq_s_b(z, 1, s_16))) goto lab4;
goto lab3;
lab4:
z->c = z->l - m6;
if (!(eq_s_b(z, 1, s_17))) goto lab2;
}
lab3:
{ int ret = slice_del(z); /* delete, line 176 */
if (ret < 0) return ret;
}
lab2:
z->c = z->l - m5;
}
{ int m7 = z->l - z->c; (void)m7; /* do, line 177 */
z->ket = z->c; /* [, line 177 */
if (!(eq_s_b(z, 1, s_18))) goto lab5;
z->bra = z->c; /* ], line 177 */
if (!(eq_s_b(z, 1, s_19))) goto lab5;
{ int ret = slice_del(z); /* delete, line 177 */
if (ret < 0) return ret;
}
lab5:
z->c = z->l - m7;
}
z->lb = mlimit;
}
if (in_grouping_b(z, g_V1, 97, 246, 1) < 0) return 0; /* goto */ /* non V1, line 179 */
z->ket = z->c; /* [, line 179 */
if (z->c <= z->lb) return 0;
z->c--; /* next, line 179 */
z->bra = z->c; /* ], line 179 */
z->S[0] = slice_to(z, z->S[0]); /* -> x, line 179 */
if (z->S[0] == 0) return -1; /* -> x, line 179 */
if (!(eq_v_b(z, z->S[0]))) return 0; /* name x, line 179 */
{ int ret = slice_del(z); /* delete, line 179 */
if (ret < 0) return ret;
}
return 1;
}
extern int finnish_ISO_8859_1_stem(struct SN_env * z) {
{ int c1 = z->c; /* do, line 185 */
{ int ret = r_mark_regions(z);
if (ret == 0) goto lab0; /* call mark_regions, line 185 */
if (ret < 0) return ret;
}
lab0:
z->c = c1;
}
z->B[0] = 0; /* unset ending_removed, line 186 */
z->lb = z->c; z->c = z->l; /* backwards, line 187 */
{ int m2 = z->l - z->c; (void)m2; /* do, line 188 */
{ int ret = r_particle_etc(z);
if (ret == 0) goto lab1; /* call particle_etc, line 188 */
if (ret < 0) return ret;
}
lab1:
z->c = z->l - m2;
}
{ int m3 = z->l - z->c; (void)m3; /* do, line 189 */
{ int ret = r_possessive(z);
if (ret == 0) goto lab2; /* call possessive, line 189 */
if (ret < 0) return ret;
}
lab2:
z->c = z->l - m3;
}
{ int m4 = z->l - z->c; (void)m4; /* do, line 190 */
{ int ret = r_case_ending(z);
if (ret == 0) goto lab3; /* call case_ending, line 190 */
if (ret < 0) return ret;
}
lab3:
z->c = z->l - m4;
}
{ int m5 = z->l - z->c; (void)m5; /* do, line 191 */
{ int ret = r_other_endings(z);
if (ret == 0) goto lab4; /* call other_endings, line 191 */
if (ret < 0) return ret;
}
lab4:
z->c = z->l - m5;
}
{ int m6 = z->l - z->c; (void)m6; /* or, line 192 */
if (!(z->B[0])) goto lab6; /* Boolean test ending_removed, line 192 */
{ int m7 = z->l - z->c; (void)m7; /* do, line 192 */
{ int ret = r_i_plural(z);
if (ret == 0) goto lab7; /* call i_plural, line 192 */
if (ret < 0) return ret;
}
lab7:
z->c = z->l - m7;
}
goto lab5;
lab6:
z->c = z->l - m6;
{ int m8 = z->l - z->c; (void)m8; /* do, line 192 */
{ int ret = r_t_plural(z);
if (ret == 0) goto lab8; /* call t_plural, line 192 */
if (ret < 0) return ret;
}
lab8:
z->c = z->l - m8;
}
}
lab5:
{ int m9 = z->l - z->c; (void)m9; /* do, line 193 */
{ int ret = r_tidy(z);
if (ret == 0) goto lab9; /* call tidy, line 193 */
if (ret < 0) return ret;
}
lab9:
z->c = z->l - m9;
}
z->c = z->lb;
return 1;
}
extern struct SN_env * finnish_ISO_8859_1_create_env(void) { return SN_create_env(1, 2, 1); }
extern void finnish_ISO_8859_1_close_env(struct SN_env * z) { SN_close_env(z, 1); }

View file

@ -1,16 +0,0 @@
/* This file was generated automatically by the Snowball to ANSI C compiler */
#ifdef __cplusplus
extern "C" {
#endif
extern struct SN_env * finnish_ISO_8859_1_create_env(void);
extern void finnish_ISO_8859_1_close_env(struct SN_env * z);
extern int finnish_ISO_8859_1_stem(struct SN_env * z);
#ifdef __cplusplus
}
#endif

View file

@ -1,16 +0,0 @@
/* This file was generated automatically by the Snowball to ANSI C compiler */
#ifdef __cplusplus
extern "C" {
#endif
extern struct SN_env * french_ISO_8859_1_create_env(void);
extern void french_ISO_8859_1_close_env(struct SN_env * z);
extern int french_ISO_8859_1_stem(struct SN_env * z);
#ifdef __cplusplus
}
#endif

View file

@ -1,521 +0,0 @@
/* This file was generated automatically by the Snowball to ANSI C compiler */
#include "../runtime/header.h"
#ifdef __cplusplus
extern "C" {
#endif
extern int german_ISO_8859_1_stem(struct SN_env * z);
#ifdef __cplusplus
}
#endif
static int r_standard_suffix(struct SN_env * z);
static int r_R2(struct SN_env * z);
static int r_R1(struct SN_env * z);
static int r_mark_regions(struct SN_env * z);
static int r_postlude(struct SN_env * z);
static int r_prelude(struct SN_env * z);
#ifdef __cplusplus
extern "C" {
#endif
extern struct SN_env * german_ISO_8859_1_create_env(void);
extern void german_ISO_8859_1_close_env(struct SN_env * z);
#ifdef __cplusplus
}
#endif
static const symbol s_0_1[1] = { 'U' };
static const symbol s_0_2[1] = { 'Y' };
static const symbol s_0_3[1] = { 0xE4 };
static const symbol s_0_4[1] = { 0xF6 };
static const symbol s_0_5[1] = { 0xFC };
static const struct among a_0[6] =
{
/* 0 */ { 0, 0, -1, 6, 0},
/* 1 */ { 1, s_0_1, 0, 2, 0},
/* 2 */ { 1, s_0_2, 0, 1, 0},
/* 3 */ { 1, s_0_3, 0, 3, 0},
/* 4 */ { 1, s_0_4, 0, 4, 0},
/* 5 */ { 1, s_0_5, 0, 5, 0}
};
static const symbol s_1_0[1] = { 'e' };
static const symbol s_1_1[2] = { 'e', 'm' };
static const symbol s_1_2[2] = { 'e', 'n' };
static const symbol s_1_3[3] = { 'e', 'r', 'n' };
static const symbol s_1_4[2] = { 'e', 'r' };
static const symbol s_1_5[1] = { 's' };
static const symbol s_1_6[2] = { 'e', 's' };
static const struct among a_1[7] =
{
/* 0 */ { 1, s_1_0, -1, 2, 0},
/* 1 */ { 2, s_1_1, -1, 1, 0},
/* 2 */ { 2, s_1_2, -1, 2, 0},
/* 3 */ { 3, s_1_3, -1, 1, 0},
/* 4 */ { 2, s_1_4, -1, 1, 0},
/* 5 */ { 1, s_1_5, -1, 3, 0},
/* 6 */ { 2, s_1_6, 5, 2, 0}
};
static const symbol s_2_0[2] = { 'e', 'n' };
static const symbol s_2_1[2] = { 'e', 'r' };
static const symbol s_2_2[2] = { 's', 't' };
static const symbol s_2_3[3] = { 'e', 's', 't' };
static const struct among a_2[4] =
{
/* 0 */ { 2, s_2_0, -1, 1, 0},
/* 1 */ { 2, s_2_1, -1, 1, 0},
/* 2 */ { 2, s_2_2, -1, 2, 0},
/* 3 */ { 3, s_2_3, 2, 1, 0}
};
static const symbol s_3_0[2] = { 'i', 'g' };
static const symbol s_3_1[4] = { 'l', 'i', 'c', 'h' };
static const struct among a_3[2] =
{
/* 0 */ { 2, s_3_0, -1, 1, 0},
/* 1 */ { 4, s_3_1, -1, 1, 0}
};
static const symbol s_4_0[3] = { 'e', 'n', 'd' };
static const symbol s_4_1[2] = { 'i', 'g' };
static const symbol s_4_2[3] = { 'u', 'n', 'g' };
static const symbol s_4_3[4] = { 'l', 'i', 'c', 'h' };
static const symbol s_4_4[4] = { 'i', 's', 'c', 'h' };
static const symbol s_4_5[2] = { 'i', 'k' };
static const symbol s_4_6[4] = { 'h', 'e', 'i', 't' };
static const symbol s_4_7[4] = { 'k', 'e', 'i', 't' };
static const struct among a_4[8] =
{
/* 0 */ { 3, s_4_0, -1, 1, 0},
/* 1 */ { 2, s_4_1, -1, 2, 0},
/* 2 */ { 3, s_4_2, -1, 1, 0},
/* 3 */ { 4, s_4_3, -1, 3, 0},
/* 4 */ { 4, s_4_4, -1, 2, 0},
/* 5 */ { 2, s_4_5, -1, 2, 0},
/* 6 */ { 4, s_4_6, -1, 3, 0},
/* 7 */ { 4, s_4_7, -1, 4, 0}
};
static const unsigned char g_v[] = { 17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 32, 8 };
static const unsigned char g_s_ending[] = { 117, 30, 5 };
static const unsigned char g_st_ending[] = { 117, 30, 4 };
static const symbol s_0[] = { 0xDF };
static const symbol s_1[] = { 's', 's' };
static const symbol s_2[] = { 'u' };
static const symbol s_3[] = { 'U' };
static const symbol s_4[] = { 'y' };
static const symbol s_5[] = { 'Y' };
static const symbol s_6[] = { 'y' };
static const symbol s_7[] = { 'u' };
static const symbol s_8[] = { 'a' };
static const symbol s_9[] = { 'o' };
static const symbol s_10[] = { 'u' };
static const symbol s_11[] = { 's' };
static const symbol s_12[] = { 'n', 'i', 's' };
static const symbol s_13[] = { 'i', 'g' };
static const symbol s_14[] = { 'e' };
static const symbol s_15[] = { 'e' };
static const symbol s_16[] = { 'e', 'r' };
static const symbol s_17[] = { 'e', 'n' };
static int r_prelude(struct SN_env * z) {
{ int c_test = z->c; /* test, line 35 */
while(1) { /* repeat, line 35 */
int c1 = z->c;
{ int c2 = z->c; /* or, line 38 */
z->bra = z->c; /* [, line 37 */
if (!(eq_s(z, 1, s_0))) goto lab2;
z->ket = z->c; /* ], line 37 */
{ int ret = slice_from_s(z, 2, s_1); /* <-, line 37 */
if (ret < 0) return ret;
}
goto lab1;
lab2:
z->c = c2;
if (z->c >= z->l) goto lab0;
z->c++; /* next, line 38 */
}
lab1:
continue;
lab0:
z->c = c1;
break;
}
z->c = c_test;
}
while(1) { /* repeat, line 41 */
int c3 = z->c;
while(1) { /* goto, line 41 */
int c4 = z->c;
if (in_grouping(z, g_v, 97, 252, 0)) goto lab4;
z->bra = z->c; /* [, line 42 */
{ int c5 = z->c; /* or, line 42 */
if (!(eq_s(z, 1, s_2))) goto lab6;
z->ket = z->c; /* ], line 42 */
if (in_grouping(z, g_v, 97, 252, 0)) goto lab6;
{ int ret = slice_from_s(z, 1, s_3); /* <-, line 42 */
if (ret < 0) return ret;
}
goto lab5;
lab6:
z->c = c5;
if (!(eq_s(z, 1, s_4))) goto lab4;
z->ket = z->c; /* ], line 43 */
if (in_grouping(z, g_v, 97, 252, 0)) goto lab4;
{ int ret = slice_from_s(z, 1, s_5); /* <-, line 43 */
if (ret < 0) return ret;
}
}
lab5:
z->c = c4;
break;
lab4:
z->c = c4;
if (z->c >= z->l) goto lab3;
z->c++; /* goto, line 41 */
}
continue;
lab3:
z->c = c3;
break;
}
return 1;
}
static int r_mark_regions(struct SN_env * z) {
z->I[0] = z->l;
z->I[1] = z->l;
{ int c_test = z->c; /* test, line 52 */
{ int ret = z->c + 3;
if (0 > ret || ret > z->l) return 0;
z->c = ret; /* hop, line 52 */
}
z->I[2] = z->c; /* setmark x, line 52 */
z->c = c_test;
}
{ /* gopast */ /* grouping v, line 54 */
int ret = out_grouping(z, g_v, 97, 252, 1);
if (ret < 0) return 0;
z->c += ret;
}
{ /* gopast */ /* non v, line 54 */
int ret = in_grouping(z, g_v, 97, 252, 1);
if (ret < 0) return 0;
z->c += ret;
}
z->I[0] = z->c; /* setmark p1, line 54 */
/* try, line 55 */
if (!(z->I[0] < z->I[2])) goto lab0;
z->I[0] = z->I[2];
lab0:
{ /* gopast */ /* grouping v, line 56 */
int ret = out_grouping(z, g_v, 97, 252, 1);
if (ret < 0) return 0;
z->c += ret;
}
{ /* gopast */ /* non v, line 56 */
int ret = in_grouping(z, g_v, 97, 252, 1);
if (ret < 0) return 0;
z->c += ret;
}
z->I[1] = z->c; /* setmark p2, line 56 */
return 1;
}
static int r_postlude(struct SN_env * z) {
int among_var;
while(1) { /* repeat, line 60 */
int c1 = z->c;
z->bra = z->c; /* [, line 62 */
among_var = find_among(z, a_0, 6); /* substring, line 62 */
if (!(among_var)) goto lab0;
z->ket = z->c; /* ], line 62 */
switch(among_var) {
case 0: goto lab0;
case 1:
{ int ret = slice_from_s(z, 1, s_6); /* <-, line 63 */
if (ret < 0) return ret;
}
break;
case 2:
{ int ret = slice_from_s(z, 1, s_7); /* <-, line 64 */
if (ret < 0) return ret;
}
break;
case 3:
{ int ret = slice_from_s(z, 1, s_8); /* <-, line 65 */
if (ret < 0) return ret;
}
break;
case 4:
{ int ret = slice_from_s(z, 1, s_9); /* <-, line 66 */
if (ret < 0) return ret;
}
break;
case 5:
{ int ret = slice_from_s(z, 1, s_10); /* <-, line 67 */
if (ret < 0) return ret;
}
break;
case 6:
if (z->c >= z->l) goto lab0;
z->c++; /* next, line 68 */
break;
}
continue;
lab0:
z->c = c1;
break;
}
return 1;
}
static int r_R1(struct SN_env * z) {
if (!(z->I[0] <= z->c)) return 0;
return 1;
}
static int r_R2(struct SN_env * z) {
if (!(z->I[1] <= z->c)) return 0;
return 1;
}
static int r_standard_suffix(struct SN_env * z) {
int among_var;
{ int m1 = z->l - z->c; (void)m1; /* do, line 79 */
z->ket = z->c; /* [, line 80 */
if (z->c <= z->lb || z->p[z->c - 1] >> 5 != 3 || !((811040 >> (z->p[z->c - 1] & 0x1f)) & 1)) goto lab0;
among_var = find_among_b(z, a_1, 7); /* substring, line 80 */
if (!(among_var)) goto lab0;
z->bra = z->c; /* ], line 80 */
{ int ret = r_R1(z);
if (ret == 0) goto lab0; /* call R1, line 80 */
if (ret < 0) return ret;
}
switch(among_var) {
case 0: goto lab0;
case 1:
{ int ret = slice_del(z); /* delete, line 82 */
if (ret < 0) return ret;
}
break;
case 2:
{ int ret = slice_del(z); /* delete, line 85 */
if (ret < 0) return ret;
}
{ int m_keep = z->l - z->c;/* (void) m_keep;*/ /* try, line 86 */
z->ket = z->c; /* [, line 86 */
if (!(eq_s_b(z, 1, s_11))) { z->c = z->l - m_keep; goto lab1; }
z->bra = z->c; /* ], line 86 */
if (!(eq_s_b(z, 3, s_12))) { z->c = z->l - m_keep; goto lab1; }
{ int ret = slice_del(z); /* delete, line 86 */
if (ret < 0) return ret;
}
lab1:
;
}
break;
case 3:
if (in_grouping_b(z, g_s_ending, 98, 116, 0)) goto lab0;
{ int ret = slice_del(z); /* delete, line 89 */
if (ret < 0) return ret;
}
break;
}
lab0:
z->c = z->l - m1;
}
{ int m2 = z->l - z->c; (void)m2; /* do, line 93 */
z->ket = z->c; /* [, line 94 */
if (z->c - 1 <= z->lb || z->p[z->c - 1] >> 5 != 3 || !((1327104 >> (z->p[z->c - 1] & 0x1f)) & 1)) goto lab2;
among_var = find_among_b(z, a_2, 4); /* substring, line 94 */
if (!(among_var)) goto lab2;
z->bra = z->c; /* ], line 94 */
{ int ret = r_R1(z);
if (ret == 0) goto lab2; /* call R1, line 94 */
if (ret < 0) return ret;
}
switch(among_var) {
case 0: goto lab2;
case 1:
{ int ret = slice_del(z); /* delete, line 96 */
if (ret < 0) return ret;
}
break;
case 2:
if (in_grouping_b(z, g_st_ending, 98, 116, 0)) goto lab2;
{ int ret = z->c - 3;
if (z->lb > ret || ret > z->l) goto lab2;
z->c = ret; /* hop, line 99 */
}
{ int ret = slice_del(z); /* delete, line 99 */
if (ret < 0) return ret;
}
break;
}
lab2:
z->c = z->l - m2;
}
{ int m3 = z->l - z->c; (void)m3; /* do, line 103 */
z->ket = z->c; /* [, line 104 */
if (z->c - 1 <= z->lb || z->p[z->c - 1] >> 5 != 3 || !((1051024 >> (z->p[z->c - 1] & 0x1f)) & 1)) goto lab3;
among_var = find_among_b(z, a_4, 8); /* substring, line 104 */
if (!(among_var)) goto lab3;
z->bra = z->c; /* ], line 104 */
{ int ret = r_R2(z);
if (ret == 0) goto lab3; /* call R2, line 104 */
if (ret < 0) return ret;
}
switch(among_var) {
case 0: goto lab3;
case 1:
{ int ret = slice_del(z); /* delete, line 106 */
if (ret < 0) return ret;
}
{ int m_keep = z->l - z->c;/* (void) m_keep;*/ /* try, line 107 */
z->ket = z->c; /* [, line 107 */
if (!(eq_s_b(z, 2, s_13))) { z->c = z->l - m_keep; goto lab4; }
z->bra = z->c; /* ], line 107 */
{ int m4 = z->l - z->c; (void)m4; /* not, line 107 */
if (!(eq_s_b(z, 1, s_14))) goto lab5;
{ z->c = z->l - m_keep; goto lab4; }
lab5:
z->c = z->l - m4;
}
{ int ret = r_R2(z);
if (ret == 0) { z->c = z->l - m_keep; goto lab4; } /* call R2, line 107 */
if (ret < 0) return ret;
}
{ int ret = slice_del(z); /* delete, line 107 */
if (ret < 0) return ret;
}
lab4:
;
}
break;
case 2:
{ int m5 = z->l - z->c; (void)m5; /* not, line 110 */
if (!(eq_s_b(z, 1, s_15))) goto lab6;
goto lab3;
lab6:
z->c = z->l - m5;
}
{ int ret = slice_del(z); /* delete, line 110 */
if (ret < 0) return ret;
}
break;
case 3:
{ int ret = slice_del(z); /* delete, line 113 */
if (ret < 0) return ret;
}
{ int m_keep = z->l - z->c;/* (void) m_keep;*/ /* try, line 114 */
z->ket = z->c; /* [, line 115 */
{ int m6 = z->l - z->c; (void)m6; /* or, line 115 */
if (!(eq_s_b(z, 2, s_16))) goto lab9;
goto lab8;
lab9:
z->c = z->l - m6;
if (!(eq_s_b(z, 2, s_17))) { z->c = z->l - m_keep; goto lab7; }
}
lab8:
z->bra = z->c; /* ], line 115 */
{ int ret = r_R1(z);
if (ret == 0) { z->c = z->l - m_keep; goto lab7; } /* call R1, line 115 */
if (ret < 0) return ret;
}
{ int ret = slice_del(z); /* delete, line 115 */
if (ret < 0) return ret;
}
lab7:
;
}
break;
case 4:
{ int ret = slice_del(z); /* delete, line 119 */
if (ret < 0) return ret;
}
{ int m_keep = z->l - z->c;/* (void) m_keep;*/ /* try, line 120 */
z->ket = z->c; /* [, line 121 */
if (z->c - 1 <= z->lb || (z->p[z->c - 1] != 103 && z->p[z->c - 1] != 104)) { z->c = z->l - m_keep; goto lab10; }
among_var = find_among_b(z, a_3, 2); /* substring, line 121 */
if (!(among_var)) { z->c = z->l - m_keep; goto lab10; }
z->bra = z->c; /* ], line 121 */
{ int ret = r_R2(z);
if (ret == 0) { z->c = z->l - m_keep; goto lab10; } /* call R2, line 121 */
if (ret < 0) return ret;
}
switch(among_var) {
case 0: { z->c = z->l - m_keep; goto lab10; }
case 1:
{ int ret = slice_del(z); /* delete, line 123 */
if (ret < 0) return ret;
}
break;
}
lab10:
;
}
break;
}
lab3:
z->c = z->l - m3;
}
return 1;
}
extern int german_ISO_8859_1_stem(struct SN_env * z) {
{ int c1 = z->c; /* do, line 134 */
{ int ret = r_prelude(z);
if (ret == 0) goto lab0; /* call prelude, line 134 */
if (ret < 0) return ret;
}
lab0:
z->c = c1;
}
{ int c2 = z->c; /* do, line 135 */
{ int ret = r_mark_regions(z);
if (ret == 0) goto lab1; /* call mark_regions, line 135 */
if (ret < 0) return ret;
}
lab1:
z->c = c2;
}
z->lb = z->c; z->c = z->l; /* backwards, line 136 */
{ int m3 = z->l - z->c; (void)m3; /* do, line 137 */
{ int ret = r_standard_suffix(z);
if (ret == 0) goto lab2; /* call standard_suffix, line 137 */
if (ret < 0) return ret;
}
lab2:
z->c = z->l - m3;
}
z->c = z->lb;
{ int c4 = z->c; /* do, line 138 */
{ int ret = r_postlude(z);
if (ret == 0) goto lab3; /* call postlude, line 138 */
if (ret < 0) return ret;
}
lab3:
z->c = c4;
}
return 1;
}
extern struct SN_env * german_ISO_8859_1_create_env(void) { return SN_create_env(0, 3, 0); }
extern void german_ISO_8859_1_close_env(struct SN_env * z) { SN_close_env(z, 0); }

View file

@ -1,16 +0,0 @@
/* This file was generated automatically by the Snowball to ANSI C compiler */
#ifdef __cplusplus
extern "C" {
#endif
extern struct SN_env * german_ISO_8859_1_create_env(void);
extern void german_ISO_8859_1_close_env(struct SN_env * z);
extern int german_ISO_8859_1_stem(struct SN_env * z);
#ifdef __cplusplus
}
#endif

View file

@ -1,16 +0,0 @@
/* This file was generated automatically by the Snowball to ANSI C compiler */
#ifdef __cplusplus
extern "C" {
#endif
extern struct SN_env * hungarian_ISO_8859_1_create_env(void);
extern void hungarian_ISO_8859_1_close_env(struct SN_env * z);
extern int hungarian_ISO_8859_1_stem(struct SN_env * z);
#ifdef __cplusplus
}
#endif

View file

@ -1,16 +0,0 @@
/* This file was generated automatically by the Snowball to ANSI C compiler */
#ifdef __cplusplus
extern "C" {
#endif
extern struct SN_env * italian_ISO_8859_1_create_env(void);
extern void italian_ISO_8859_1_close_env(struct SN_env * z);
extern int italian_ISO_8859_1_stem(struct SN_env * z);
#ifdef __cplusplus
}
#endif

View file

@ -1,297 +0,0 @@
/* This file was generated automatically by the Snowball to ANSI C compiler */
#include "../runtime/header.h"
#ifdef __cplusplus
extern "C" {
#endif
extern int norwegian_ISO_8859_1_stem(struct SN_env * z);
#ifdef __cplusplus
}
#endif
static int r_other_suffix(struct SN_env * z);
static int r_consonant_pair(struct SN_env * z);
static int r_main_suffix(struct SN_env * z);
static int r_mark_regions(struct SN_env * z);
#ifdef __cplusplus
extern "C" {
#endif
extern struct SN_env * norwegian_ISO_8859_1_create_env(void);
extern void norwegian_ISO_8859_1_close_env(struct SN_env * z);
#ifdef __cplusplus
}
#endif
static const symbol s_0_0[1] = { 'a' };
static const symbol s_0_1[1] = { 'e' };
static const symbol s_0_2[3] = { 'e', 'd', 'e' };
static const symbol s_0_3[4] = { 'a', 'n', 'd', 'e' };
static const symbol s_0_4[4] = { 'e', 'n', 'd', 'e' };
static const symbol s_0_5[3] = { 'a', 'n', 'e' };
static const symbol s_0_6[3] = { 'e', 'n', 'e' };
static const symbol s_0_7[6] = { 'h', 'e', 't', 'e', 'n', 'e' };
static const symbol s_0_8[4] = { 'e', 'r', 't', 'e' };
static const symbol s_0_9[2] = { 'e', 'n' };
static const symbol s_0_10[5] = { 'h', 'e', 't', 'e', 'n' };
static const symbol s_0_11[2] = { 'a', 'r' };
static const symbol s_0_12[2] = { 'e', 'r' };
static const symbol s_0_13[5] = { 'h', 'e', 't', 'e', 'r' };
static const symbol s_0_14[1] = { 's' };
static const symbol s_0_15[2] = { 'a', 's' };
static const symbol s_0_16[2] = { 'e', 's' };
static const symbol s_0_17[4] = { 'e', 'd', 'e', 's' };
static const symbol s_0_18[5] = { 'e', 'n', 'd', 'e', 's' };
static const symbol s_0_19[4] = { 'e', 'n', 'e', 's' };
static const symbol s_0_20[7] = { 'h', 'e', 't', 'e', 'n', 'e', 's' };
static const symbol s_0_21[3] = { 'e', 'n', 's' };
static const symbol s_0_22[6] = { 'h', 'e', 't', 'e', 'n', 's' };
static const symbol s_0_23[3] = { 'e', 'r', 's' };
static const symbol s_0_24[3] = { 'e', 't', 's' };
static const symbol s_0_25[2] = { 'e', 't' };
static const symbol s_0_26[3] = { 'h', 'e', 't' };
static const symbol s_0_27[3] = { 'e', 'r', 't' };
static const symbol s_0_28[3] = { 'a', 's', 't' };
static const struct among a_0[29] =
{
/* 0 */ { 1, s_0_0, -1, 1, 0},
/* 1 */ { 1, s_0_1, -1, 1, 0},
/* 2 */ { 3, s_0_2, 1, 1, 0},
/* 3 */ { 4, s_0_3, 1, 1, 0},
/* 4 */ { 4, s_0_4, 1, 1, 0},
/* 5 */ { 3, s_0_5, 1, 1, 0},
/* 6 */ { 3, s_0_6, 1, 1, 0},
/* 7 */ { 6, s_0_7, 6, 1, 0},
/* 8 */ { 4, s_0_8, 1, 3, 0},
/* 9 */ { 2, s_0_9, -1, 1, 0},
/* 10 */ { 5, s_0_10, 9, 1, 0},
/* 11 */ { 2, s_0_11, -1, 1, 0},
/* 12 */ { 2, s_0_12, -1, 1, 0},
/* 13 */ { 5, s_0_13, 12, 1, 0},
/* 14 */ { 1, s_0_14, -1, 2, 0},
/* 15 */ { 2, s_0_15, 14, 1, 0},
/* 16 */ { 2, s_0_16, 14, 1, 0},
/* 17 */ { 4, s_0_17, 16, 1, 0},
/* 18 */ { 5, s_0_18, 16, 1, 0},
/* 19 */ { 4, s_0_19, 16, 1, 0},
/* 20 */ { 7, s_0_20, 19, 1, 0},
/* 21 */ { 3, s_0_21, 14, 1, 0},
/* 22 */ { 6, s_0_22, 21, 1, 0},
/* 23 */ { 3, s_0_23, 14, 1, 0},
/* 24 */ { 3, s_0_24, 14, 1, 0},
/* 25 */ { 2, s_0_25, -1, 1, 0},
/* 26 */ { 3, s_0_26, 25, 1, 0},
/* 27 */ { 3, s_0_27, -1, 3, 0},
/* 28 */ { 3, s_0_28, -1, 1, 0}
};
static const symbol s_1_0[2] = { 'd', 't' };
static const symbol s_1_1[2] = { 'v', 't' };
static const struct among a_1[2] =
{
/* 0 */ { 2, s_1_0, -1, -1, 0},
/* 1 */ { 2, s_1_1, -1, -1, 0}
};
static const symbol s_2_0[3] = { 'l', 'e', 'g' };
static const symbol s_2_1[4] = { 'e', 'l', 'e', 'g' };
static const symbol s_2_2[2] = { 'i', 'g' };
static const symbol s_2_3[3] = { 'e', 'i', 'g' };
static const symbol s_2_4[3] = { 'l', 'i', 'g' };
static const symbol s_2_5[4] = { 'e', 'l', 'i', 'g' };
static const symbol s_2_6[3] = { 'e', 'l', 's' };
static const symbol s_2_7[3] = { 'l', 'o', 'v' };
static const symbol s_2_8[4] = { 'e', 'l', 'o', 'v' };
static const symbol s_2_9[4] = { 's', 'l', 'o', 'v' };
static const symbol s_2_10[7] = { 'h', 'e', 't', 's', 'l', 'o', 'v' };
static const struct among a_2[11] =
{
/* 0 */ { 3, s_2_0, -1, 1, 0},
/* 1 */ { 4, s_2_1, 0, 1, 0},
/* 2 */ { 2, s_2_2, -1, 1, 0},
/* 3 */ { 3, s_2_3, 2, 1, 0},
/* 4 */ { 3, s_2_4, 2, 1, 0},
/* 5 */ { 4, s_2_5, 4, 1, 0},
/* 6 */ { 3, s_2_6, -1, 1, 0},
/* 7 */ { 3, s_2_7, -1, 1, 0},
/* 8 */ { 4, s_2_8, 7, 1, 0},
/* 9 */ { 4, s_2_9, 7, 1, 0},
/* 10 */ { 7, s_2_10, 9, 1, 0}
};
static const unsigned char g_v[] = { 17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 0, 128 };
static const unsigned char g_s_ending[] = { 119, 125, 149, 1 };
static const symbol s_0[] = { 'k' };
static const symbol s_1[] = { 'e', 'r' };
static int r_mark_regions(struct SN_env * z) {
z->I[0] = z->l;
{ int c_test = z->c; /* test, line 30 */
{ int ret = z->c + 3;
if (0 > ret || ret > z->l) return 0;
z->c = ret; /* hop, line 30 */
}
z->I[1] = z->c; /* setmark x, line 30 */
z->c = c_test;
}
if (out_grouping(z, g_v, 97, 248, 1) < 0) return 0; /* goto */ /* grouping v, line 31 */
{ /* gopast */ /* non v, line 31 */
int ret = in_grouping(z, g_v, 97, 248, 1);
if (ret < 0) return 0;
z->c += ret;
}
z->I[0] = z->c; /* setmark p1, line 31 */
/* try, line 32 */
if (!(z->I[0] < z->I[1])) goto lab0;
z->I[0] = z->I[1];
lab0:
return 1;
}
static int r_main_suffix(struct SN_env * z) {
int among_var;
{ int mlimit; /* setlimit, line 38 */
int m1 = z->l - z->c; (void)m1;
if (z->c < z->I[0]) return 0;
z->c = z->I[0]; /* tomark, line 38 */
mlimit = z->lb; z->lb = z->c;
z->c = z->l - m1;
z->ket = z->c; /* [, line 38 */
if (z->c <= z->lb || z->p[z->c - 1] >> 5 != 3 || !((1851426 >> (z->p[z->c - 1] & 0x1f)) & 1)) { z->lb = mlimit; return 0; }
among_var = find_among_b(z, a_0, 29); /* substring, line 38 */
if (!(among_var)) { z->lb = mlimit; return 0; }
z->bra = z->c; /* ], line 38 */
z->lb = mlimit;
}
switch(among_var) {
case 0: return 0;
case 1:
{ int ret = slice_del(z); /* delete, line 44 */
if (ret < 0) return ret;
}
break;
case 2:
{ int m2 = z->l - z->c; (void)m2; /* or, line 46 */
if (in_grouping_b(z, g_s_ending, 98, 122, 0)) goto lab1;
goto lab0;
lab1:
z->c = z->l - m2;
if (!(eq_s_b(z, 1, s_0))) return 0;
if (out_grouping_b(z, g_v, 97, 248, 0)) return 0;
}
lab0:
{ int ret = slice_del(z); /* delete, line 46 */
if (ret < 0) return ret;
}
break;
case 3:
{ int ret = slice_from_s(z, 2, s_1); /* <-, line 48 */
if (ret < 0) return ret;
}
break;
}
return 1;
}
static int r_consonant_pair(struct SN_env * z) {
{ int m_test = z->l - z->c; /* test, line 53 */
{ int mlimit; /* setlimit, line 54 */
int m1 = z->l - z->c; (void)m1;
if (z->c < z->I[0]) return 0;
z->c = z->I[0]; /* tomark, line 54 */
mlimit = z->lb; z->lb = z->c;
z->c = z->l - m1;
z->ket = z->c; /* [, line 54 */
if (z->c - 1 <= z->lb || z->p[z->c - 1] != 116) { z->lb = mlimit; return 0; }
if (!(find_among_b(z, a_1, 2))) { z->lb = mlimit; return 0; } /* substring, line 54 */
z->bra = z->c; /* ], line 54 */
z->lb = mlimit;
}
z->c = z->l - m_test;
}
if (z->c <= z->lb) return 0;
z->c--; /* next, line 59 */
z->bra = z->c; /* ], line 59 */
{ int ret = slice_del(z); /* delete, line 59 */
if (ret < 0) return ret;
}
return 1;
}
static int r_other_suffix(struct SN_env * z) {
int among_var;
{ int mlimit; /* setlimit, line 63 */
int m1 = z->l - z->c; (void)m1;
if (z->c < z->I[0]) return 0;
z->c = z->I[0]; /* tomark, line 63 */
mlimit = z->lb; z->lb = z->c;
z->c = z->l - m1;
z->ket = z->c; /* [, line 63 */
if (z->c - 1 <= z->lb || z->p[z->c - 1] >> 5 != 3 || !((4718720 >> (z->p[z->c - 1] & 0x1f)) & 1)) { z->lb = mlimit; return 0; }
among_var = find_among_b(z, a_2, 11); /* substring, line 63 */
if (!(among_var)) { z->lb = mlimit; return 0; }
z->bra = z->c; /* ], line 63 */
z->lb = mlimit;
}
switch(among_var) {
case 0: return 0;
case 1:
{ int ret = slice_del(z); /* delete, line 67 */
if (ret < 0) return ret;
}
break;
}
return 1;
}
extern int norwegian_ISO_8859_1_stem(struct SN_env * z) {
{ int c1 = z->c; /* do, line 74 */
{ int ret = r_mark_regions(z);
if (ret == 0) goto lab0; /* call mark_regions, line 74 */
if (ret < 0) return ret;
}
lab0:
z->c = c1;
}
z->lb = z->c; z->c = z->l; /* backwards, line 75 */
{ int m2 = z->l - z->c; (void)m2; /* do, line 76 */
{ int ret = r_main_suffix(z);
if (ret == 0) goto lab1; /* call main_suffix, line 76 */
if (ret < 0) return ret;
}
lab1:
z->c = z->l - m2;
}
{ int m3 = z->l - z->c; (void)m3; /* do, line 77 */
{ int ret = r_consonant_pair(z);
if (ret == 0) goto lab2; /* call consonant_pair, line 77 */
if (ret < 0) return ret;
}
lab2:
z->c = z->l - m3;
}
{ int m4 = z->l - z->c; (void)m4; /* do, line 78 */
{ int ret = r_other_suffix(z);
if (ret == 0) goto lab3; /* call other_suffix, line 78 */
if (ret < 0) return ret;
}
lab3:
z->c = z->l - m4;
}
z->c = z->lb;
return 1;
}
extern struct SN_env * norwegian_ISO_8859_1_create_env(void) { return SN_create_env(0, 2, 0); }
extern void norwegian_ISO_8859_1_close_env(struct SN_env * z) { SN_close_env(z, 0); }

View file

@ -1,16 +0,0 @@
/* This file was generated automatically by the Snowball to ANSI C compiler */
#ifdef __cplusplus
extern "C" {
#endif
extern struct SN_env * norwegian_ISO_8859_1_create_env(void);
extern void norwegian_ISO_8859_1_close_env(struct SN_env * z);
extern int norwegian_ISO_8859_1_stem(struct SN_env * z);
#ifdef __cplusplus
}
#endif

View file

@ -1,749 +0,0 @@
/* This file was generated automatically by the Snowball to ANSI C compiler */
#include "../runtime/header.h"
#ifdef __cplusplus
extern "C" {
#endif
extern int porter_ISO_8859_1_stem(struct SN_env * z);
#ifdef __cplusplus
}
#endif
static int r_Step_5b(struct SN_env * z);
static int r_Step_5a(struct SN_env * z);
static int r_Step_4(struct SN_env * z);
static int r_Step_3(struct SN_env * z);
static int r_Step_2(struct SN_env * z);
static int r_Step_1c(struct SN_env * z);
static int r_Step_1b(struct SN_env * z);
static int r_Step_1a(struct SN_env * z);
static int r_R2(struct SN_env * z);
static int r_R1(struct SN_env * z);
static int r_shortv(struct SN_env * z);
#ifdef __cplusplus
extern "C" {
#endif
extern struct SN_env * porter_ISO_8859_1_create_env(void);
extern void porter_ISO_8859_1_close_env(struct SN_env * z);
#ifdef __cplusplus
}
#endif
static const symbol s_0_0[1] = { 's' };
static const symbol s_0_1[3] = { 'i', 'e', 's' };
static const symbol s_0_2[4] = { 's', 's', 'e', 's' };
static const symbol s_0_3[2] = { 's', 's' };
static const struct among a_0[4] =
{
/* 0 */ { 1, s_0_0, -1, 3, 0},
/* 1 */ { 3, s_0_1, 0, 2, 0},
/* 2 */ { 4, s_0_2, 0, 1, 0},
/* 3 */ { 2, s_0_3, 0, -1, 0}
};
static const symbol s_1_1[2] = { 'b', 'b' };
static const symbol s_1_2[2] = { 'd', 'd' };
static const symbol s_1_3[2] = { 'f', 'f' };
static const symbol s_1_4[2] = { 'g', 'g' };
static const symbol s_1_5[2] = { 'b', 'l' };
static const symbol s_1_6[2] = { 'm', 'm' };
static const symbol s_1_7[2] = { 'n', 'n' };
static const symbol s_1_8[2] = { 'p', 'p' };
static const symbol s_1_9[2] = { 'r', 'r' };
static const symbol s_1_10[2] = { 'a', 't' };
static const symbol s_1_11[2] = { 't', 't' };
static const symbol s_1_12[2] = { 'i', 'z' };
static const struct among a_1[13] =
{
/* 0 */ { 0, 0, -1, 3, 0},
/* 1 */ { 2, s_1_1, 0, 2, 0},
/* 2 */ { 2, s_1_2, 0, 2, 0},
/* 3 */ { 2, s_1_3, 0, 2, 0},
/* 4 */ { 2, s_1_4, 0, 2, 0},
/* 5 */ { 2, s_1_5, 0, 1, 0},
/* 6 */ { 2, s_1_6, 0, 2, 0},
/* 7 */ { 2, s_1_7, 0, 2, 0},
/* 8 */ { 2, s_1_8, 0, 2, 0},
/* 9 */ { 2, s_1_9, 0, 2, 0},
/* 10 */ { 2, s_1_10, 0, 1, 0},
/* 11 */ { 2, s_1_11, 0, 2, 0},
/* 12 */ { 2, s_1_12, 0, 1, 0}
};
static const symbol s_2_0[2] = { 'e', 'd' };
static const symbol s_2_1[3] = { 'e', 'e', 'd' };
static const symbol s_2_2[3] = { 'i', 'n', 'g' };
static const struct among a_2[3] =
{
/* 0 */ { 2, s_2_0, -1, 2, 0},
/* 1 */ { 3, s_2_1, 0, 1, 0},
/* 2 */ { 3, s_2_2, -1, 2, 0}
};
static const symbol s_3_0[4] = { 'a', 'n', 'c', 'i' };
static const symbol s_3_1[4] = { 'e', 'n', 'c', 'i' };
static const symbol s_3_2[4] = { 'a', 'b', 'l', 'i' };
static const symbol s_3_3[3] = { 'e', 'l', 'i' };
static const symbol s_3_4[4] = { 'a', 'l', 'l', 'i' };
static const symbol s_3_5[5] = { 'o', 'u', 's', 'l', 'i' };
static const symbol s_3_6[5] = { 'e', 'n', 't', 'l', 'i' };
static const symbol s_3_7[5] = { 'a', 'l', 'i', 't', 'i' };
static const symbol s_3_8[6] = { 'b', 'i', 'l', 'i', 't', 'i' };
static const symbol s_3_9[5] = { 'i', 'v', 'i', 't', 'i' };
static const symbol s_3_10[6] = { 't', 'i', 'o', 'n', 'a', 'l' };
static const symbol s_3_11[7] = { 'a', 't', 'i', 'o', 'n', 'a', 'l' };
static const symbol s_3_12[5] = { 'a', 'l', 'i', 's', 'm' };
static const symbol s_3_13[5] = { 'a', 't', 'i', 'o', 'n' };
static const symbol s_3_14[7] = { 'i', 'z', 'a', 't', 'i', 'o', 'n' };
static const symbol s_3_15[4] = { 'i', 'z', 'e', 'r' };
static const symbol s_3_16[4] = { 'a', 't', 'o', 'r' };
static const symbol s_3_17[7] = { 'i', 'v', 'e', 'n', 'e', 's', 's' };
static const symbol s_3_18[7] = { 'f', 'u', 'l', 'n', 'e', 's', 's' };
static const symbol s_3_19[7] = { 'o', 'u', 's', 'n', 'e', 's', 's' };
static const struct among a_3[20] =
{
/* 0 */ { 4, s_3_0, -1, 3, 0},
/* 1 */ { 4, s_3_1, -1, 2, 0},
/* 2 */ { 4, s_3_2, -1, 4, 0},
/* 3 */ { 3, s_3_3, -1, 6, 0},
/* 4 */ { 4, s_3_4, -1, 9, 0},
/* 5 */ { 5, s_3_5, -1, 12, 0},
/* 6 */ { 5, s_3_6, -1, 5, 0},
/* 7 */ { 5, s_3_7, -1, 10, 0},
/* 8 */ { 6, s_3_8, -1, 14, 0},
/* 9 */ { 5, s_3_9, -1, 13, 0},
/* 10 */ { 6, s_3_10, -1, 1, 0},
/* 11 */ { 7, s_3_11, 10, 8, 0},
/* 12 */ { 5, s_3_12, -1, 10, 0},
/* 13 */ { 5, s_3_13, -1, 8, 0},
/* 14 */ { 7, s_3_14, 13, 7, 0},
/* 15 */ { 4, s_3_15, -1, 7, 0},
/* 16 */ { 4, s_3_16, -1, 8, 0},
/* 17 */ { 7, s_3_17, -1, 13, 0},
/* 18 */ { 7, s_3_18, -1, 11, 0},
/* 19 */ { 7, s_3_19, -1, 12, 0}
};
static const symbol s_4_0[5] = { 'i', 'c', 'a', 't', 'e' };
static const symbol s_4_1[5] = { 'a', 't', 'i', 'v', 'e' };
static const symbol s_4_2[5] = { 'a', 'l', 'i', 'z', 'e' };
static const symbol s_4_3[5] = { 'i', 'c', 'i', 't', 'i' };
static const symbol s_4_4[4] = { 'i', 'c', 'a', 'l' };
static const symbol s_4_5[3] = { 'f', 'u', 'l' };
static const symbol s_4_6[4] = { 'n', 'e', 's', 's' };
static const struct among a_4[7] =
{
/* 0 */ { 5, s_4_0, -1, 2, 0},
/* 1 */ { 5, s_4_1, -1, 3, 0},
/* 2 */ { 5, s_4_2, -1, 1, 0},
/* 3 */ { 5, s_4_3, -1, 2, 0},
/* 4 */ { 4, s_4_4, -1, 2, 0},
/* 5 */ { 3, s_4_5, -1, 3, 0},
/* 6 */ { 4, s_4_6, -1, 3, 0}
};
static const symbol s_5_0[2] = { 'i', 'c' };
static const symbol s_5_1[4] = { 'a', 'n', 'c', 'e' };
static const symbol s_5_2[4] = { 'e', 'n', 'c', 'e' };
static const symbol s_5_3[4] = { 'a', 'b', 'l', 'e' };
static const symbol s_5_4[4] = { 'i', 'b', 'l', 'e' };
static const symbol s_5_5[3] = { 'a', 't', 'e' };
static const symbol s_5_6[3] = { 'i', 'v', 'e' };
static const symbol s_5_7[3] = { 'i', 'z', 'e' };
static const symbol s_5_8[3] = { 'i', 't', 'i' };
static const symbol s_5_9[2] = { 'a', 'l' };
static const symbol s_5_10[3] = { 'i', 's', 'm' };
static const symbol s_5_11[3] = { 'i', 'o', 'n' };
static const symbol s_5_12[2] = { 'e', 'r' };
static const symbol s_5_13[3] = { 'o', 'u', 's' };
static const symbol s_5_14[3] = { 'a', 'n', 't' };
static const symbol s_5_15[3] = { 'e', 'n', 't' };
static const symbol s_5_16[4] = { 'm', 'e', 'n', 't' };
static const symbol s_5_17[5] = { 'e', 'm', 'e', 'n', 't' };
static const symbol s_5_18[2] = { 'o', 'u' };
static const struct among a_5[19] =
{
/* 0 */ { 2, s_5_0, -1, 1, 0},
/* 1 */ { 4, s_5_1, -1, 1, 0},
/* 2 */ { 4, s_5_2, -1, 1, 0},
/* 3 */ { 4, s_5_3, -1, 1, 0},
/* 4 */ { 4, s_5_4, -1, 1, 0},
/* 5 */ { 3, s_5_5, -1, 1, 0},
/* 6 */ { 3, s_5_6, -1, 1, 0},
/* 7 */ { 3, s_5_7, -1, 1, 0},
/* 8 */ { 3, s_5_8, -1, 1, 0},
/* 9 */ { 2, s_5_9, -1, 1, 0},
/* 10 */ { 3, s_5_10, -1, 1, 0},
/* 11 */ { 3, s_5_11, -1, 2, 0},
/* 12 */ { 2, s_5_12, -1, 1, 0},
/* 13 */ { 3, s_5_13, -1, 1, 0},
/* 14 */ { 3, s_5_14, -1, 1, 0},
/* 15 */ { 3, s_5_15, -1, 1, 0},
/* 16 */ { 4, s_5_16, 15, 1, 0},
/* 17 */ { 5, s_5_17, 16, 1, 0},
/* 18 */ { 2, s_5_18, -1, 1, 0}
};
static const unsigned char g_v[] = { 17, 65, 16, 1 };
static const unsigned char g_v_WXY[] = { 1, 17, 65, 208, 1 };
static const symbol s_0[] = { 's', 's' };
static const symbol s_1[] = { 'i' };
static const symbol s_2[] = { 'e', 'e' };
static const symbol s_3[] = { 'e' };
static const symbol s_4[] = { 'e' };
static const symbol s_5[] = { 'y' };
static const symbol s_6[] = { 'Y' };
static const symbol s_7[] = { 'i' };
static const symbol s_8[] = { 't', 'i', 'o', 'n' };
static const symbol s_9[] = { 'e', 'n', 'c', 'e' };
static const symbol s_10[] = { 'a', 'n', 'c', 'e' };
static const symbol s_11[] = { 'a', 'b', 'l', 'e' };
static const symbol s_12[] = { 'e', 'n', 't' };
static const symbol s_13[] = { 'e' };
static const symbol s_14[] = { 'i', 'z', 'e' };
static const symbol s_15[] = { 'a', 't', 'e' };
static const symbol s_16[] = { 'a', 'l' };
static const symbol s_17[] = { 'a', 'l' };
static const symbol s_18[] = { 'f', 'u', 'l' };
static const symbol s_19[] = { 'o', 'u', 's' };
static const symbol s_20[] = { 'i', 'v', 'e' };
static const symbol s_21[] = { 'b', 'l', 'e' };
static const symbol s_22[] = { 'a', 'l' };
static const symbol s_23[] = { 'i', 'c' };
static const symbol s_24[] = { 's' };
static const symbol s_25[] = { 't' };
static const symbol s_26[] = { 'e' };
static const symbol s_27[] = { 'l' };
static const symbol s_28[] = { 'l' };
static const symbol s_29[] = { 'y' };
static const symbol s_30[] = { 'Y' };
static const symbol s_31[] = { 'y' };
static const symbol s_32[] = { 'Y' };
static const symbol s_33[] = { 'Y' };
static const symbol s_34[] = { 'y' };
static int r_shortv(struct SN_env * z) {
if (out_grouping_b(z, g_v_WXY, 89, 121, 0)) return 0;
if (in_grouping_b(z, g_v, 97, 121, 0)) return 0;
if (out_grouping_b(z, g_v, 97, 121, 0)) return 0;
return 1;
}
static int r_R1(struct SN_env * z) {
if (!(z->I[0] <= z->c)) return 0;
return 1;
}
static int r_R2(struct SN_env * z) {
if (!(z->I[1] <= z->c)) return 0;
return 1;
}
static int r_Step_1a(struct SN_env * z) {
int among_var;
z->ket = z->c; /* [, line 25 */
if (z->c <= z->lb || z->p[z->c - 1] != 115) return 0;
among_var = find_among_b(z, a_0, 4); /* substring, line 25 */
if (!(among_var)) return 0;
z->bra = z->c; /* ], line 25 */
switch(among_var) {
case 0: return 0;
case 1:
{ int ret = slice_from_s(z, 2, s_0); /* <-, line 26 */
if (ret < 0) return ret;
}
break;
case 2:
{ int ret = slice_from_s(z, 1, s_1); /* <-, line 27 */
if (ret < 0) return ret;
}
break;
case 3:
{ int ret = slice_del(z); /* delete, line 29 */
if (ret < 0) return ret;
}
break;
}
return 1;
}
static int r_Step_1b(struct SN_env * z) {
int among_var;
z->ket = z->c; /* [, line 34 */
if (z->c - 1 <= z->lb || (z->p[z->c - 1] != 100 && z->p[z->c - 1] != 103)) return 0;
among_var = find_among_b(z, a_2, 3); /* substring, line 34 */
if (!(among_var)) return 0;
z->bra = z->c; /* ], line 34 */
switch(among_var) {
case 0: return 0;
case 1:
{ int ret = r_R1(z);
if (ret == 0) return 0; /* call R1, line 35 */
if (ret < 0) return ret;
}
{ int ret = slice_from_s(z, 2, s_2); /* <-, line 35 */
if (ret < 0) return ret;
}
break;
case 2:
{ int m_test = z->l - z->c; /* test, line 38 */
{ /* gopast */ /* grouping v, line 38 */
int ret = out_grouping_b(z, g_v, 97, 121, 1);
if (ret < 0) return 0;
z->c -= ret;
}
z->c = z->l - m_test;
}
{ int ret = slice_del(z); /* delete, line 38 */
if (ret < 0) return ret;
}
{ int m_test = z->l - z->c; /* test, line 39 */
if (z->c - 1 <= z->lb || z->p[z->c - 1] >> 5 != 3 || !((68514004 >> (z->p[z->c - 1] & 0x1f)) & 1)) among_var = 3; else
among_var = find_among_b(z, a_1, 13); /* substring, line 39 */
if (!(among_var)) return 0;
z->c = z->l - m_test;
}
switch(among_var) {
case 0: return 0;
case 1:
{ int c_keep = z->c;
int ret = insert_s(z, z->c, z->c, 1, s_3); /* <+, line 41 */
z->c = c_keep;
if (ret < 0) return ret;
}
break;
case 2:
z->ket = z->c; /* [, line 44 */
if (z->c <= z->lb) return 0;
z->c--; /* next, line 44 */
z->bra = z->c; /* ], line 44 */
{ int ret = slice_del(z); /* delete, line 44 */
if (ret < 0) return ret;
}
break;
case 3:
if (z->c != z->I[0]) return 0; /* atmark, line 45 */
{ int m_test = z->l - z->c; /* test, line 45 */
{ int ret = r_shortv(z);
if (ret == 0) return 0; /* call shortv, line 45 */
if (ret < 0) return ret;
}
z->c = z->l - m_test;
}
{ int c_keep = z->c;
int ret = insert_s(z, z->c, z->c, 1, s_4); /* <+, line 45 */
z->c = c_keep;
if (ret < 0) return ret;
}
break;
}
break;
}
return 1;
}
static int r_Step_1c(struct SN_env * z) {
z->ket = z->c; /* [, line 52 */
{ int m1 = z->l - z->c; (void)m1; /* or, line 52 */
if (!(eq_s_b(z, 1, s_5))) goto lab1;
goto lab0;
lab1:
z->c = z->l - m1;
if (!(eq_s_b(z, 1, s_6))) return 0;
}
lab0:
z->bra = z->c; /* ], line 52 */
{ /* gopast */ /* grouping v, line 53 */
int ret = out_grouping_b(z, g_v, 97, 121, 1);
if (ret < 0) return 0;
z->c -= ret;
}
{ int ret = slice_from_s(z, 1, s_7); /* <-, line 54 */
if (ret < 0) return ret;
}
return 1;
}
static int r_Step_2(struct SN_env * z) {
int among_var;
z->ket = z->c; /* [, line 58 */
if (z->c - 2 <= z->lb || z->p[z->c - 1] >> 5 != 3 || !((815616 >> (z->p[z->c - 1] & 0x1f)) & 1)) return 0;
among_var = find_among_b(z, a_3, 20); /* substring, line 58 */
if (!(among_var)) return 0;
z->bra = z->c; /* ], line 58 */
{ int ret = r_R1(z);
if (ret == 0) return 0; /* call R1, line 58 */
if (ret < 0) return ret;
}
switch(among_var) {
case 0: return 0;
case 1:
{ int ret = slice_from_s(z, 4, s_8); /* <-, line 59 */
if (ret < 0) return ret;
}
break;
case 2:
{ int ret = slice_from_s(z, 4, s_9); /* <-, line 60 */
if (ret < 0) return ret;
}
break;
case 3:
{ int ret = slice_from_s(z, 4, s_10); /* <-, line 61 */
if (ret < 0) return ret;
}
break;
case 4:
{ int ret = slice_from_s(z, 4, s_11); /* <-, line 62 */
if (ret < 0) return ret;
}
break;
case 5:
{ int ret = slice_from_s(z, 3, s_12); /* <-, line 63 */
if (ret < 0) return ret;
}
break;
case 6:
{ int ret = slice_from_s(z, 1, s_13); /* <-, line 64 */
if (ret < 0) return ret;
}
break;
case 7:
{ int ret = slice_from_s(z, 3, s_14); /* <-, line 66 */
if (ret < 0) return ret;
}
break;
case 8:
{ int ret = slice_from_s(z, 3, s_15); /* <-, line 68 */
if (ret < 0) return ret;
}
break;
case 9:
{ int ret = slice_from_s(z, 2, s_16); /* <-, line 69 */
if (ret < 0) return ret;
}
break;
case 10:
{ int ret = slice_from_s(z, 2, s_17); /* <-, line 71 */
if (ret < 0) return ret;
}
break;
case 11:
{ int ret = slice_from_s(z, 3, s_18); /* <-, line 72 */
if (ret < 0) return ret;
}
break;
case 12:
{ int ret = slice_from_s(z, 3, s_19); /* <-, line 74 */
if (ret < 0) return ret;
}
break;
case 13:
{ int ret = slice_from_s(z, 3, s_20); /* <-, line 76 */
if (ret < 0) return ret;
}
break;
case 14:
{ int ret = slice_from_s(z, 3, s_21); /* <-, line 77 */
if (ret < 0) return ret;
}
break;
}
return 1;
}
static int r_Step_3(struct SN_env * z) {
int among_var;
z->ket = z->c; /* [, line 82 */
if (z->c - 2 <= z->lb || z->p[z->c - 1] >> 5 != 3 || !((528928 >> (z->p[z->c - 1] & 0x1f)) & 1)) return 0;
among_var = find_among_b(z, a_4, 7); /* substring, line 82 */
if (!(among_var)) return 0;
z->bra = z->c; /* ], line 82 */
{ int ret = r_R1(z);
if (ret == 0) return 0; /* call R1, line 82 */
if (ret < 0) return ret;
}
switch(among_var) {
case 0: return 0;
case 1:
{ int ret = slice_from_s(z, 2, s_22); /* <-, line 83 */
if (ret < 0) return ret;
}
break;
case 2:
{ int ret = slice_from_s(z, 2, s_23); /* <-, line 85 */
if (ret < 0) return ret;
}
break;
case 3:
{ int ret = slice_del(z); /* delete, line 87 */
if (ret < 0) return ret;
}
break;
}
return 1;
}
static int r_Step_4(struct SN_env * z) {
int among_var;
z->ket = z->c; /* [, line 92 */
if (z->c - 1 <= z->lb || z->p[z->c - 1] >> 5 != 3 || !((3961384 >> (z->p[z->c - 1] & 0x1f)) & 1)) return 0;
among_var = find_among_b(z, a_5, 19); /* substring, line 92 */
if (!(among_var)) return 0;
z->bra = z->c; /* ], line 92 */
{ int ret = r_R2(z);
if (ret == 0) return 0; /* call R2, line 92 */
if (ret < 0) return ret;
}
switch(among_var) {
case 0: return 0;
case 1:
{ int ret = slice_del(z); /* delete, line 95 */
if (ret < 0) return ret;
}
break;
case 2:
{ int m1 = z->l - z->c; (void)m1; /* or, line 96 */
if (!(eq_s_b(z, 1, s_24))) goto lab1;
goto lab0;
lab1:
z->c = z->l - m1;
if (!(eq_s_b(z, 1, s_25))) return 0;
}
lab0:
{ int ret = slice_del(z); /* delete, line 96 */
if (ret < 0) return ret;
}
break;
}
return 1;
}
static int r_Step_5a(struct SN_env * z) {
z->ket = z->c; /* [, line 101 */
if (!(eq_s_b(z, 1, s_26))) return 0;
z->bra = z->c; /* ], line 101 */
{ int m1 = z->l - z->c; (void)m1; /* or, line 102 */
{ int ret = r_R2(z);
if (ret == 0) goto lab1; /* call R2, line 102 */
if (ret < 0) return ret;
}
goto lab0;
lab1:
z->c = z->l - m1;
{ int ret = r_R1(z);
if (ret == 0) return 0; /* call R1, line 102 */
if (ret < 0) return ret;
}
{ int m2 = z->l - z->c; (void)m2; /* not, line 102 */
{ int ret = r_shortv(z);
if (ret == 0) goto lab2; /* call shortv, line 102 */
if (ret < 0) return ret;
}
return 0;
lab2:
z->c = z->l - m2;
}
}
lab0:
{ int ret = slice_del(z); /* delete, line 103 */
if (ret < 0) return ret;
}
return 1;
}
static int r_Step_5b(struct SN_env * z) {
z->ket = z->c; /* [, line 107 */
if (!(eq_s_b(z, 1, s_27))) return 0;
z->bra = z->c; /* ], line 107 */
{ int ret = r_R2(z);
if (ret == 0) return 0; /* call R2, line 108 */
if (ret < 0) return ret;
}
if (!(eq_s_b(z, 1, s_28))) return 0;
{ int ret = slice_del(z); /* delete, line 109 */
if (ret < 0) return ret;
}
return 1;
}
extern int porter_ISO_8859_1_stem(struct SN_env * z) {
z->B[0] = 0; /* unset Y_found, line 115 */
{ int c1 = z->c; /* do, line 116 */
z->bra = z->c; /* [, line 116 */
if (!(eq_s(z, 1, s_29))) goto lab0;
z->ket = z->c; /* ], line 116 */
{ int ret = slice_from_s(z, 1, s_30); /* <-, line 116 */
if (ret < 0) return ret;
}
z->B[0] = 1; /* set Y_found, line 116 */
lab0:
z->c = c1;
}
{ int c2 = z->c; /* do, line 117 */
while(1) { /* repeat, line 117 */
int c3 = z->c;
while(1) { /* goto, line 117 */
int c4 = z->c;
if (in_grouping(z, g_v, 97, 121, 0)) goto lab3;
z->bra = z->c; /* [, line 117 */
if (!(eq_s(z, 1, s_31))) goto lab3;
z->ket = z->c; /* ], line 117 */
z->c = c4;
break;
lab3:
z->c = c4;
if (z->c >= z->l) goto lab2;
z->c++; /* goto, line 117 */
}
{ int ret = slice_from_s(z, 1, s_32); /* <-, line 117 */
if (ret < 0) return ret;
}
z->B[0] = 1; /* set Y_found, line 117 */
continue;
lab2:
z->c = c3;
break;
}
z->c = c2;
}
z->I[0] = z->l;
z->I[1] = z->l;
{ int c5 = z->c; /* do, line 121 */
{ /* gopast */ /* grouping v, line 122 */
int ret = out_grouping(z, g_v, 97, 121, 1);
if (ret < 0) goto lab4;
z->c += ret;
}
{ /* gopast */ /* non v, line 122 */
int ret = in_grouping(z, g_v, 97, 121, 1);
if (ret < 0) goto lab4;
z->c += ret;
}
z->I[0] = z->c; /* setmark p1, line 122 */
{ /* gopast */ /* grouping v, line 123 */
int ret = out_grouping(z, g_v, 97, 121, 1);
if (ret < 0) goto lab4;
z->c += ret;
}
{ /* gopast */ /* non v, line 123 */
int ret = in_grouping(z, g_v, 97, 121, 1);
if (ret < 0) goto lab4;
z->c += ret;
}
z->I[1] = z->c; /* setmark p2, line 123 */
lab4:
z->c = c5;
}
z->lb = z->c; z->c = z->l; /* backwards, line 126 */
{ int m6 = z->l - z->c; (void)m6; /* do, line 127 */
{ int ret = r_Step_1a(z);
if (ret == 0) goto lab5; /* call Step_1a, line 127 */
if (ret < 0) return ret;
}
lab5:
z->c = z->l - m6;
}
{ int m7 = z->l - z->c; (void)m7; /* do, line 128 */
{ int ret = r_Step_1b(z);
if (ret == 0) goto lab6; /* call Step_1b, line 128 */
if (ret < 0) return ret;
}
lab6:
z->c = z->l - m7;
}
{ int m8 = z->l - z->c; (void)m8; /* do, line 129 */
{ int ret = r_Step_1c(z);
if (ret == 0) goto lab7; /* call Step_1c, line 129 */
if (ret < 0) return ret;
}
lab7:
z->c = z->l - m8;
}
{ int m9 = z->l - z->c; (void)m9; /* do, line 130 */
{ int ret = r_Step_2(z);
if (ret == 0) goto lab8; /* call Step_2, line 130 */
if (ret < 0) return ret;
}
lab8:
z->c = z->l - m9;
}
{ int m10 = z->l - z->c; (void)m10; /* do, line 131 */
{ int ret = r_Step_3(z);
if (ret == 0) goto lab9; /* call Step_3, line 131 */
if (ret < 0) return ret;
}
lab9:
z->c = z->l - m10;
}
{ int m11 = z->l - z->c; (void)m11; /* do, line 132 */
{ int ret = r_Step_4(z);
if (ret == 0) goto lab10; /* call Step_4, line 132 */
if (ret < 0) return ret;
}
lab10:
z->c = z->l - m11;
}
{ int m12 = z->l - z->c; (void)m12; /* do, line 133 */
{ int ret = r_Step_5a(z);
if (ret == 0) goto lab11; /* call Step_5a, line 133 */
if (ret < 0) return ret;
}
lab11:
z->c = z->l - m12;
}
{ int m13 = z->l - z->c; (void)m13; /* do, line 134 */
{ int ret = r_Step_5b(z);
if (ret == 0) goto lab12; /* call Step_5b, line 134 */
if (ret < 0) return ret;
}
lab12:
z->c = z->l - m13;
}
z->c = z->lb;
{ int c14 = z->c; /* do, line 137 */
if (!(z->B[0])) goto lab13; /* Boolean test Y_found, line 137 */
while(1) { /* repeat, line 137 */
int c15 = z->c;
while(1) { /* goto, line 137 */
int c16 = z->c;
z->bra = z->c; /* [, line 137 */
if (!(eq_s(z, 1, s_33))) goto lab15;
z->ket = z->c; /* ], line 137 */
z->c = c16;
break;
lab15:
z->c = c16;
if (z->c >= z->l) goto lab14;
z->c++; /* goto, line 137 */
}
{ int ret = slice_from_s(z, 1, s_34); /* <-, line 137 */
if (ret < 0) return ret;
}
continue;
lab14:
z->c = c15;
break;
}
lab13:
z->c = c14;
}
return 1;
}
extern struct SN_env * porter_ISO_8859_1_create_env(void) { return SN_create_env(0, 2, 1); }
extern void porter_ISO_8859_1_close_env(struct SN_env * z) { SN_close_env(z, 0); }

View file

@ -1,16 +0,0 @@
/* This file was generated automatically by the Snowball to ANSI C compiler */
#ifdef __cplusplus
extern "C" {
#endif
extern struct SN_env * porter_ISO_8859_1_create_env(void);
extern void porter_ISO_8859_1_close_env(struct SN_env * z);
extern int porter_ISO_8859_1_stem(struct SN_env * z);
#ifdef __cplusplus
}
#endif

View file

@ -1,16 +0,0 @@
/* This file was generated automatically by the Snowball to ANSI C compiler */
#ifdef __cplusplus
extern "C" {
#endif
extern struct SN_env * portuguese_ISO_8859_1_create_env(void);
extern void portuguese_ISO_8859_1_close_env(struct SN_env * z);
extern int portuguese_ISO_8859_1_stem(struct SN_env * z);
#ifdef __cplusplus
}
#endif

View file

@ -1,16 +0,0 @@
/* This file was generated automatically by the Snowball to ANSI C compiler */
#ifdef __cplusplus
extern "C" {
#endif
extern struct SN_env * spanish_ISO_8859_1_create_env(void);
extern void spanish_ISO_8859_1_close_env(struct SN_env * z);
extern int spanish_ISO_8859_1_stem(struct SN_env * z);
#ifdef __cplusplus
}
#endif

View file

@ -1,307 +0,0 @@
/* This file was generated automatically by the Snowball to ANSI C compiler */
#include "../runtime/header.h"
#ifdef __cplusplus
extern "C" {
#endif
extern int swedish_ISO_8859_1_stem(struct SN_env * z);
#ifdef __cplusplus
}
#endif
static int r_other_suffix(struct SN_env * z);
static int r_consonant_pair(struct SN_env * z);
static int r_main_suffix(struct SN_env * z);
static int r_mark_regions(struct SN_env * z);
#ifdef __cplusplus
extern "C" {
#endif
extern struct SN_env * swedish_ISO_8859_1_create_env(void);
extern void swedish_ISO_8859_1_close_env(struct SN_env * z);
#ifdef __cplusplus
}
#endif
static const symbol s_0_0[1] = { 'a' };
static const symbol s_0_1[4] = { 'a', 'r', 'n', 'a' };
static const symbol s_0_2[4] = { 'e', 'r', 'n', 'a' };
static const symbol s_0_3[7] = { 'h', 'e', 't', 'e', 'r', 'n', 'a' };
static const symbol s_0_4[4] = { 'o', 'r', 'n', 'a' };
static const symbol s_0_5[2] = { 'a', 'd' };
static const symbol s_0_6[1] = { 'e' };
static const symbol s_0_7[3] = { 'a', 'd', 'e' };
static const symbol s_0_8[4] = { 'a', 'n', 'd', 'e' };
static const symbol s_0_9[4] = { 'a', 'r', 'n', 'e' };
static const symbol s_0_10[3] = { 'a', 'r', 'e' };
static const symbol s_0_11[4] = { 'a', 's', 't', 'e' };
static const symbol s_0_12[2] = { 'e', 'n' };
static const symbol s_0_13[5] = { 'a', 'n', 'd', 'e', 'n' };
static const symbol s_0_14[4] = { 'a', 'r', 'e', 'n' };
static const symbol s_0_15[5] = { 'h', 'e', 't', 'e', 'n' };
static const symbol s_0_16[3] = { 'e', 'r', 'n' };
static const symbol s_0_17[2] = { 'a', 'r' };
static const symbol s_0_18[2] = { 'e', 'r' };
static const symbol s_0_19[5] = { 'h', 'e', 't', 'e', 'r' };
static const symbol s_0_20[2] = { 'o', 'r' };
static const symbol s_0_21[1] = { 's' };
static const symbol s_0_22[2] = { 'a', 's' };
static const symbol s_0_23[5] = { 'a', 'r', 'n', 'a', 's' };
static const symbol s_0_24[5] = { 'e', 'r', 'n', 'a', 's' };
static const symbol s_0_25[5] = { 'o', 'r', 'n', 'a', 's' };
static const symbol s_0_26[2] = { 'e', 's' };
static const symbol s_0_27[4] = { 'a', 'd', 'e', 's' };
static const symbol s_0_28[5] = { 'a', 'n', 'd', 'e', 's' };
static const symbol s_0_29[3] = { 'e', 'n', 's' };
static const symbol s_0_30[5] = { 'a', 'r', 'e', 'n', 's' };
static const symbol s_0_31[6] = { 'h', 'e', 't', 'e', 'n', 's' };
static const symbol s_0_32[4] = { 'e', 'r', 'n', 's' };
static const symbol s_0_33[2] = { 'a', 't' };
static const symbol s_0_34[5] = { 'a', 'n', 'd', 'e', 't' };
static const symbol s_0_35[3] = { 'h', 'e', 't' };
static const symbol s_0_36[3] = { 'a', 's', 't' };
static const struct among a_0[37] =
{
/* 0 */ { 1, s_0_0, -1, 1, 0},
/* 1 */ { 4, s_0_1, 0, 1, 0},
/* 2 */ { 4, s_0_2, 0, 1, 0},
/* 3 */ { 7, s_0_3, 2, 1, 0},
/* 4 */ { 4, s_0_4, 0, 1, 0},
/* 5 */ { 2, s_0_5, -1, 1, 0},
/* 6 */ { 1, s_0_6, -1, 1, 0},
/* 7 */ { 3, s_0_7, 6, 1, 0},
/* 8 */ { 4, s_0_8, 6, 1, 0},
/* 9 */ { 4, s_0_9, 6, 1, 0},
/* 10 */ { 3, s_0_10, 6, 1, 0},
/* 11 */ { 4, s_0_11, 6, 1, 0},
/* 12 */ { 2, s_0_12, -1, 1, 0},
/* 13 */ { 5, s_0_13, 12, 1, 0},
/* 14 */ { 4, s_0_14, 12, 1, 0},
/* 15 */ { 5, s_0_15, 12, 1, 0},
/* 16 */ { 3, s_0_16, -1, 1, 0},
/* 17 */ { 2, s_0_17, -1, 1, 0},
/* 18 */ { 2, s_0_18, -1, 1, 0},
/* 19 */ { 5, s_0_19, 18, 1, 0},
/* 20 */ { 2, s_0_20, -1, 1, 0},
/* 21 */ { 1, s_0_21, -1, 2, 0},
/* 22 */ { 2, s_0_22, 21, 1, 0},
/* 23 */ { 5, s_0_23, 22, 1, 0},
/* 24 */ { 5, s_0_24, 22, 1, 0},
/* 25 */ { 5, s_0_25, 22, 1, 0},
/* 26 */ { 2, s_0_26, 21, 1, 0},
/* 27 */ { 4, s_0_27, 26, 1, 0},
/* 28 */ { 5, s_0_28, 26, 1, 0},
/* 29 */ { 3, s_0_29, 21, 1, 0},
/* 30 */ { 5, s_0_30, 29, 1, 0},
/* 31 */ { 6, s_0_31, 29, 1, 0},
/* 32 */ { 4, s_0_32, 21, 1, 0},
/* 33 */ { 2, s_0_33, -1, 1, 0},
/* 34 */ { 5, s_0_34, -1, 1, 0},
/* 35 */ { 3, s_0_35, -1, 1, 0},
/* 36 */ { 3, s_0_36, -1, 1, 0}
};
static const symbol s_1_0[2] = { 'd', 'd' };
static const symbol s_1_1[2] = { 'g', 'd' };
static const symbol s_1_2[2] = { 'n', 'n' };
static const symbol s_1_3[2] = { 'd', 't' };
static const symbol s_1_4[2] = { 'g', 't' };
static const symbol s_1_5[2] = { 'k', 't' };
static const symbol s_1_6[2] = { 't', 't' };
static const struct among a_1[7] =
{
/* 0 */ { 2, s_1_0, -1, -1, 0},
/* 1 */ { 2, s_1_1, -1, -1, 0},
/* 2 */ { 2, s_1_2, -1, -1, 0},
/* 3 */ { 2, s_1_3, -1, -1, 0},
/* 4 */ { 2, s_1_4, -1, -1, 0},
/* 5 */ { 2, s_1_5, -1, -1, 0},
/* 6 */ { 2, s_1_6, -1, -1, 0}
};
static const symbol s_2_0[2] = { 'i', 'g' };
static const symbol s_2_1[3] = { 'l', 'i', 'g' };
static const symbol s_2_2[3] = { 'e', 'l', 's' };
static const symbol s_2_3[5] = { 'f', 'u', 'l', 'l', 't' };
static const symbol s_2_4[4] = { 'l', 0xF6, 's', 't' };
static const struct among a_2[5] =
{
/* 0 */ { 2, s_2_0, -1, 1, 0},
/* 1 */ { 3, s_2_1, 0, 1, 0},
/* 2 */ { 3, s_2_2, -1, 1, 0},
/* 3 */ { 5, s_2_3, -1, 3, 0},
/* 4 */ { 4, s_2_4, -1, 2, 0}
};
static const unsigned char g_v[] = { 17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 0, 32 };
static const unsigned char g_s_ending[] = { 119, 127, 149 };
static const symbol s_0[] = { 'l', 0xF6, 's' };
static const symbol s_1[] = { 'f', 'u', 'l', 'l' };
static int r_mark_regions(struct SN_env * z) {
z->I[0] = z->l;
{ int c_test = z->c; /* test, line 29 */
{ int ret = z->c + 3;
if (0 > ret || ret > z->l) return 0;
z->c = ret; /* hop, line 29 */
}
z->I[1] = z->c; /* setmark x, line 29 */
z->c = c_test;
}
if (out_grouping(z, g_v, 97, 246, 1) < 0) return 0; /* goto */ /* grouping v, line 30 */
{ /* gopast */ /* non v, line 30 */
int ret = in_grouping(z, g_v, 97, 246, 1);
if (ret < 0) return 0;
z->c += ret;
}
z->I[0] = z->c; /* setmark p1, line 30 */
/* try, line 31 */
if (!(z->I[0] < z->I[1])) goto lab0;
z->I[0] = z->I[1];
lab0:
return 1;
}
static int r_main_suffix(struct SN_env * z) {
int among_var;
{ int mlimit; /* setlimit, line 37 */
int m1 = z->l - z->c; (void)m1;
if (z->c < z->I[0]) return 0;
z->c = z->I[0]; /* tomark, line 37 */
mlimit = z->lb; z->lb = z->c;
z->c = z->l - m1;
z->ket = z->c; /* [, line 37 */
if (z->c <= z->lb || z->p[z->c - 1] >> 5 != 3 || !((1851442 >> (z->p[z->c - 1] & 0x1f)) & 1)) { z->lb = mlimit; return 0; }
among_var = find_among_b(z, a_0, 37); /* substring, line 37 */
if (!(among_var)) { z->lb = mlimit; return 0; }
z->bra = z->c; /* ], line 37 */
z->lb = mlimit;
}
switch(among_var) {
case 0: return 0;
case 1:
{ int ret = slice_del(z); /* delete, line 44 */
if (ret < 0) return ret;
}
break;
case 2:
if (in_grouping_b(z, g_s_ending, 98, 121, 0)) return 0;
{ int ret = slice_del(z); /* delete, line 46 */
if (ret < 0) return ret;
}
break;
}
return 1;
}
static int r_consonant_pair(struct SN_env * z) {
{ int mlimit; /* setlimit, line 50 */
int m1 = z->l - z->c; (void)m1;
if (z->c < z->I[0]) return 0;
z->c = z->I[0]; /* tomark, line 50 */
mlimit = z->lb; z->lb = z->c;
z->c = z->l - m1;
{ int m2 = z->l - z->c; (void)m2; /* and, line 52 */
if (z->c - 1 <= z->lb || z->p[z->c - 1] >> 5 != 3 || !((1064976 >> (z->p[z->c - 1] & 0x1f)) & 1)) { z->lb = mlimit; return 0; }
if (!(find_among_b(z, a_1, 7))) { z->lb = mlimit; return 0; } /* among, line 51 */
z->c = z->l - m2;
z->ket = z->c; /* [, line 52 */
if (z->c <= z->lb) { z->lb = mlimit; return 0; }
z->c--; /* next, line 52 */
z->bra = z->c; /* ], line 52 */
{ int ret = slice_del(z); /* delete, line 52 */
if (ret < 0) return ret;
}
}
z->lb = mlimit;
}
return 1;
}
static int r_other_suffix(struct SN_env * z) {
int among_var;
{ int mlimit; /* setlimit, line 55 */
int m1 = z->l - z->c; (void)m1;
if (z->c < z->I[0]) return 0;
z->c = z->I[0]; /* tomark, line 55 */
mlimit = z->lb; z->lb = z->c;
z->c = z->l - m1;
z->ket = z->c; /* [, line 56 */
if (z->c - 1 <= z->lb || z->p[z->c - 1] >> 5 != 3 || !((1572992 >> (z->p[z->c - 1] & 0x1f)) & 1)) { z->lb = mlimit; return 0; }
among_var = find_among_b(z, a_2, 5); /* substring, line 56 */
if (!(among_var)) { z->lb = mlimit; return 0; }
z->bra = z->c; /* ], line 56 */
switch(among_var) {
case 0: { z->lb = mlimit; return 0; }
case 1:
{ int ret = slice_del(z); /* delete, line 57 */
if (ret < 0) return ret;
}
break;
case 2:
{ int ret = slice_from_s(z, 3, s_0); /* <-, line 58 */
if (ret < 0) return ret;
}
break;
case 3:
{ int ret = slice_from_s(z, 4, s_1); /* <-, line 59 */
if (ret < 0) return ret;
}
break;
}
z->lb = mlimit;
}
return 1;
}
extern int swedish_ISO_8859_1_stem(struct SN_env * z) {
{ int c1 = z->c; /* do, line 66 */
{ int ret = r_mark_regions(z);
if (ret == 0) goto lab0; /* call mark_regions, line 66 */
if (ret < 0) return ret;
}
lab0:
z->c = c1;
}
z->lb = z->c; z->c = z->l; /* backwards, line 67 */
{ int m2 = z->l - z->c; (void)m2; /* do, line 68 */
{ int ret = r_main_suffix(z);
if (ret == 0) goto lab1; /* call main_suffix, line 68 */
if (ret < 0) return ret;
}
lab1:
z->c = z->l - m2;
}
{ int m3 = z->l - z->c; (void)m3; /* do, line 69 */
{ int ret = r_consonant_pair(z);
if (ret == 0) goto lab2; /* call consonant_pair, line 69 */
if (ret < 0) return ret;
}
lab2:
z->c = z->l - m3;
}
{ int m4 = z->l - z->c; (void)m4; /* do, line 70 */
{ int ret = r_other_suffix(z);
if (ret == 0) goto lab3; /* call other_suffix, line 70 */
if (ret < 0) return ret;
}
lab3:
z->c = z->l - m4;
}
z->c = z->lb;
return 1;
}
extern struct SN_env * swedish_ISO_8859_1_create_env(void) { return SN_create_env(0, 2, 0); }
extern void swedish_ISO_8859_1_close_env(struct SN_env * z) { SN_close_env(z, 0); }

View file

@ -1,16 +0,0 @@
/* This file was generated automatically by the Snowball to ANSI C compiler */
#ifdef __cplusplus
extern "C" {
#endif
extern struct SN_env * swedish_ISO_8859_1_create_env(void);
extern void swedish_ISO_8859_1_close_env(struct SN_env * z);
extern int swedish_ISO_8859_1_stem(struct SN_env * z);
#ifdef __cplusplus
}
#endif

View file

@ -1,998 +0,0 @@
/* This file was generated automatically by the Snowball to ANSI C compiler */
#include "../runtime/header.h"
#ifdef __cplusplus
extern "C" {
#endif
extern int romanian_ISO_8859_2_stem(struct SN_env * z);
#ifdef __cplusplus
}
#endif
static int r_vowel_suffix(struct SN_env * z);
static int r_verb_suffix(struct SN_env * z);
static int r_combo_suffix(struct SN_env * z);
static int r_standard_suffix(struct SN_env * z);
static int r_step_0(struct SN_env * z);
static int r_R2(struct SN_env * z);
static int r_R1(struct SN_env * z);
static int r_RV(struct SN_env * z);
static int r_mark_regions(struct SN_env * z);
static int r_postlude(struct SN_env * z);
static int r_prelude(struct SN_env * z);
#ifdef __cplusplus
extern "C" {
#endif
extern struct SN_env * romanian_ISO_8859_2_create_env(void);
extern void romanian_ISO_8859_2_close_env(struct SN_env * z);
#ifdef __cplusplus
}
#endif
static const symbol s_0_1[1] = { 'I' };
static const symbol s_0_2[1] = { 'U' };
static const struct among a_0[3] =
{
/* 0 */ { 0, 0, -1, 3, 0},
/* 1 */ { 1, s_0_1, 0, 1, 0},
/* 2 */ { 1, s_0_2, 0, 2, 0}
};
static const symbol s_1_0[2] = { 'e', 'a' };
static const symbol s_1_1[4] = { 'a', 0xFE, 'i', 'a' };
static const symbol s_1_2[3] = { 'a', 'u', 'a' };
static const symbol s_1_3[3] = { 'i', 'u', 'a' };
static const symbol s_1_4[4] = { 'a', 0xFE, 'i', 'e' };
static const symbol s_1_5[3] = { 'e', 'l', 'e' };
static const symbol s_1_6[3] = { 'i', 'l', 'e' };
static const symbol s_1_7[4] = { 'i', 'i', 'l', 'e' };
static const symbol s_1_8[3] = { 'i', 'e', 'i' };
static const symbol s_1_9[4] = { 'a', 't', 'e', 'i' };
static const symbol s_1_10[2] = { 'i', 'i' };
static const symbol s_1_11[4] = { 'u', 'l', 'u', 'i' };
static const symbol s_1_12[2] = { 'u', 'l' };
static const symbol s_1_13[4] = { 'e', 'l', 'o', 'r' };
static const symbol s_1_14[4] = { 'i', 'l', 'o', 'r' };
static const symbol s_1_15[5] = { 'i', 'i', 'l', 'o', 'r' };
static const struct among a_1[16] =
{
/* 0 */ { 2, s_1_0, -1, 3, 0},
/* 1 */ { 4, s_1_1, -1, 7, 0},
/* 2 */ { 3, s_1_2, -1, 2, 0},
/* 3 */ { 3, s_1_3, -1, 4, 0},
/* 4 */ { 4, s_1_4, -1, 7, 0},
/* 5 */ { 3, s_1_5, -1, 3, 0},
/* 6 */ { 3, s_1_6, -1, 5, 0},
/* 7 */ { 4, s_1_7, 6, 4, 0},
/* 8 */ { 3, s_1_8, -1, 4, 0},
/* 9 */ { 4, s_1_9, -1, 6, 0},
/* 10 */ { 2, s_1_10, -1, 4, 0},
/* 11 */ { 4, s_1_11, -1, 1, 0},
/* 12 */ { 2, s_1_12, -1, 1, 0},
/* 13 */ { 4, s_1_13, -1, 3, 0},
/* 14 */ { 4, s_1_14, -1, 4, 0},
/* 15 */ { 5, s_1_15, 14, 4, 0}
};
static const symbol s_2_0[5] = { 'i', 'c', 'a', 'l', 'a' };
static const symbol s_2_1[5] = { 'i', 'c', 'i', 'v', 'a' };
static const symbol s_2_2[5] = { 'a', 't', 'i', 'v', 'a' };
static const symbol s_2_3[5] = { 'i', 't', 'i', 'v', 'a' };
static const symbol s_2_4[5] = { 'i', 'c', 'a', 'l', 'e' };
static const symbol s_2_5[6] = { 'a', 0xFE, 'i', 'u', 'n', 'e' };
static const symbol s_2_6[6] = { 'i', 0xFE, 'i', 'u', 'n', 'e' };
static const symbol s_2_7[6] = { 'a', 't', 'o', 'a', 'r', 'e' };
static const symbol s_2_8[6] = { 'i', 't', 'o', 'a', 'r', 'e' };
static const symbol s_2_9[6] = { 0xE3, 't', 'o', 'a', 'r', 'e' };
static const symbol s_2_10[7] = { 'i', 'c', 'i', 't', 'a', 't', 'e' };
static const symbol s_2_11[9] = { 'a', 'b', 'i', 'l', 'i', 't', 'a', 't', 'e' };
static const symbol s_2_12[9] = { 'i', 'b', 'i', 'l', 'i', 't', 'a', 't', 'e' };
static const symbol s_2_13[7] = { 'i', 'v', 'i', 't', 'a', 't', 'e' };
static const symbol s_2_14[5] = { 'i', 'c', 'i', 'v', 'e' };
static const symbol s_2_15[5] = { 'a', 't', 'i', 'v', 'e' };
static const symbol s_2_16[5] = { 'i', 't', 'i', 'v', 'e' };
static const symbol s_2_17[5] = { 'i', 'c', 'a', 'l', 'i' };
static const symbol s_2_18[5] = { 'a', 't', 'o', 'r', 'i' };
static const symbol s_2_19[7] = { 'i', 'c', 'a', 't', 'o', 'r', 'i' };
static const symbol s_2_20[5] = { 'i', 't', 'o', 'r', 'i' };
static const symbol s_2_21[5] = { 0xE3, 't', 'o', 'r', 'i' };
static const symbol s_2_22[7] = { 'i', 'c', 'i', 't', 'a', 't', 'i' };
static const symbol s_2_23[9] = { 'a', 'b', 'i', 'l', 'i', 't', 'a', 't', 'i' };
static const symbol s_2_24[7] = { 'i', 'v', 'i', 't', 'a', 't', 'i' };
static const symbol s_2_25[5] = { 'i', 'c', 'i', 'v', 'i' };
static const symbol s_2_26[5] = { 'a', 't', 'i', 'v', 'i' };
static const symbol s_2_27[5] = { 'i', 't', 'i', 'v', 'i' };
static const symbol s_2_28[6] = { 'i', 'c', 'i', 't', 0xE3, 'i' };
static const symbol s_2_29[8] = { 'a', 'b', 'i', 'l', 'i', 't', 0xE3, 'i' };
static const symbol s_2_30[6] = { 'i', 'v', 'i', 't', 0xE3, 'i' };
static const symbol s_2_31[7] = { 'i', 'c', 'i', 't', 0xE3, 0xFE, 'i' };
static const symbol s_2_32[9] = { 'a', 'b', 'i', 'l', 'i', 't', 0xE3, 0xFE, 'i' };
static const symbol s_2_33[7] = { 'i', 'v', 'i', 't', 0xE3, 0xFE, 'i' };
static const symbol s_2_34[4] = { 'i', 'c', 'a', 'l' };
static const symbol s_2_35[4] = { 'a', 't', 'o', 'r' };
static const symbol s_2_36[6] = { 'i', 'c', 'a', 't', 'o', 'r' };
static const symbol s_2_37[4] = { 'i', 't', 'o', 'r' };
static const symbol s_2_38[4] = { 0xE3, 't', 'o', 'r' };
static const symbol s_2_39[4] = { 'i', 'c', 'i', 'v' };
static const symbol s_2_40[4] = { 'a', 't', 'i', 'v' };
static const symbol s_2_41[4] = { 'i', 't', 'i', 'v' };
static const symbol s_2_42[5] = { 'i', 'c', 'a', 'l', 0xE3 };
static const symbol s_2_43[5] = { 'i', 'c', 'i', 'v', 0xE3 };
static const symbol s_2_44[5] = { 'a', 't', 'i', 'v', 0xE3 };
static const symbol s_2_45[5] = { 'i', 't', 'i', 'v', 0xE3 };
static const struct among a_2[46] =
{
/* 0 */ { 5, s_2_0, -1, 4, 0},
/* 1 */ { 5, s_2_1, -1, 4, 0},
/* 2 */ { 5, s_2_2, -1, 5, 0},
/* 3 */ { 5, s_2_3, -1, 6, 0},
/* 4 */ { 5, s_2_4, -1, 4, 0},
/* 5 */ { 6, s_2_5, -1, 5, 0},
/* 6 */ { 6, s_2_6, -1, 6, 0},
/* 7 */ { 6, s_2_7, -1, 5, 0},
/* 8 */ { 6, s_2_8, -1, 6, 0},
/* 9 */ { 6, s_2_9, -1, 5, 0},
/* 10 */ { 7, s_2_10, -1, 4, 0},
/* 11 */ { 9, s_2_11, -1, 1, 0},
/* 12 */ { 9, s_2_12, -1, 2, 0},
/* 13 */ { 7, s_2_13, -1, 3, 0},
/* 14 */ { 5, s_2_14, -1, 4, 0},
/* 15 */ { 5, s_2_15, -1, 5, 0},
/* 16 */ { 5, s_2_16, -1, 6, 0},
/* 17 */ { 5, s_2_17, -1, 4, 0},
/* 18 */ { 5, s_2_18, -1, 5, 0},
/* 19 */ { 7, s_2_19, 18, 4, 0},
/* 20 */ { 5, s_2_20, -1, 6, 0},
/* 21 */ { 5, s_2_21, -1, 5, 0},
/* 22 */ { 7, s_2_22, -1, 4, 0},
/* 23 */ { 9, s_2_23, -1, 1, 0},
/* 24 */ { 7, s_2_24, -1, 3, 0},
/* 25 */ { 5, s_2_25, -1, 4, 0},
/* 26 */ { 5, s_2_26, -1, 5, 0},
/* 27 */ { 5, s_2_27, -1, 6, 0},
/* 28 */ { 6, s_2_28, -1, 4, 0},
/* 29 */ { 8, s_2_29, -1, 1, 0},
/* 30 */ { 6, s_2_30, -1, 3, 0},
/* 31 */ { 7, s_2_31, -1, 4, 0},
/* 32 */ { 9, s_2_32, -1, 1, 0},
/* 33 */ { 7, s_2_33, -1, 3, 0},
/* 34 */ { 4, s_2_34, -1, 4, 0},
/* 35 */ { 4, s_2_35, -1, 5, 0},
/* 36 */ { 6, s_2_36, 35, 4, 0},
/* 37 */ { 4, s_2_37, -1, 6, 0},
/* 38 */ { 4, s_2_38, -1, 5, 0},
/* 39 */ { 4, s_2_39, -1, 4, 0},
/* 40 */ { 4, s_2_40, -1, 5, 0},
/* 41 */ { 4, s_2_41, -1, 6, 0},
/* 42 */ { 5, s_2_42, -1, 4, 0},
/* 43 */ { 5, s_2_43, -1, 4, 0},
/* 44 */ { 5, s_2_44, -1, 5, 0},
/* 45 */ { 5, s_2_45, -1, 6, 0}
};
static const symbol s_3_0[3] = { 'i', 'c', 'a' };
static const symbol s_3_1[5] = { 'a', 'b', 'i', 'l', 'a' };
static const symbol s_3_2[5] = { 'i', 'b', 'i', 'l', 'a' };
static const symbol s_3_3[4] = { 'o', 'a', 's', 'a' };
static const symbol s_3_4[3] = { 'a', 't', 'a' };
static const symbol s_3_5[3] = { 'i', 't', 'a' };
static const symbol s_3_6[4] = { 'a', 'n', 't', 'a' };
static const symbol s_3_7[4] = { 'i', 's', 't', 'a' };
static const symbol s_3_8[3] = { 'u', 't', 'a' };
static const symbol s_3_9[3] = { 'i', 'v', 'a' };
static const symbol s_3_10[2] = { 'i', 'c' };
static const symbol s_3_11[3] = { 'i', 'c', 'e' };
static const symbol s_3_12[5] = { 'a', 'b', 'i', 'l', 'e' };
static const symbol s_3_13[5] = { 'i', 'b', 'i', 'l', 'e' };
static const symbol s_3_14[4] = { 'i', 's', 'm', 'e' };
static const symbol s_3_15[4] = { 'i', 'u', 'n', 'e' };
static const symbol s_3_16[4] = { 'o', 'a', 's', 'e' };
static const symbol s_3_17[3] = { 'a', 't', 'e' };
static const symbol s_3_18[5] = { 'i', 't', 'a', 't', 'e' };
static const symbol s_3_19[3] = { 'i', 't', 'e' };
static const symbol s_3_20[4] = { 'a', 'n', 't', 'e' };
static const symbol s_3_21[4] = { 'i', 's', 't', 'e' };
static const symbol s_3_22[3] = { 'u', 't', 'e' };
static const symbol s_3_23[3] = { 'i', 'v', 'e' };
static const symbol s_3_24[3] = { 'i', 'c', 'i' };
static const symbol s_3_25[5] = { 'a', 'b', 'i', 'l', 'i' };
static const symbol s_3_26[5] = { 'i', 'b', 'i', 'l', 'i' };
static const symbol s_3_27[4] = { 'i', 'u', 'n', 'i' };
static const symbol s_3_28[5] = { 'a', 't', 'o', 'r', 'i' };
static const symbol s_3_29[3] = { 'o', 's', 'i' };
static const symbol s_3_30[3] = { 'a', 't', 'i' };
static const symbol s_3_31[5] = { 'i', 't', 'a', 't', 'i' };
static const symbol s_3_32[3] = { 'i', 't', 'i' };
static const symbol s_3_33[4] = { 'a', 'n', 't', 'i' };
static const symbol s_3_34[4] = { 'i', 's', 't', 'i' };
static const symbol s_3_35[3] = { 'u', 't', 'i' };
static const symbol s_3_36[4] = { 'i', 0xBA, 't', 'i' };
static const symbol s_3_37[3] = { 'i', 'v', 'i' };
static const symbol s_3_38[3] = { 'o', 0xBA, 'i' };
static const symbol s_3_39[4] = { 'i', 't', 0xE3, 'i' };
static const symbol s_3_40[5] = { 'i', 't', 0xE3, 0xFE, 'i' };
static const symbol s_3_41[4] = { 'a', 'b', 'i', 'l' };
static const symbol s_3_42[4] = { 'i', 'b', 'i', 'l' };
static const symbol s_3_43[3] = { 'i', 's', 'm' };
static const symbol s_3_44[4] = { 'a', 't', 'o', 'r' };
static const symbol s_3_45[2] = { 'o', 's' };
static const symbol s_3_46[2] = { 'a', 't' };
static const symbol s_3_47[2] = { 'i', 't' };
static const symbol s_3_48[3] = { 'a', 'n', 't' };
static const symbol s_3_49[3] = { 'i', 's', 't' };
static const symbol s_3_50[2] = { 'u', 't' };
static const symbol s_3_51[2] = { 'i', 'v' };
static const symbol s_3_52[3] = { 'i', 'c', 0xE3 };
static const symbol s_3_53[5] = { 'a', 'b', 'i', 'l', 0xE3 };
static const symbol s_3_54[5] = { 'i', 'b', 'i', 'l', 0xE3 };
static const symbol s_3_55[4] = { 'o', 'a', 's', 0xE3 };
static const symbol s_3_56[3] = { 'a', 't', 0xE3 };
static const symbol s_3_57[3] = { 'i', 't', 0xE3 };
static const symbol s_3_58[4] = { 'a', 'n', 't', 0xE3 };
static const symbol s_3_59[4] = { 'i', 's', 't', 0xE3 };
static const symbol s_3_60[3] = { 'u', 't', 0xE3 };
static const symbol s_3_61[3] = { 'i', 'v', 0xE3 };
static const struct among a_3[62] =
{
/* 0 */ { 3, s_3_0, -1, 1, 0},
/* 1 */ { 5, s_3_1, -1, 1, 0},
/* 2 */ { 5, s_3_2, -1, 1, 0},
/* 3 */ { 4, s_3_3, -1, 1, 0},
/* 4 */ { 3, s_3_4, -1, 1, 0},
/* 5 */ { 3, s_3_5, -1, 1, 0},
/* 6 */ { 4, s_3_6, -1, 1, 0},
/* 7 */ { 4, s_3_7, -1, 3, 0},
/* 8 */ { 3, s_3_8, -1, 1, 0},
/* 9 */ { 3, s_3_9, -1, 1, 0},
/* 10 */ { 2, s_3_10, -1, 1, 0},
/* 11 */ { 3, s_3_11, -1, 1, 0},
/* 12 */ { 5, s_3_12, -1, 1, 0},
/* 13 */ { 5, s_3_13, -1, 1, 0},
/* 14 */ { 4, s_3_14, -1, 3, 0},
/* 15 */ { 4, s_3_15, -1, 2, 0},
/* 16 */ { 4, s_3_16, -1, 1, 0},
/* 17 */ { 3, s_3_17, -1, 1, 0},
/* 18 */ { 5, s_3_18, 17, 1, 0},
/* 19 */ { 3, s_3_19, -1, 1, 0},
/* 20 */ { 4, s_3_20, -1, 1, 0},
/* 21 */ { 4, s_3_21, -1, 3, 0},
/* 22 */ { 3, s_3_22, -1, 1, 0},
/* 23 */ { 3, s_3_23, -1, 1, 0},
/* 24 */ { 3, s_3_24, -1, 1, 0},
/* 25 */ { 5, s_3_25, -1, 1, 0},
/* 26 */ { 5, s_3_26, -1, 1, 0},
/* 27 */ { 4, s_3_27, -1, 2, 0},
/* 28 */ { 5, s_3_28, -1, 1, 0},
/* 29 */ { 3, s_3_29, -1, 1, 0},
/* 30 */ { 3, s_3_30, -1, 1, 0},
/* 31 */ { 5, s_3_31, 30, 1, 0},
/* 32 */ { 3, s_3_32, -1, 1, 0},
/* 33 */ { 4, s_3_33, -1, 1, 0},
/* 34 */ { 4, s_3_34, -1, 3, 0},
/* 35 */ { 3, s_3_35, -1, 1, 0},
/* 36 */ { 4, s_3_36, -1, 3, 0},
/* 37 */ { 3, s_3_37, -1, 1, 0},
/* 38 */ { 3, s_3_38, -1, 1, 0},
/* 39 */ { 4, s_3_39, -1, 1, 0},
/* 40 */ { 5, s_3_40, -1, 1, 0},
/* 41 */ { 4, s_3_41, -1, 1, 0},
/* 42 */ { 4, s_3_42, -1, 1, 0},
/* 43 */ { 3, s_3_43, -1, 3, 0},
/* 44 */ { 4, s_3_44, -1, 1, 0},
/* 45 */ { 2, s_3_45, -1, 1, 0},
/* 46 */ { 2, s_3_46, -1, 1, 0},
/* 47 */ { 2, s_3_47, -1, 1, 0},
/* 48 */ { 3, s_3_48, -1, 1, 0},
/* 49 */ { 3, s_3_49, -1, 3, 0},
/* 50 */ { 2, s_3_50, -1, 1, 0},
/* 51 */ { 2, s_3_51, -1, 1, 0},
/* 52 */ { 3, s_3_52, -1, 1, 0},
/* 53 */ { 5, s_3_53, -1, 1, 0},
/* 54 */ { 5, s_3_54, -1, 1, 0},
/* 55 */ { 4, s_3_55, -1, 1, 0},
/* 56 */ { 3, s_3_56, -1, 1, 0},
/* 57 */ { 3, s_3_57, -1, 1, 0},
/* 58 */ { 4, s_3_58, -1, 1, 0},
/* 59 */ { 4, s_3_59, -1, 3, 0},
/* 60 */ { 3, s_3_60, -1, 1, 0},
/* 61 */ { 3, s_3_61, -1, 1, 0}
};
static const symbol s_4_0[2] = { 'e', 'a' };
static const symbol s_4_1[2] = { 'i', 'a' };
static const symbol s_4_2[3] = { 'e', 's', 'c' };
static const symbol s_4_3[3] = { 0xE3, 's', 'c' };
static const symbol s_4_4[3] = { 'i', 'n', 'd' };
static const symbol s_4_5[3] = { 0xE2, 'n', 'd' };
static const symbol s_4_6[3] = { 'a', 'r', 'e' };
static const symbol s_4_7[3] = { 'e', 'r', 'e' };
static const symbol s_4_8[3] = { 'i', 'r', 'e' };
static const symbol s_4_9[3] = { 0xE2, 'r', 'e' };
static const symbol s_4_10[2] = { 's', 'e' };
static const symbol s_4_11[3] = { 'a', 's', 'e' };
static const symbol s_4_12[4] = { 's', 'e', 's', 'e' };
static const symbol s_4_13[3] = { 'i', 's', 'e' };
static const symbol s_4_14[3] = { 'u', 's', 'e' };
static const symbol s_4_15[3] = { 0xE2, 's', 'e' };
static const symbol s_4_16[4] = { 'e', 0xBA, 't', 'e' };
static const symbol s_4_17[4] = { 0xE3, 0xBA, 't', 'e' };
static const symbol s_4_18[3] = { 'e', 'z', 'e' };
static const symbol s_4_19[2] = { 'a', 'i' };
static const symbol s_4_20[3] = { 'e', 'a', 'i' };
static const symbol s_4_21[3] = { 'i', 'a', 'i' };
static const symbol s_4_22[3] = { 's', 'e', 'i' };
static const symbol s_4_23[4] = { 'e', 0xBA, 't', 'i' };
static const symbol s_4_24[4] = { 0xE3, 0xBA, 't', 'i' };
static const symbol s_4_25[2] = { 'u', 'i' };
static const symbol s_4_26[3] = { 'e', 'z', 'i' };
static const symbol s_4_27[3] = { 'a', 0xBA, 'i' };
static const symbol s_4_28[4] = { 's', 'e', 0xBA, 'i' };
static const symbol s_4_29[5] = { 'a', 's', 'e', 0xBA, 'i' };
static const symbol s_4_30[6] = { 's', 'e', 's', 'e', 0xBA, 'i' };
static const symbol s_4_31[5] = { 'i', 's', 'e', 0xBA, 'i' };
static const symbol s_4_32[5] = { 'u', 's', 'e', 0xBA, 'i' };
static const symbol s_4_33[5] = { 0xE2, 's', 'e', 0xBA, 'i' };
static const symbol s_4_34[3] = { 'i', 0xBA, 'i' };
static const symbol s_4_35[3] = { 'u', 0xBA, 'i' };
static const symbol s_4_36[3] = { 0xE2, 0xBA, 'i' };
static const symbol s_4_37[2] = { 0xE2, 'i' };
static const symbol s_4_38[3] = { 'a', 0xFE, 'i' };
static const symbol s_4_39[4] = { 'e', 'a', 0xFE, 'i' };
static const symbol s_4_40[4] = { 'i', 'a', 0xFE, 'i' };
static const symbol s_4_41[3] = { 'e', 0xFE, 'i' };
static const symbol s_4_42[3] = { 'i', 0xFE, 'i' };
static const symbol s_4_43[3] = { 0xE2, 0xFE, 'i' };
static const symbol s_4_44[5] = { 'a', 'r', 0xE3, 0xFE, 'i' };
static const symbol s_4_45[6] = { 's', 'e', 'r', 0xE3, 0xFE, 'i' };
static const symbol s_4_46[7] = { 'a', 's', 'e', 'r', 0xE3, 0xFE, 'i' };
static const symbol s_4_47[8] = { 's', 'e', 's', 'e', 'r', 0xE3, 0xFE, 'i' };
static const symbol s_4_48[7] = { 'i', 's', 'e', 'r', 0xE3, 0xFE, 'i' };
static const symbol s_4_49[7] = { 'u', 's', 'e', 'r', 0xE3, 0xFE, 'i' };
static const symbol s_4_50[7] = { 0xE2, 's', 'e', 'r', 0xE3, 0xFE, 'i' };
static const symbol s_4_51[5] = { 'i', 'r', 0xE3, 0xFE, 'i' };
static const symbol s_4_52[5] = { 'u', 'r', 0xE3, 0xFE, 'i' };
static const symbol s_4_53[5] = { 0xE2, 'r', 0xE3, 0xFE, 'i' };
static const symbol s_4_54[2] = { 'a', 'm' };
static const symbol s_4_55[3] = { 'e', 'a', 'm' };
static const symbol s_4_56[3] = { 'i', 'a', 'm' };
static const symbol s_4_57[2] = { 'e', 'm' };
static const symbol s_4_58[4] = { 'a', 's', 'e', 'm' };
static const symbol s_4_59[5] = { 's', 'e', 's', 'e', 'm' };
static const symbol s_4_60[4] = { 'i', 's', 'e', 'm' };
static const symbol s_4_61[4] = { 'u', 's', 'e', 'm' };
static const symbol s_4_62[4] = { 0xE2, 's', 'e', 'm' };
static const symbol s_4_63[2] = { 'i', 'm' };
static const symbol s_4_64[2] = { 0xE2, 'm' };
static const symbol s_4_65[2] = { 0xE3, 'm' };
static const symbol s_4_66[4] = { 'a', 'r', 0xE3, 'm' };
static const symbol s_4_67[5] = { 's', 'e', 'r', 0xE3, 'm' };
static const symbol s_4_68[6] = { 'a', 's', 'e', 'r', 0xE3, 'm' };
static const symbol s_4_69[7] = { 's', 'e', 's', 'e', 'r', 0xE3, 'm' };
static const symbol s_4_70[6] = { 'i', 's', 'e', 'r', 0xE3, 'm' };
static const symbol s_4_71[6] = { 'u', 's', 'e', 'r', 0xE3, 'm' };
static const symbol s_4_72[6] = { 0xE2, 's', 'e', 'r', 0xE3, 'm' };
static const symbol s_4_73[4] = { 'i', 'r', 0xE3, 'm' };
static const symbol s_4_74[4] = { 'u', 'r', 0xE3, 'm' };
static const symbol s_4_75[4] = { 0xE2, 'r', 0xE3, 'm' };
static const symbol s_4_76[2] = { 'a', 'u' };
static const symbol s_4_77[3] = { 'e', 'a', 'u' };
static const symbol s_4_78[3] = { 'i', 'a', 'u' };
static const symbol s_4_79[4] = { 'i', 'n', 'd', 'u' };
static const symbol s_4_80[4] = { 0xE2, 'n', 'd', 'u' };
static const symbol s_4_81[2] = { 'e', 'z' };
static const symbol s_4_82[5] = { 'e', 'a', 's', 'c', 0xE3 };
static const symbol s_4_83[3] = { 'a', 'r', 0xE3 };
static const symbol s_4_84[4] = { 's', 'e', 'r', 0xE3 };
static const symbol s_4_85[5] = { 'a', 's', 'e', 'r', 0xE3 };
static const symbol s_4_86[6] = { 's', 'e', 's', 'e', 'r', 0xE3 };
static const symbol s_4_87[5] = { 'i', 's', 'e', 'r', 0xE3 };
static const symbol s_4_88[5] = { 'u', 's', 'e', 'r', 0xE3 };
static const symbol s_4_89[5] = { 0xE2, 's', 'e', 'r', 0xE3 };
static const symbol s_4_90[3] = { 'i', 'r', 0xE3 };
static const symbol s_4_91[3] = { 'u', 'r', 0xE3 };
static const symbol s_4_92[3] = { 0xE2, 'r', 0xE3 };
static const symbol s_4_93[4] = { 'e', 'a', 'z', 0xE3 };
static const struct among a_4[94] =
{
/* 0 */ { 2, s_4_0, -1, 1, 0},
/* 1 */ { 2, s_4_1, -1, 1, 0},
/* 2 */ { 3, s_4_2, -1, 1, 0},
/* 3 */ { 3, s_4_3, -1, 1, 0},
/* 4 */ { 3, s_4_4, -1, 1, 0},
/* 5 */ { 3, s_4_5, -1, 1, 0},
/* 6 */ { 3, s_4_6, -1, 1, 0},
/* 7 */ { 3, s_4_7, -1, 1, 0},
/* 8 */ { 3, s_4_8, -1, 1, 0},
/* 9 */ { 3, s_4_9, -1, 1, 0},
/* 10 */ { 2, s_4_10, -1, 2, 0},
/* 11 */ { 3, s_4_11, 10, 1, 0},
/* 12 */ { 4, s_4_12, 10, 2, 0},
/* 13 */ { 3, s_4_13, 10, 1, 0},
/* 14 */ { 3, s_4_14, 10, 1, 0},
/* 15 */ { 3, s_4_15, 10, 1, 0},
/* 16 */ { 4, s_4_16, -1, 1, 0},
/* 17 */ { 4, s_4_17, -1, 1, 0},
/* 18 */ { 3, s_4_18, -1, 1, 0},
/* 19 */ { 2, s_4_19, -1, 1, 0},
/* 20 */ { 3, s_4_20, 19, 1, 0},
/* 21 */ { 3, s_4_21, 19, 1, 0},
/* 22 */ { 3, s_4_22, -1, 2, 0},
/* 23 */ { 4, s_4_23, -1, 1, 0},
/* 24 */ { 4, s_4_24, -1, 1, 0},
/* 25 */ { 2, s_4_25, -1, 1, 0},
/* 26 */ { 3, s_4_26, -1, 1, 0},
/* 27 */ { 3, s_4_27, -1, 1, 0},
/* 28 */ { 4, s_4_28, -1, 2, 0},
/* 29 */ { 5, s_4_29, 28, 1, 0},
/* 30 */ { 6, s_4_30, 28, 2, 0},
/* 31 */ { 5, s_4_31, 28, 1, 0},
/* 32 */ { 5, s_4_32, 28, 1, 0},
/* 33 */ { 5, s_4_33, 28, 1, 0},
/* 34 */ { 3, s_4_34, -1, 1, 0},
/* 35 */ { 3, s_4_35, -1, 1, 0},
/* 36 */ { 3, s_4_36, -1, 1, 0},
/* 37 */ { 2, s_4_37, -1, 1, 0},
/* 38 */ { 3, s_4_38, -1, 2, 0},
/* 39 */ { 4, s_4_39, 38, 1, 0},
/* 40 */ { 4, s_4_40, 38, 1, 0},
/* 41 */ { 3, s_4_41, -1, 2, 0},
/* 42 */ { 3, s_4_42, -1, 2, 0},
/* 43 */ { 3, s_4_43, -1, 2, 0},
/* 44 */ { 5, s_4_44, -1, 1, 0},
/* 45 */ { 6, s_4_45, -1, 2, 0},
/* 46 */ { 7, s_4_46, 45, 1, 0},
/* 47 */ { 8, s_4_47, 45, 2, 0},
/* 48 */ { 7, s_4_48, 45, 1, 0},
/* 49 */ { 7, s_4_49, 45, 1, 0},
/* 50 */ { 7, s_4_50, 45, 1, 0},
/* 51 */ { 5, s_4_51, -1, 1, 0},
/* 52 */ { 5, s_4_52, -1, 1, 0},
/* 53 */ { 5, s_4_53, -1, 1, 0},
/* 54 */ { 2, s_4_54, -1, 1, 0},
/* 55 */ { 3, s_4_55, 54, 1, 0},
/* 56 */ { 3, s_4_56, 54, 1, 0},
/* 57 */ { 2, s_4_57, -1, 2, 0},
/* 58 */ { 4, s_4_58, 57, 1, 0},
/* 59 */ { 5, s_4_59, 57, 2, 0},
/* 60 */ { 4, s_4_60, 57, 1, 0},
/* 61 */ { 4, s_4_61, 57, 1, 0},
/* 62 */ { 4, s_4_62, 57, 1, 0},
/* 63 */ { 2, s_4_63, -1, 2, 0},
/* 64 */ { 2, s_4_64, -1, 2, 0},
/* 65 */ { 2, s_4_65, -1, 2, 0},
/* 66 */ { 4, s_4_66, 65, 1, 0},
/* 67 */ { 5, s_4_67, 65, 2, 0},
/* 68 */ { 6, s_4_68, 67, 1, 0},
/* 69 */ { 7, s_4_69, 67, 2, 0},
/* 70 */ { 6, s_4_70, 67, 1, 0},
/* 71 */ { 6, s_4_71, 67, 1, 0},
/* 72 */ { 6, s_4_72, 67, 1, 0},
/* 73 */ { 4, s_4_73, 65, 1, 0},
/* 74 */ { 4, s_4_74, 65, 1, 0},
/* 75 */ { 4, s_4_75, 65, 1, 0},
/* 76 */ { 2, s_4_76, -1, 1, 0},
/* 77 */ { 3, s_4_77, 76, 1, 0},
/* 78 */ { 3, s_4_78, 76, 1, 0},
/* 79 */ { 4, s_4_79, -1, 1, 0},
/* 80 */ { 4, s_4_80, -1, 1, 0},
/* 81 */ { 2, s_4_81, -1, 1, 0},
/* 82 */ { 5, s_4_82, -1, 1, 0},
/* 83 */ { 3, s_4_83, -1, 1, 0},
/* 84 */ { 4, s_4_84, -1, 2, 0},
/* 85 */ { 5, s_4_85, 84, 1, 0},
/* 86 */ { 6, s_4_86, 84, 2, 0},
/* 87 */ { 5, s_4_87, 84, 1, 0},
/* 88 */ { 5, s_4_88, 84, 1, 0},
/* 89 */ { 5, s_4_89, 84, 1, 0},
/* 90 */ { 3, s_4_90, -1, 1, 0},
/* 91 */ { 3, s_4_91, -1, 1, 0},
/* 92 */ { 3, s_4_92, -1, 1, 0},
/* 93 */ { 4, s_4_93, -1, 1, 0}
};
static const symbol s_5_0[1] = { 'a' };
static const symbol s_5_1[1] = { 'e' };
static const symbol s_5_2[2] = { 'i', 'e' };
static const symbol s_5_3[1] = { 'i' };
static const symbol s_5_4[1] = { 0xE3 };
static const struct among a_5[5] =
{
/* 0 */ { 1, s_5_0, -1, 1, 0},
/* 1 */ { 1, s_5_1, -1, 1, 0},
/* 2 */ { 2, s_5_2, 1, 1, 0},
/* 3 */ { 1, s_5_3, -1, 1, 0},
/* 4 */ { 1, s_5_4, -1, 1, 0}
};
static const unsigned char g_v[] = { 17, 65, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 32 };
static const symbol s_0[] = { 'u' };
static const symbol s_1[] = { 'U' };
static const symbol s_2[] = { 'i' };
static const symbol s_3[] = { 'I' };
static const symbol s_4[] = { 'i' };
static const symbol s_5[] = { 'u' };
static const symbol s_6[] = { 'a' };
static const symbol s_7[] = { 'e' };
static const symbol s_8[] = { 'i' };
static const symbol s_9[] = { 'a', 'b' };
static const symbol s_10[] = { 'i' };
static const symbol s_11[] = { 'a', 't' };
static const symbol s_12[] = { 'a', 0xFE, 'i' };
static const symbol s_13[] = { 'a', 'b', 'i', 'l' };
static const symbol s_14[] = { 'i', 'b', 'i', 'l' };
static const symbol s_15[] = { 'i', 'v' };
static const symbol s_16[] = { 'i', 'c' };
static const symbol s_17[] = { 'a', 't' };
static const symbol s_18[] = { 'i', 't' };
static const symbol s_19[] = { 0xFE };
static const symbol s_20[] = { 't' };
static const symbol s_21[] = { 'i', 's', 't' };
static const symbol s_22[] = { 'u' };
static int r_prelude(struct SN_env * z) {
while(1) { /* repeat, line 32 */
int c1 = z->c;
while(1) { /* goto, line 32 */
int c2 = z->c;
if (in_grouping(z, g_v, 97, 238, 0)) goto lab1;
z->bra = z->c; /* [, line 33 */
{ int c3 = z->c; /* or, line 33 */
if (!(eq_s(z, 1, s_0))) goto lab3;
z->ket = z->c; /* ], line 33 */
if (in_grouping(z, g_v, 97, 238, 0)) goto lab3;
{ int ret = slice_from_s(z, 1, s_1); /* <-, line 33 */
if (ret < 0) return ret;
}
goto lab2;
lab3:
z->c = c3;
if (!(eq_s(z, 1, s_2))) goto lab1;
z->ket = z->c; /* ], line 34 */
if (in_grouping(z, g_v, 97, 238, 0)) goto lab1;
{ int ret = slice_from_s(z, 1, s_3); /* <-, line 34 */
if (ret < 0) return ret;
}
}
lab2:
z->c = c2;
break;
lab1:
z->c = c2;
if (z->c >= z->l) goto lab0;
z->c++; /* goto, line 32 */
}
continue;
lab0:
z->c = c1;
break;
}
return 1;
}
static int r_mark_regions(struct SN_env * z) {
z->I[0] = z->l;
z->I[1] = z->l;
z->I[2] = z->l;
{ int c1 = z->c; /* do, line 44 */
{ int c2 = z->c; /* or, line 46 */
if (in_grouping(z, g_v, 97, 238, 0)) goto lab2;
{ int c3 = z->c; /* or, line 45 */
if (out_grouping(z, g_v, 97, 238, 0)) goto lab4;
{ /* gopast */ /* grouping v, line 45 */
int ret = out_grouping(z, g_v, 97, 238, 1);
if (ret < 0) goto lab4;
z->c += ret;
}
goto lab3;
lab4:
z->c = c3;
if (in_grouping(z, g_v, 97, 238, 0)) goto lab2;
{ /* gopast */ /* non v, line 45 */
int ret = in_grouping(z, g_v, 97, 238, 1);
if (ret < 0) goto lab2;
z->c += ret;
}
}
lab3:
goto lab1;
lab2:
z->c = c2;
if (out_grouping(z, g_v, 97, 238, 0)) goto lab0;
{ int c4 = z->c; /* or, line 47 */
if (out_grouping(z, g_v, 97, 238, 0)) goto lab6;
{ /* gopast */ /* grouping v, line 47 */
int ret = out_grouping(z, g_v, 97, 238, 1);
if (ret < 0) goto lab6;
z->c += ret;
}
goto lab5;
lab6:
z->c = c4;
if (in_grouping(z, g_v, 97, 238, 0)) goto lab0;
if (z->c >= z->l) goto lab0;
z->c++; /* next, line 47 */
}
lab5:
;
}
lab1:
z->I[0] = z->c; /* setmark pV, line 48 */
lab0:
z->c = c1;
}
{ int c5 = z->c; /* do, line 50 */
{ /* gopast */ /* grouping v, line 51 */
int ret = out_grouping(z, g_v, 97, 238, 1);
if (ret < 0) goto lab7;
z->c += ret;
}
{ /* gopast */ /* non v, line 51 */
int ret = in_grouping(z, g_v, 97, 238, 1);
if (ret < 0) goto lab7;
z->c += ret;
}
z->I[1] = z->c; /* setmark p1, line 51 */
{ /* gopast */ /* grouping v, line 52 */
int ret = out_grouping(z, g_v, 97, 238, 1);
if (ret < 0) goto lab7;
z->c += ret;
}
{ /* gopast */ /* non v, line 52 */
int ret = in_grouping(z, g_v, 97, 238, 1);
if (ret < 0) goto lab7;
z->c += ret;
}
z->I[2] = z->c; /* setmark p2, line 52 */
lab7:
z->c = c5;
}
return 1;
}
static int r_postlude(struct SN_env * z) {
int among_var;
while(1) { /* repeat, line 56 */
int c1 = z->c;
z->bra = z->c; /* [, line 58 */
if (z->c >= z->l || (z->p[z->c + 0] != 73 && z->p[z->c + 0] != 85)) among_var = 3; else
among_var = find_among(z, a_0, 3); /* substring, line 58 */
if (!(among_var)) goto lab0;
z->ket = z->c; /* ], line 58 */
switch(among_var) {
case 0: goto lab0;
case 1:
{ int ret = slice_from_s(z, 1, s_4); /* <-, line 59 */
if (ret < 0) return ret;
}
break;
case 2:
{ int ret = slice_from_s(z, 1, s_5); /* <-, line 60 */
if (ret < 0) return ret;
}
break;
case 3:
if (z->c >= z->l) goto lab0;
z->c++; /* next, line 61 */
break;
}
continue;
lab0:
z->c = c1;
break;
}
return 1;
}
static int r_RV(struct SN_env * z) {
if (!(z->I[0] <= z->c)) return 0;
return 1;
}
static int r_R1(struct SN_env * z) {
if (!(z->I[1] <= z->c)) return 0;
return 1;
}
static int r_R2(struct SN_env * z) {
if (!(z->I[2] <= z->c)) return 0;
return 1;
}
static int r_step_0(struct SN_env * z) {
int among_var;
z->ket = z->c; /* [, line 73 */
if (z->c - 1 <= z->lb || z->p[z->c - 1] >> 5 != 3 || !((266786 >> (z->p[z->c - 1] & 0x1f)) & 1)) return 0;
among_var = find_among_b(z, a_1, 16); /* substring, line 73 */
if (!(among_var)) return 0;
z->bra = z->c; /* ], line 73 */
{ int ret = r_R1(z);
if (ret == 0) return 0; /* call R1, line 73 */
if (ret < 0) return ret;
}
switch(among_var) {
case 0: return 0;
case 1:
{ int ret = slice_del(z); /* delete, line 75 */
if (ret < 0) return ret;
}
break;
case 2:
{ int ret = slice_from_s(z, 1, s_6); /* <-, line 77 */
if (ret < 0) return ret;
}
break;
case 3:
{ int ret = slice_from_s(z, 1, s_7); /* <-, line 79 */
if (ret < 0) return ret;
}
break;
case 4:
{ int ret = slice_from_s(z, 1, s_8); /* <-, line 81 */
if (ret < 0) return ret;
}
break;
case 5:
{ int m1 = z->l - z->c; (void)m1; /* not, line 83 */
if (!(eq_s_b(z, 2, s_9))) goto lab0;
return 0;
lab0:
z->c = z->l - m1;
}
{ int ret = slice_from_s(z, 1, s_10); /* <-, line 83 */
if (ret < 0) return ret;
}
break;
case 6:
{ int ret = slice_from_s(z, 2, s_11); /* <-, line 85 */
if (ret < 0) return ret;
}
break;
case 7:
{ int ret = slice_from_s(z, 3, s_12); /* <-, line 87 */
if (ret < 0) return ret;
}
break;
}
return 1;
}
static int r_combo_suffix(struct SN_env * z) {
int among_var;
{ int m_test = z->l - z->c; /* test, line 91 */
z->ket = z->c; /* [, line 92 */
among_var = find_among_b(z, a_2, 46); /* substring, line 92 */
if (!(among_var)) return 0;
z->bra = z->c; /* ], line 92 */
{ int ret = r_R1(z);
if (ret == 0) return 0; /* call R1, line 92 */
if (ret < 0) return ret;
}
switch(among_var) {
case 0: return 0;
case 1:
{ int ret = slice_from_s(z, 4, s_13); /* <-, line 101 */
if (ret < 0) return ret;
}
break;
case 2:
{ int ret = slice_from_s(z, 4, s_14); /* <-, line 104 */
if (ret < 0) return ret;
}
break;
case 3:
{ int ret = slice_from_s(z, 2, s_15); /* <-, line 107 */
if (ret < 0) return ret;
}
break;
case 4:
{ int ret = slice_from_s(z, 2, s_16); /* <-, line 113 */
if (ret < 0) return ret;
}
break;
case 5:
{ int ret = slice_from_s(z, 2, s_17); /* <-, line 118 */
if (ret < 0) return ret;
}
break;
case 6:
{ int ret = slice_from_s(z, 2, s_18); /* <-, line 122 */
if (ret < 0) return ret;
}
break;
}
z->B[0] = 1; /* set standard_suffix_removed, line 125 */
z->c = z->l - m_test;
}
return 1;
}
static int r_standard_suffix(struct SN_env * z) {
int among_var;
z->B[0] = 0; /* unset standard_suffix_removed, line 130 */
while(1) { /* repeat, line 131 */
int m1 = z->l - z->c; (void)m1;
{ int ret = r_combo_suffix(z);
if (ret == 0) goto lab0; /* call combo_suffix, line 131 */
if (ret < 0) return ret;
}
continue;
lab0:
z->c = z->l - m1;
break;
}
z->ket = z->c; /* [, line 132 */
among_var = find_among_b(z, a_3, 62); /* substring, line 132 */
if (!(among_var)) return 0;
z->bra = z->c; /* ], line 132 */
{ int ret = r_R2(z);
if (ret == 0) return 0; /* call R2, line 132 */
if (ret < 0) return ret;
}
switch(among_var) {
case 0: return 0;
case 1:
{ int ret = slice_del(z); /* delete, line 149 */
if (ret < 0) return ret;
}
break;
case 2:
if (!(eq_s_b(z, 1, s_19))) return 0;
z->bra = z->c; /* ], line 152 */
{ int ret = slice_from_s(z, 1, s_20); /* <-, line 152 */
if (ret < 0) return ret;
}
break;
case 3:
{ int ret = slice_from_s(z, 3, s_21); /* <-, line 156 */
if (ret < 0) return ret;
}
break;
}
z->B[0] = 1; /* set standard_suffix_removed, line 160 */
return 1;
}
static int r_verb_suffix(struct SN_env * z) {
int among_var;
{ int mlimit; /* setlimit, line 164 */
int m1 = z->l - z->c; (void)m1;
if (z->c < z->I[0]) return 0;
z->c = z->I[0]; /* tomark, line 164 */
mlimit = z->lb; z->lb = z->c;
z->c = z->l - m1;
z->ket = z->c; /* [, line 165 */
among_var = find_among_b(z, a_4, 94); /* substring, line 165 */
if (!(among_var)) { z->lb = mlimit; return 0; }
z->bra = z->c; /* ], line 165 */
switch(among_var) {
case 0: { z->lb = mlimit; return 0; }
case 1:
{ int m2 = z->l - z->c; (void)m2; /* or, line 200 */
if (out_grouping_b(z, g_v, 97, 238, 0)) goto lab1;
goto lab0;
lab1:
z->c = z->l - m2;
if (!(eq_s_b(z, 1, s_22))) { z->lb = mlimit; return 0; }
}
lab0:
{ int ret = slice_del(z); /* delete, line 200 */
if (ret < 0) return ret;
}
break;
case 2:
{ int ret = slice_del(z); /* delete, line 214 */
if (ret < 0) return ret;
}
break;
}
z->lb = mlimit;
}
return 1;
}
static int r_vowel_suffix(struct SN_env * z) {
int among_var;
z->ket = z->c; /* [, line 219 */
among_var = find_among_b(z, a_5, 5); /* substring, line 219 */
if (!(among_var)) return 0;
z->bra = z->c; /* ], line 219 */
{ int ret = r_RV(z);
if (ret == 0) return 0; /* call RV, line 219 */
if (ret < 0) return ret;
}
switch(among_var) {
case 0: return 0;
case 1:
{ int ret = slice_del(z); /* delete, line 220 */
if (ret < 0) return ret;
}
break;
}
return 1;
}
extern int romanian_ISO_8859_2_stem(struct SN_env * z) {
{ int c1 = z->c; /* do, line 226 */
{ int ret = r_prelude(z);
if (ret == 0) goto lab0; /* call prelude, line 226 */
if (ret < 0) return ret;
}
lab0:
z->c = c1;
}
{ int c2 = z->c; /* do, line 227 */
{ int ret = r_mark_regions(z);
if (ret == 0) goto lab1; /* call mark_regions, line 227 */
if (ret < 0) return ret;
}
lab1:
z->c = c2;
}
z->lb = z->c; z->c = z->l; /* backwards, line 228 */
{ int m3 = z->l - z->c; (void)m3; /* do, line 229 */
{ int ret = r_step_0(z);
if (ret == 0) goto lab2; /* call step_0, line 229 */
if (ret < 0) return ret;
}
lab2:
z->c = z->l - m3;
}
{ int m4 = z->l - z->c; (void)m4; /* do, line 230 */
{ int ret = r_standard_suffix(z);
if (ret == 0) goto lab3; /* call standard_suffix, line 230 */
if (ret < 0) return ret;
}
lab3:
z->c = z->l - m4;
}
{ int m5 = z->l - z->c; (void)m5; /* do, line 231 */
{ int m6 = z->l - z->c; (void)m6; /* or, line 231 */
if (!(z->B[0])) goto lab6; /* Boolean test standard_suffix_removed, line 231 */
goto lab5;
lab6:
z->c = z->l - m6;
{ int ret = r_verb_suffix(z);
if (ret == 0) goto lab4; /* call verb_suffix, line 231 */
if (ret < 0) return ret;
}
}
lab5:
lab4:
z->c = z->l - m5;
}
{ int m7 = z->l - z->c; (void)m7; /* do, line 232 */
{ int ret = r_vowel_suffix(z);
if (ret == 0) goto lab7; /* call vowel_suffix, line 232 */
if (ret < 0) return ret;
}
lab7:
z->c = z->l - m7;
}
z->c = z->lb;
{ int c8 = z->c; /* do, line 234 */
{ int ret = r_postlude(z);
if (ret == 0) goto lab8; /* call postlude, line 234 */
if (ret < 0) return ret;
}
lab8:
z->c = c8;
}
return 1;
}
extern struct SN_env * romanian_ISO_8859_2_create_env(void) { return SN_create_env(0, 3, 1); }
extern void romanian_ISO_8859_2_close_env(struct SN_env * z) { SN_close_env(z, 0); }

View file

@ -1,16 +0,0 @@
/* This file was generated automatically by the Snowball to ANSI C compiler */
#ifdef __cplusplus
extern "C" {
#endif
extern struct SN_env * romanian_ISO_8859_2_create_env(void);
extern void romanian_ISO_8859_2_close_env(struct SN_env * z);
extern int romanian_ISO_8859_2_stem(struct SN_env * z);
#ifdef __cplusplus
}
#endif

View file

@ -1,700 +0,0 @@
/* This file was generated automatically by the Snowball to ANSI C compiler */
#include "../runtime/header.h"
#ifdef __cplusplus
extern "C" {
#endif
extern int russian_KOI8_R_stem(struct SN_env * z);
#ifdef __cplusplus
}
#endif
static int r_tidy_up(struct SN_env * z);
static int r_derivational(struct SN_env * z);
static int r_noun(struct SN_env * z);
static int r_verb(struct SN_env * z);
static int r_reflexive(struct SN_env * z);
static int r_adjectival(struct SN_env * z);
static int r_adjective(struct SN_env * z);
static int r_perfective_gerund(struct SN_env * z);
static int r_R2(struct SN_env * z);
static int r_mark_regions(struct SN_env * z);
#ifdef __cplusplus
extern "C" {
#endif
extern struct SN_env * russian_KOI8_R_create_env(void);
extern void russian_KOI8_R_close_env(struct SN_env * z);
#ifdef __cplusplus
}
#endif
static const symbol s_0_0[3] = { 0xD7, 0xDB, 0xC9 };
static const symbol s_0_1[4] = { 0xC9, 0xD7, 0xDB, 0xC9 };
static const symbol s_0_2[4] = { 0xD9, 0xD7, 0xDB, 0xC9 };
static const symbol s_0_3[1] = { 0xD7 };
static const symbol s_0_4[2] = { 0xC9, 0xD7 };
static const symbol s_0_5[2] = { 0xD9, 0xD7 };
static const symbol s_0_6[5] = { 0xD7, 0xDB, 0xC9, 0xD3, 0xD8 };
static const symbol s_0_7[6] = { 0xC9, 0xD7, 0xDB, 0xC9, 0xD3, 0xD8 };
static const symbol s_0_8[6] = { 0xD9, 0xD7, 0xDB, 0xC9, 0xD3, 0xD8 };
static const struct among a_0[9] =
{
/* 0 */ { 3, s_0_0, -1, 1, 0},
/* 1 */ { 4, s_0_1, 0, 2, 0},
/* 2 */ { 4, s_0_2, 0, 2, 0},
/* 3 */ { 1, s_0_3, -1, 1, 0},
/* 4 */ { 2, s_0_4, 3, 2, 0},
/* 5 */ { 2, s_0_5, 3, 2, 0},
/* 6 */ { 5, s_0_6, -1, 1, 0},
/* 7 */ { 6, s_0_7, 6, 2, 0},
/* 8 */ { 6, s_0_8, 6, 2, 0}
};
static const symbol s_1_0[2] = { 0xC0, 0xC0 };
static const symbol s_1_1[2] = { 0xC5, 0xC0 };
static const symbol s_1_2[2] = { 0xCF, 0xC0 };
static const symbol s_1_3[2] = { 0xD5, 0xC0 };
static const symbol s_1_4[2] = { 0xC5, 0xC5 };
static const symbol s_1_5[2] = { 0xC9, 0xC5 };
static const symbol s_1_6[2] = { 0xCF, 0xC5 };
static const symbol s_1_7[2] = { 0xD9, 0xC5 };
static const symbol s_1_8[2] = { 0xC9, 0xC8 };
static const symbol s_1_9[2] = { 0xD9, 0xC8 };
static const symbol s_1_10[3] = { 0xC9, 0xCD, 0xC9 };
static const symbol s_1_11[3] = { 0xD9, 0xCD, 0xC9 };
static const symbol s_1_12[2] = { 0xC5, 0xCA };
static const symbol s_1_13[2] = { 0xC9, 0xCA };
static const symbol s_1_14[2] = { 0xCF, 0xCA };
static const symbol s_1_15[2] = { 0xD9, 0xCA };
static const symbol s_1_16[2] = { 0xC5, 0xCD };
static const symbol s_1_17[2] = { 0xC9, 0xCD };
static const symbol s_1_18[2] = { 0xCF, 0xCD };
static const symbol s_1_19[2] = { 0xD9, 0xCD };
static const symbol s_1_20[3] = { 0xC5, 0xC7, 0xCF };
static const symbol s_1_21[3] = { 0xCF, 0xC7, 0xCF };
static const symbol s_1_22[2] = { 0xC1, 0xD1 };
static const symbol s_1_23[2] = { 0xD1, 0xD1 };
static const symbol s_1_24[3] = { 0xC5, 0xCD, 0xD5 };
static const symbol s_1_25[3] = { 0xCF, 0xCD, 0xD5 };
static const struct among a_1[26] =
{
/* 0 */ { 2, s_1_0, -1, 1, 0},
/* 1 */ { 2, s_1_1, -1, 1, 0},
/* 2 */ { 2, s_1_2, -1, 1, 0},
/* 3 */ { 2, s_1_3, -1, 1, 0},
/* 4 */ { 2, s_1_4, -1, 1, 0},
/* 5 */ { 2, s_1_5, -1, 1, 0},
/* 6 */ { 2, s_1_6, -1, 1, 0},
/* 7 */ { 2, s_1_7, -1, 1, 0},
/* 8 */ { 2, s_1_8, -1, 1, 0},
/* 9 */ { 2, s_1_9, -1, 1, 0},
/* 10 */ { 3, s_1_10, -1, 1, 0},
/* 11 */ { 3, s_1_11, -1, 1, 0},
/* 12 */ { 2, s_1_12, -1, 1, 0},
/* 13 */ { 2, s_1_13, -1, 1, 0},
/* 14 */ { 2, s_1_14, -1, 1, 0},
/* 15 */ { 2, s_1_15, -1, 1, 0},
/* 16 */ { 2, s_1_16, -1, 1, 0},
/* 17 */ { 2, s_1_17, -1, 1, 0},
/* 18 */ { 2, s_1_18, -1, 1, 0},
/* 19 */ { 2, s_1_19, -1, 1, 0},
/* 20 */ { 3, s_1_20, -1, 1, 0},
/* 21 */ { 3, s_1_21, -1, 1, 0},
/* 22 */ { 2, s_1_22, -1, 1, 0},
/* 23 */ { 2, s_1_23, -1, 1, 0},
/* 24 */ { 3, s_1_24, -1, 1, 0},
/* 25 */ { 3, s_1_25, -1, 1, 0}
};
static const symbol s_2_0[2] = { 0xC5, 0xCD };
static const symbol s_2_1[2] = { 0xCE, 0xCE };
static const symbol s_2_2[2] = { 0xD7, 0xDB };
static const symbol s_2_3[3] = { 0xC9, 0xD7, 0xDB };
static const symbol s_2_4[3] = { 0xD9, 0xD7, 0xDB };
static const symbol s_2_5[1] = { 0xDD };
static const symbol s_2_6[2] = { 0xC0, 0xDD };
static const symbol s_2_7[3] = { 0xD5, 0xC0, 0xDD };
static const struct among a_2[8] =
{
/* 0 */ { 2, s_2_0, -1, 1, 0},
/* 1 */ { 2, s_2_1, -1, 1, 0},
/* 2 */ { 2, s_2_2, -1, 1, 0},
/* 3 */ { 3, s_2_3, 2, 2, 0},
/* 4 */ { 3, s_2_4, 2, 2, 0},
/* 5 */ { 1, s_2_5, -1, 1, 0},
/* 6 */ { 2, s_2_6, 5, 1, 0},
/* 7 */ { 3, s_2_7, 6, 2, 0}
};
static const symbol s_3_0[2] = { 0xD3, 0xD1 };
static const symbol s_3_1[2] = { 0xD3, 0xD8 };
static const struct among a_3[2] =
{
/* 0 */ { 2, s_3_0, -1, 1, 0},
/* 1 */ { 2, s_3_1, -1, 1, 0}
};
static const symbol s_4_0[1] = { 0xC0 };
static const symbol s_4_1[2] = { 0xD5, 0xC0 };
static const symbol s_4_2[2] = { 0xCC, 0xC1 };
static const symbol s_4_3[3] = { 0xC9, 0xCC, 0xC1 };
static const symbol s_4_4[3] = { 0xD9, 0xCC, 0xC1 };
static const symbol s_4_5[2] = { 0xCE, 0xC1 };
static const symbol s_4_6[3] = { 0xC5, 0xCE, 0xC1 };
static const symbol s_4_7[3] = { 0xC5, 0xD4, 0xC5 };
static const symbol s_4_8[3] = { 0xC9, 0xD4, 0xC5 };
static const symbol s_4_9[3] = { 0xCA, 0xD4, 0xC5 };
static const symbol s_4_10[4] = { 0xC5, 0xCA, 0xD4, 0xC5 };
static const symbol s_4_11[4] = { 0xD5, 0xCA, 0xD4, 0xC5 };
static const symbol s_4_12[2] = { 0xCC, 0xC9 };
static const symbol s_4_13[3] = { 0xC9, 0xCC, 0xC9 };
static const symbol s_4_14[3] = { 0xD9, 0xCC, 0xC9 };
static const symbol s_4_15[1] = { 0xCA };
static const symbol s_4_16[2] = { 0xC5, 0xCA };
static const symbol s_4_17[2] = { 0xD5, 0xCA };
static const symbol s_4_18[1] = { 0xCC };
static const symbol s_4_19[2] = { 0xC9, 0xCC };
static const symbol s_4_20[2] = { 0xD9, 0xCC };
static const symbol s_4_21[2] = { 0xC5, 0xCD };
static const symbol s_4_22[2] = { 0xC9, 0xCD };
static const symbol s_4_23[2] = { 0xD9, 0xCD };
static const symbol s_4_24[1] = { 0xCE };
static const symbol s_4_25[2] = { 0xC5, 0xCE };
static const symbol s_4_26[2] = { 0xCC, 0xCF };
static const symbol s_4_27[3] = { 0xC9, 0xCC, 0xCF };
static const symbol s_4_28[3] = { 0xD9, 0xCC, 0xCF };
static const symbol s_4_29[2] = { 0xCE, 0xCF };
static const symbol s_4_30[3] = { 0xC5, 0xCE, 0xCF };
static const symbol s_4_31[3] = { 0xCE, 0xCE, 0xCF };
static const symbol s_4_32[2] = { 0xC0, 0xD4 };
static const symbol s_4_33[3] = { 0xD5, 0xC0, 0xD4 };
static const symbol s_4_34[2] = { 0xC5, 0xD4 };
static const symbol s_4_35[3] = { 0xD5, 0xC5, 0xD4 };
static const symbol s_4_36[2] = { 0xC9, 0xD4 };
static const symbol s_4_37[2] = { 0xD1, 0xD4 };
static const symbol s_4_38[2] = { 0xD9, 0xD4 };
static const symbol s_4_39[2] = { 0xD4, 0xD8 };
static const symbol s_4_40[3] = { 0xC9, 0xD4, 0xD8 };
static const symbol s_4_41[3] = { 0xD9, 0xD4, 0xD8 };
static const symbol s_4_42[3] = { 0xC5, 0xDB, 0xD8 };
static const symbol s_4_43[3] = { 0xC9, 0xDB, 0xD8 };
static const symbol s_4_44[2] = { 0xCE, 0xD9 };
static const symbol s_4_45[3] = { 0xC5, 0xCE, 0xD9 };
static const struct among a_4[46] =
{
/* 0 */ { 1, s_4_0, -1, 2, 0},
/* 1 */ { 2, s_4_1, 0, 2, 0},
/* 2 */ { 2, s_4_2, -1, 1, 0},
/* 3 */ { 3, s_4_3, 2, 2, 0},
/* 4 */ { 3, s_4_4, 2, 2, 0},
/* 5 */ { 2, s_4_5, -1, 1, 0},
/* 6 */ { 3, s_4_6, 5, 2, 0},
/* 7 */ { 3, s_4_7, -1, 1, 0},
/* 8 */ { 3, s_4_8, -1, 2, 0},
/* 9 */ { 3, s_4_9, -1, 1, 0},
/* 10 */ { 4, s_4_10, 9, 2, 0},
/* 11 */ { 4, s_4_11, 9, 2, 0},
/* 12 */ { 2, s_4_12, -1, 1, 0},
/* 13 */ { 3, s_4_13, 12, 2, 0},
/* 14 */ { 3, s_4_14, 12, 2, 0},
/* 15 */ { 1, s_4_15, -1, 1, 0},
/* 16 */ { 2, s_4_16, 15, 2, 0},
/* 17 */ { 2, s_4_17, 15, 2, 0},
/* 18 */ { 1, s_4_18, -1, 1, 0},
/* 19 */ { 2, s_4_19, 18, 2, 0},
/* 20 */ { 2, s_4_20, 18, 2, 0},
/* 21 */ { 2, s_4_21, -1, 1, 0},
/* 22 */ { 2, s_4_22, -1, 2, 0},
/* 23 */ { 2, s_4_23, -1, 2, 0},
/* 24 */ { 1, s_4_24, -1, 1, 0},
/* 25 */ { 2, s_4_25, 24, 2, 0},
/* 26 */ { 2, s_4_26, -1, 1, 0},
/* 27 */ { 3, s_4_27, 26, 2, 0},
/* 28 */ { 3, s_4_28, 26, 2, 0},
/* 29 */ { 2, s_4_29, -1, 1, 0},
/* 30 */ { 3, s_4_30, 29, 2, 0},
/* 31 */ { 3, s_4_31, 29, 1, 0},
/* 32 */ { 2, s_4_32, -1, 1, 0},
/* 33 */ { 3, s_4_33, 32, 2, 0},
/* 34 */ { 2, s_4_34, -1, 1, 0},
/* 35 */ { 3, s_4_35, 34, 2, 0},
/* 36 */ { 2, s_4_36, -1, 2, 0},
/* 37 */ { 2, s_4_37, -1, 2, 0},
/* 38 */ { 2, s_4_38, -1, 2, 0},
/* 39 */ { 2, s_4_39, -1, 1, 0},
/* 40 */ { 3, s_4_40, 39, 2, 0},
/* 41 */ { 3, s_4_41, 39, 2, 0},
/* 42 */ { 3, s_4_42, -1, 1, 0},
/* 43 */ { 3, s_4_43, -1, 2, 0},
/* 44 */ { 2, s_4_44, -1, 1, 0},
/* 45 */ { 3, s_4_45, 44, 2, 0}
};
static const symbol s_5_0[1] = { 0xC0 };
static const symbol s_5_1[2] = { 0xC9, 0xC0 };
static const symbol s_5_2[2] = { 0xD8, 0xC0 };
static const symbol s_5_3[1] = { 0xC1 };
static const symbol s_5_4[1] = { 0xC5 };
static const symbol s_5_5[2] = { 0xC9, 0xC5 };
static const symbol s_5_6[2] = { 0xD8, 0xC5 };
static const symbol s_5_7[2] = { 0xC1, 0xC8 };
static const symbol s_5_8[2] = { 0xD1, 0xC8 };
static const symbol s_5_9[3] = { 0xC9, 0xD1, 0xC8 };
static const symbol s_5_10[1] = { 0xC9 };
static const symbol s_5_11[2] = { 0xC5, 0xC9 };
static const symbol s_5_12[2] = { 0xC9, 0xC9 };
static const symbol s_5_13[3] = { 0xC1, 0xCD, 0xC9 };
static const symbol s_5_14[3] = { 0xD1, 0xCD, 0xC9 };
static const symbol s_5_15[4] = { 0xC9, 0xD1, 0xCD, 0xC9 };
static const symbol s_5_16[1] = { 0xCA };
static const symbol s_5_17[2] = { 0xC5, 0xCA };
static const symbol s_5_18[3] = { 0xC9, 0xC5, 0xCA };
static const symbol s_5_19[2] = { 0xC9, 0xCA };
static const symbol s_5_20[2] = { 0xCF, 0xCA };
static const symbol s_5_21[2] = { 0xC1, 0xCD };
static const symbol s_5_22[2] = { 0xC5, 0xCD };
static const symbol s_5_23[3] = { 0xC9, 0xC5, 0xCD };
static const symbol s_5_24[2] = { 0xCF, 0xCD };
static const symbol s_5_25[2] = { 0xD1, 0xCD };
static const symbol s_5_26[3] = { 0xC9, 0xD1, 0xCD };
static const symbol s_5_27[1] = { 0xCF };
static const symbol s_5_28[1] = { 0xD1 };
static const symbol s_5_29[2] = { 0xC9, 0xD1 };
static const symbol s_5_30[2] = { 0xD8, 0xD1 };
static const symbol s_5_31[1] = { 0xD5 };
static const symbol s_5_32[2] = { 0xC5, 0xD7 };
static const symbol s_5_33[2] = { 0xCF, 0xD7 };
static const symbol s_5_34[1] = { 0xD8 };
static const symbol s_5_35[1] = { 0xD9 };
static const struct among a_5[36] =
{
/* 0 */ { 1, s_5_0, -1, 1, 0},
/* 1 */ { 2, s_5_1, 0, 1, 0},
/* 2 */ { 2, s_5_2, 0, 1, 0},
/* 3 */ { 1, s_5_3, -1, 1, 0},
/* 4 */ { 1, s_5_4, -1, 1, 0},
/* 5 */ { 2, s_5_5, 4, 1, 0},
/* 6 */ { 2, s_5_6, 4, 1, 0},
/* 7 */ { 2, s_5_7, -1, 1, 0},
/* 8 */ { 2, s_5_8, -1, 1, 0},
/* 9 */ { 3, s_5_9, 8, 1, 0},
/* 10 */ { 1, s_5_10, -1, 1, 0},
/* 11 */ { 2, s_5_11, 10, 1, 0},
/* 12 */ { 2, s_5_12, 10, 1, 0},
/* 13 */ { 3, s_5_13, 10, 1, 0},
/* 14 */ { 3, s_5_14, 10, 1, 0},
/* 15 */ { 4, s_5_15, 14, 1, 0},
/* 16 */ { 1, s_5_16, -1, 1, 0},
/* 17 */ { 2, s_5_17, 16, 1, 0},
/* 18 */ { 3, s_5_18, 17, 1, 0},
/* 19 */ { 2, s_5_19, 16, 1, 0},
/* 20 */ { 2, s_5_20, 16, 1, 0},
/* 21 */ { 2, s_5_21, -1, 1, 0},
/* 22 */ { 2, s_5_22, -1, 1, 0},
/* 23 */ { 3, s_5_23, 22, 1, 0},
/* 24 */ { 2, s_5_24, -1, 1, 0},
/* 25 */ { 2, s_5_25, -1, 1, 0},
/* 26 */ { 3, s_5_26, 25, 1, 0},
/* 27 */ { 1, s_5_27, -1, 1, 0},
/* 28 */ { 1, s_5_28, -1, 1, 0},
/* 29 */ { 2, s_5_29, 28, 1, 0},
/* 30 */ { 2, s_5_30, 28, 1, 0},
/* 31 */ { 1, s_5_31, -1, 1, 0},
/* 32 */ { 2, s_5_32, -1, 1, 0},
/* 33 */ { 2, s_5_33, -1, 1, 0},
/* 34 */ { 1, s_5_34, -1, 1, 0},
/* 35 */ { 1, s_5_35, -1, 1, 0}
};
static const symbol s_6_0[3] = { 0xCF, 0xD3, 0xD4 };
static const symbol s_6_1[4] = { 0xCF, 0xD3, 0xD4, 0xD8 };
static const struct among a_6[2] =
{
/* 0 */ { 3, s_6_0, -1, 1, 0},
/* 1 */ { 4, s_6_1, -1, 1, 0}
};
static const symbol s_7_0[4] = { 0xC5, 0xCA, 0xDB, 0xC5 };
static const symbol s_7_1[1] = { 0xCE };
static const symbol s_7_2[1] = { 0xD8 };
static const symbol s_7_3[3] = { 0xC5, 0xCA, 0xDB };
static const struct among a_7[4] =
{
/* 0 */ { 4, s_7_0, -1, 1, 0},
/* 1 */ { 1, s_7_1, -1, 2, 0},
/* 2 */ { 1, s_7_2, -1, 3, 0},
/* 3 */ { 3, s_7_3, -1, 1, 0}
};
static const unsigned char g_v[] = { 35, 130, 34, 18 };
static const symbol s_0[] = { 0xC1 };
static const symbol s_1[] = { 0xD1 };
static const symbol s_2[] = { 0xC1 };
static const symbol s_3[] = { 0xD1 };
static const symbol s_4[] = { 0xC1 };
static const symbol s_5[] = { 0xD1 };
static const symbol s_6[] = { 0xCE };
static const symbol s_7[] = { 0xCE };
static const symbol s_8[] = { 0xCE };
static const symbol s_9[] = { 0xC9 };
static int r_mark_regions(struct SN_env * z) {
z->I[0] = z->l;
z->I[1] = z->l;
{ int c1 = z->c; /* do, line 63 */
{ /* gopast */ /* grouping v, line 64 */
int ret = out_grouping(z, g_v, 192, 220, 1);
if (ret < 0) goto lab0;
z->c += ret;
}
z->I[0] = z->c; /* setmark pV, line 64 */
{ /* gopast */ /* non v, line 64 */
int ret = in_grouping(z, g_v, 192, 220, 1);
if (ret < 0) goto lab0;
z->c += ret;
}
{ /* gopast */ /* grouping v, line 65 */
int ret = out_grouping(z, g_v, 192, 220, 1);
if (ret < 0) goto lab0;
z->c += ret;
}
{ /* gopast */ /* non v, line 65 */
int ret = in_grouping(z, g_v, 192, 220, 1);
if (ret < 0) goto lab0;
z->c += ret;
}
z->I[1] = z->c; /* setmark p2, line 65 */
lab0:
z->c = c1;
}
return 1;
}
static int r_R2(struct SN_env * z) {
if (!(z->I[1] <= z->c)) return 0;
return 1;
}
static int r_perfective_gerund(struct SN_env * z) {
int among_var;
z->ket = z->c; /* [, line 74 */
if (z->c <= z->lb || z->p[z->c - 1] >> 5 != 6 || !((25166336 >> (z->p[z->c - 1] & 0x1f)) & 1)) return 0;
among_var = find_among_b(z, a_0, 9); /* substring, line 74 */
if (!(among_var)) return 0;
z->bra = z->c; /* ], line 74 */
switch(among_var) {
case 0: return 0;
case 1:
{ int m1 = z->l - z->c; (void)m1; /* or, line 78 */
if (!(eq_s_b(z, 1, s_0))) goto lab1;
goto lab0;
lab1:
z->c = z->l - m1;
if (!(eq_s_b(z, 1, s_1))) return 0;
}
lab0:
{ int ret = slice_del(z); /* delete, line 78 */
if (ret < 0) return ret;
}
break;
case 2:
{ int ret = slice_del(z); /* delete, line 85 */
if (ret < 0) return ret;
}
break;
}
return 1;
}
static int r_adjective(struct SN_env * z) {
int among_var;
z->ket = z->c; /* [, line 90 */
if (z->c - 1 <= z->lb || z->p[z->c - 1] >> 5 != 6 || !((2271009 >> (z->p[z->c - 1] & 0x1f)) & 1)) return 0;
among_var = find_among_b(z, a_1, 26); /* substring, line 90 */
if (!(among_var)) return 0;
z->bra = z->c; /* ], line 90 */
switch(among_var) {
case 0: return 0;
case 1:
{ int ret = slice_del(z); /* delete, line 99 */
if (ret < 0) return ret;
}
break;
}
return 1;
}
static int r_adjectival(struct SN_env * z) {
int among_var;
{ int ret = r_adjective(z);
if (ret == 0) return 0; /* call adjective, line 104 */
if (ret < 0) return ret;
}
{ int m_keep = z->l - z->c;/* (void) m_keep;*/ /* try, line 111 */
z->ket = z->c; /* [, line 112 */
if (z->c <= z->lb || z->p[z->c - 1] >> 5 != 6 || !((671113216 >> (z->p[z->c - 1] & 0x1f)) & 1)) { z->c = z->l - m_keep; goto lab0; }
among_var = find_among_b(z, a_2, 8); /* substring, line 112 */
if (!(among_var)) { z->c = z->l - m_keep; goto lab0; }
z->bra = z->c; /* ], line 112 */
switch(among_var) {
case 0: { z->c = z->l - m_keep; goto lab0; }
case 1:
{ int m1 = z->l - z->c; (void)m1; /* or, line 117 */
if (!(eq_s_b(z, 1, s_2))) goto lab2;
goto lab1;
lab2:
z->c = z->l - m1;
if (!(eq_s_b(z, 1, s_3))) { z->c = z->l - m_keep; goto lab0; }
}
lab1:
{ int ret = slice_del(z); /* delete, line 117 */
if (ret < 0) return ret;
}
break;
case 2:
{ int ret = slice_del(z); /* delete, line 124 */
if (ret < 0) return ret;
}
break;
}
lab0:
;
}
return 1;
}
static int r_reflexive(struct SN_env * z) {
int among_var;
z->ket = z->c; /* [, line 131 */
if (z->c - 1 <= z->lb || (z->p[z->c - 1] != 209 && z->p[z->c - 1] != 216)) return 0;
among_var = find_among_b(z, a_3, 2); /* substring, line 131 */
if (!(among_var)) return 0;
z->bra = z->c; /* ], line 131 */
switch(among_var) {
case 0: return 0;
case 1:
{ int ret = slice_del(z); /* delete, line 134 */
if (ret < 0) return ret;
}
break;
}
return 1;
}
static int r_verb(struct SN_env * z) {
int among_var;
z->ket = z->c; /* [, line 139 */
if (z->c <= z->lb || z->p[z->c - 1] >> 5 != 6 || !((51443235 >> (z->p[z->c - 1] & 0x1f)) & 1)) return 0;
among_var = find_among_b(z, a_4, 46); /* substring, line 139 */
if (!(among_var)) return 0;
z->bra = z->c; /* ], line 139 */
switch(among_var) {
case 0: return 0;
case 1:
{ int m1 = z->l - z->c; (void)m1; /* or, line 145 */
if (!(eq_s_b(z, 1, s_4))) goto lab1;
goto lab0;
lab1:
z->c = z->l - m1;
if (!(eq_s_b(z, 1, s_5))) return 0;
}
lab0:
{ int ret = slice_del(z); /* delete, line 145 */
if (ret < 0) return ret;
}
break;
case 2:
{ int ret = slice_del(z); /* delete, line 153 */
if (ret < 0) return ret;
}
break;
}
return 1;
}
static int r_noun(struct SN_env * z) {
int among_var;
z->ket = z->c; /* [, line 162 */
if (z->c <= z->lb || z->p[z->c - 1] >> 5 != 6 || !((60991267 >> (z->p[z->c - 1] & 0x1f)) & 1)) return 0;
among_var = find_among_b(z, a_5, 36); /* substring, line 162 */
if (!(among_var)) return 0;
z->bra = z->c; /* ], line 162 */
switch(among_var) {
case 0: return 0;
case 1:
{ int ret = slice_del(z); /* delete, line 169 */
if (ret < 0) return ret;
}
break;
}
return 1;
}
static int r_derivational(struct SN_env * z) {
int among_var;
z->ket = z->c; /* [, line 178 */
if (z->c - 2 <= z->lb || (z->p[z->c - 1] != 212 && z->p[z->c - 1] != 216)) return 0;
among_var = find_among_b(z, a_6, 2); /* substring, line 178 */
if (!(among_var)) return 0;
z->bra = z->c; /* ], line 178 */
{ int ret = r_R2(z);
if (ret == 0) return 0; /* call R2, line 178 */
if (ret < 0) return ret;
}
switch(among_var) {
case 0: return 0;
case 1:
{ int ret = slice_del(z); /* delete, line 181 */
if (ret < 0) return ret;
}
break;
}
return 1;
}
static int r_tidy_up(struct SN_env * z) {
int among_var;
z->ket = z->c; /* [, line 186 */
if (z->c <= z->lb || z->p[z->c - 1] >> 5 != 6 || !((151011360 >> (z->p[z->c - 1] & 0x1f)) & 1)) return 0;
among_var = find_among_b(z, a_7, 4); /* substring, line 186 */
if (!(among_var)) return 0;
z->bra = z->c; /* ], line 186 */
switch(among_var) {
case 0: return 0;
case 1:
{ int ret = slice_del(z); /* delete, line 190 */
if (ret < 0) return ret;
}
z->ket = z->c; /* [, line 191 */
if (!(eq_s_b(z, 1, s_6))) return 0;
z->bra = z->c; /* ], line 191 */
if (!(eq_s_b(z, 1, s_7))) return 0;
{ int ret = slice_del(z); /* delete, line 191 */
if (ret < 0) return ret;
}
break;
case 2:
if (!(eq_s_b(z, 1, s_8))) return 0;
{ int ret = slice_del(z); /* delete, line 194 */
if (ret < 0) return ret;
}
break;
case 3:
{ int ret = slice_del(z); /* delete, line 196 */
if (ret < 0) return ret;
}
break;
}
return 1;
}
extern int russian_KOI8_R_stem(struct SN_env * z) {
{ int c1 = z->c; /* do, line 203 */
{ int ret = r_mark_regions(z);
if (ret == 0) goto lab0; /* call mark_regions, line 203 */
if (ret < 0) return ret;
}
lab0:
z->c = c1;
}
z->lb = z->c; z->c = z->l; /* backwards, line 204 */
{ int mlimit; /* setlimit, line 204 */
int m2 = z->l - z->c; (void)m2;
if (z->c < z->I[0]) return 0;
z->c = z->I[0]; /* tomark, line 204 */
mlimit = z->lb; z->lb = z->c;
z->c = z->l - m2;
{ int m3 = z->l - z->c; (void)m3; /* do, line 205 */
{ int m4 = z->l - z->c; (void)m4; /* or, line 206 */
{ int ret = r_perfective_gerund(z);
if (ret == 0) goto lab3; /* call perfective_gerund, line 206 */
if (ret < 0) return ret;
}
goto lab2;
lab3:
z->c = z->l - m4;
{ int m_keep = z->l - z->c;/* (void) m_keep;*/ /* try, line 207 */
{ int ret = r_reflexive(z);
if (ret == 0) { z->c = z->l - m_keep; goto lab4; } /* call reflexive, line 207 */
if (ret < 0) return ret;
}
lab4:
;
}
{ int m5 = z->l - z->c; (void)m5; /* or, line 208 */
{ int ret = r_adjectival(z);
if (ret == 0) goto lab6; /* call adjectival, line 208 */
if (ret < 0) return ret;
}
goto lab5;
lab6:
z->c = z->l - m5;
{ int ret = r_verb(z);
if (ret == 0) goto lab7; /* call verb, line 208 */
if (ret < 0) return ret;
}
goto lab5;
lab7:
z->c = z->l - m5;
{ int ret = r_noun(z);
if (ret == 0) goto lab1; /* call noun, line 208 */
if (ret < 0) return ret;
}
}
lab5:
;
}
lab2:
lab1:
z->c = z->l - m3;
}
{ int m_keep = z->l - z->c;/* (void) m_keep;*/ /* try, line 211 */
z->ket = z->c; /* [, line 211 */
if (!(eq_s_b(z, 1, s_9))) { z->c = z->l - m_keep; goto lab8; }
z->bra = z->c; /* ], line 211 */
{ int ret = slice_del(z); /* delete, line 211 */
if (ret < 0) return ret;
}
lab8:
;
}
{ int m6 = z->l - z->c; (void)m6; /* do, line 214 */
{ int ret = r_derivational(z);
if (ret == 0) goto lab9; /* call derivational, line 214 */
if (ret < 0) return ret;
}
lab9:
z->c = z->l - m6;
}
{ int m7 = z->l - z->c; (void)m7; /* do, line 215 */
{ int ret = r_tidy_up(z);
if (ret == 0) goto lab10; /* call tidy_up, line 215 */
if (ret < 0) return ret;
}
lab10:
z->c = z->l - m7;
}
z->lb = mlimit;
}
z->c = z->lb;
return 1;
}
extern struct SN_env * russian_KOI8_R_create_env(void) { return SN_create_env(0, 2, 0); }
extern void russian_KOI8_R_close_env(struct SN_env * z) { SN_close_env(z, 0); }

View file

@ -1,16 +0,0 @@
/* This file was generated automatically by the Snowball to ANSI C compiler */
#ifdef __cplusplus
extern "C" {
#endif
extern struct SN_env * russian_KOI8_R_create_env(void);
extern void russian_KOI8_R_close_env(struct SN_env * z);
extern int russian_KOI8_R_stem(struct SN_env * z);
#ifdef __cplusplus
}
#endif

View file

@ -1,339 +0,0 @@
/* This file was generated automatically by the Snowball to ANSI C compiler */
#include "../runtime/header.h"
#ifdef __cplusplus
extern "C" {
#endif
extern int danish_UTF_8_stem(struct SN_env * z);
#ifdef __cplusplus
}
#endif
static int r_undouble(struct SN_env * z);
static int r_other_suffix(struct SN_env * z);
static int r_consonant_pair(struct SN_env * z);
static int r_main_suffix(struct SN_env * z);
static int r_mark_regions(struct SN_env * z);
#ifdef __cplusplus
extern "C" {
#endif
extern struct SN_env * danish_UTF_8_create_env(void);
extern void danish_UTF_8_close_env(struct SN_env * z);
#ifdef __cplusplus
}
#endif
static const symbol s_0_0[3] = { 'h', 'e', 'd' };
static const symbol s_0_1[5] = { 'e', 't', 'h', 'e', 'd' };
static const symbol s_0_2[4] = { 'e', 'r', 'e', 'd' };
static const symbol s_0_3[1] = { 'e' };
static const symbol s_0_4[5] = { 'e', 'r', 'e', 'd', 'e' };
static const symbol s_0_5[4] = { 'e', 'n', 'd', 'e' };
static const symbol s_0_6[6] = { 'e', 'r', 'e', 'n', 'd', 'e' };
static const symbol s_0_7[3] = { 'e', 'n', 'e' };
static const symbol s_0_8[4] = { 'e', 'r', 'n', 'e' };
static const symbol s_0_9[3] = { 'e', 'r', 'e' };
static const symbol s_0_10[2] = { 'e', 'n' };
static const symbol s_0_11[5] = { 'h', 'e', 'd', 'e', 'n' };
static const symbol s_0_12[4] = { 'e', 'r', 'e', 'n' };
static const symbol s_0_13[2] = { 'e', 'r' };
static const symbol s_0_14[5] = { 'h', 'e', 'd', 'e', 'r' };
static const symbol s_0_15[4] = { 'e', 'r', 'e', 'r' };
static const symbol s_0_16[1] = { 's' };
static const symbol s_0_17[4] = { 'h', 'e', 'd', 's' };
static const symbol s_0_18[2] = { 'e', 's' };
static const symbol s_0_19[5] = { 'e', 'n', 'd', 'e', 's' };
static const symbol s_0_20[7] = { 'e', 'r', 'e', 'n', 'd', 'e', 's' };
static const symbol s_0_21[4] = { 'e', 'n', 'e', 's' };
static const symbol s_0_22[5] = { 'e', 'r', 'n', 'e', 's' };
static const symbol s_0_23[4] = { 'e', 'r', 'e', 's' };
static const symbol s_0_24[3] = { 'e', 'n', 's' };
static const symbol s_0_25[6] = { 'h', 'e', 'd', 'e', 'n', 's' };
static const symbol s_0_26[5] = { 'e', 'r', 'e', 'n', 's' };
static const symbol s_0_27[3] = { 'e', 'r', 's' };
static const symbol s_0_28[3] = { 'e', 't', 's' };
static const symbol s_0_29[5] = { 'e', 'r', 'e', 't', 's' };
static const symbol s_0_30[2] = { 'e', 't' };
static const symbol s_0_31[4] = { 'e', 'r', 'e', 't' };
static const struct among a_0[32] =
{
/* 0 */ { 3, s_0_0, -1, 1, 0},
/* 1 */ { 5, s_0_1, 0, 1, 0},
/* 2 */ { 4, s_0_2, -1, 1, 0},
/* 3 */ { 1, s_0_3, -1, 1, 0},
/* 4 */ { 5, s_0_4, 3, 1, 0},
/* 5 */ { 4, s_0_5, 3, 1, 0},
/* 6 */ { 6, s_0_6, 5, 1, 0},
/* 7 */ { 3, s_0_7, 3, 1, 0},
/* 8 */ { 4, s_0_8, 3, 1, 0},
/* 9 */ { 3, s_0_9, 3, 1, 0},
/* 10 */ { 2, s_0_10, -1, 1, 0},
/* 11 */ { 5, s_0_11, 10, 1, 0},
/* 12 */ { 4, s_0_12, 10, 1, 0},
/* 13 */ { 2, s_0_13, -1, 1, 0},
/* 14 */ { 5, s_0_14, 13, 1, 0},
/* 15 */ { 4, s_0_15, 13, 1, 0},
/* 16 */ { 1, s_0_16, -1, 2, 0},
/* 17 */ { 4, s_0_17, 16, 1, 0},
/* 18 */ { 2, s_0_18, 16, 1, 0},
/* 19 */ { 5, s_0_19, 18, 1, 0},
/* 20 */ { 7, s_0_20, 19, 1, 0},
/* 21 */ { 4, s_0_21, 18, 1, 0},
/* 22 */ { 5, s_0_22, 18, 1, 0},
/* 23 */ { 4, s_0_23, 18, 1, 0},
/* 24 */ { 3, s_0_24, 16, 1, 0},
/* 25 */ { 6, s_0_25, 24, 1, 0},
/* 26 */ { 5, s_0_26, 24, 1, 0},
/* 27 */ { 3, s_0_27, 16, 1, 0},
/* 28 */ { 3, s_0_28, 16, 1, 0},
/* 29 */ { 5, s_0_29, 28, 1, 0},
/* 30 */ { 2, s_0_30, -1, 1, 0},
/* 31 */ { 4, s_0_31, 30, 1, 0}
};
static const symbol s_1_0[2] = { 'g', 'd' };
static const symbol s_1_1[2] = { 'd', 't' };
static const symbol s_1_2[2] = { 'g', 't' };
static const symbol s_1_3[2] = { 'k', 't' };
static const struct among a_1[4] =
{
/* 0 */ { 2, s_1_0, -1, -1, 0},
/* 1 */ { 2, s_1_1, -1, -1, 0},
/* 2 */ { 2, s_1_2, -1, -1, 0},
/* 3 */ { 2, s_1_3, -1, -1, 0}
};
static const symbol s_2_0[2] = { 'i', 'g' };
static const symbol s_2_1[3] = { 'l', 'i', 'g' };
static const symbol s_2_2[4] = { 'e', 'l', 'i', 'g' };
static const symbol s_2_3[3] = { 'e', 'l', 's' };
static const symbol s_2_4[5] = { 'l', 0xC3, 0xB8, 's', 't' };
static const struct among a_2[5] =
{
/* 0 */ { 2, s_2_0, -1, 1, 0},
/* 1 */ { 3, s_2_1, 0, 1, 0},
/* 2 */ { 4, s_2_2, 1, 1, 0},
/* 3 */ { 3, s_2_3, -1, 1, 0},
/* 4 */ { 5, s_2_4, -1, 2, 0}
};
static const unsigned char g_v[] = { 17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 0, 128 };
static const unsigned char g_s_ending[] = { 239, 254, 42, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16 };
static const symbol s_0[] = { 's', 't' };
static const symbol s_1[] = { 'i', 'g' };
static const symbol s_2[] = { 'l', 0xC3, 0xB8, 's' };
static int r_mark_regions(struct SN_env * z) {
z->I[0] = z->l;
{ int c_test = z->c; /* test, line 33 */
{ int ret = skip_utf8(z->p, z->c, 0, z->l, + 3);
if (ret < 0) return 0;
z->c = ret; /* hop, line 33 */
}
z->I[1] = z->c; /* setmark x, line 33 */
z->c = c_test;
}
if (out_grouping_U(z, g_v, 97, 248, 1) < 0) return 0; /* goto */ /* grouping v, line 34 */
{ /* gopast */ /* non v, line 34 */
int ret = in_grouping_U(z, g_v, 97, 248, 1);
if (ret < 0) return 0;
z->c += ret;
}
z->I[0] = z->c; /* setmark p1, line 34 */
/* try, line 35 */
if (!(z->I[0] < z->I[1])) goto lab0;
z->I[0] = z->I[1];
lab0:
return 1;
}
static int r_main_suffix(struct SN_env * z) {
int among_var;
{ int mlimit; /* setlimit, line 41 */
int m1 = z->l - z->c; (void)m1;
if (z->c < z->I[0]) return 0;
z->c = z->I[0]; /* tomark, line 41 */
mlimit = z->lb; z->lb = z->c;
z->c = z->l - m1;
z->ket = z->c; /* [, line 41 */
if (z->c <= z->lb || z->p[z->c - 1] >> 5 != 3 || !((1851440 >> (z->p[z->c - 1] & 0x1f)) & 1)) { z->lb = mlimit; return 0; }
among_var = find_among_b(z, a_0, 32); /* substring, line 41 */
if (!(among_var)) { z->lb = mlimit; return 0; }
z->bra = z->c; /* ], line 41 */
z->lb = mlimit;
}
switch(among_var) {
case 0: return 0;
case 1:
{ int ret = slice_del(z); /* delete, line 48 */
if (ret < 0) return ret;
}
break;
case 2:
if (in_grouping_b_U(z, g_s_ending, 97, 229, 0)) return 0;
{ int ret = slice_del(z); /* delete, line 50 */
if (ret < 0) return ret;
}
break;
}
return 1;
}
static int r_consonant_pair(struct SN_env * z) {
{ int m_test = z->l - z->c; /* test, line 55 */
{ int mlimit; /* setlimit, line 56 */
int m1 = z->l - z->c; (void)m1;
if (z->c < z->I[0]) return 0;
z->c = z->I[0]; /* tomark, line 56 */
mlimit = z->lb; z->lb = z->c;
z->c = z->l - m1;
z->ket = z->c; /* [, line 56 */
if (z->c - 1 <= z->lb || (z->p[z->c - 1] != 100 && z->p[z->c - 1] != 116)) { z->lb = mlimit; return 0; }
if (!(find_among_b(z, a_1, 4))) { z->lb = mlimit; return 0; } /* substring, line 56 */
z->bra = z->c; /* ], line 56 */
z->lb = mlimit;
}
z->c = z->l - m_test;
}
{ int ret = skip_utf8(z->p, z->c, z->lb, 0, -1);
if (ret < 0) return 0;
z->c = ret; /* next, line 62 */
}
z->bra = z->c; /* ], line 62 */
{ int ret = slice_del(z); /* delete, line 62 */
if (ret < 0) return ret;
}
return 1;
}
static int r_other_suffix(struct SN_env * z) {
int among_var;
{ int m1 = z->l - z->c; (void)m1; /* do, line 66 */
z->ket = z->c; /* [, line 66 */
if (!(eq_s_b(z, 2, s_0))) goto lab0;
z->bra = z->c; /* ], line 66 */
if (!(eq_s_b(z, 2, s_1))) goto lab0;
{ int ret = slice_del(z); /* delete, line 66 */
if (ret < 0) return ret;
}
lab0:
z->c = z->l - m1;
}
{ int mlimit; /* setlimit, line 67 */
int m2 = z->l - z->c; (void)m2;
if (z->c < z->I[0]) return 0;
z->c = z->I[0]; /* tomark, line 67 */
mlimit = z->lb; z->lb = z->c;
z->c = z->l - m2;
z->ket = z->c; /* [, line 67 */
if (z->c - 1 <= z->lb || z->p[z->c - 1] >> 5 != 3 || !((1572992 >> (z->p[z->c - 1] & 0x1f)) & 1)) { z->lb = mlimit; return 0; }
among_var = find_among_b(z, a_2, 5); /* substring, line 67 */
if (!(among_var)) { z->lb = mlimit; return 0; }
z->bra = z->c; /* ], line 67 */
z->lb = mlimit;
}
switch(among_var) {
case 0: return 0;
case 1:
{ int ret = slice_del(z); /* delete, line 70 */
if (ret < 0) return ret;
}
{ int m3 = z->l - z->c; (void)m3; /* do, line 70 */
{ int ret = r_consonant_pair(z);
if (ret == 0) goto lab1; /* call consonant_pair, line 70 */
if (ret < 0) return ret;
}
lab1:
z->c = z->l - m3;
}
break;
case 2:
{ int ret = slice_from_s(z, 4, s_2); /* <-, line 72 */
if (ret < 0) return ret;
}
break;
}
return 1;
}
static int r_undouble(struct SN_env * z) {
{ int mlimit; /* setlimit, line 76 */
int m1 = z->l - z->c; (void)m1;
if (z->c < z->I[0]) return 0;
z->c = z->I[0]; /* tomark, line 76 */
mlimit = z->lb; z->lb = z->c;
z->c = z->l - m1;
z->ket = z->c; /* [, line 76 */
if (out_grouping_b_U(z, g_v, 97, 248, 0)) { z->lb = mlimit; return 0; }
z->bra = z->c; /* ], line 76 */
z->S[0] = slice_to(z, z->S[0]); /* -> ch, line 76 */
if (z->S[0] == 0) return -1; /* -> ch, line 76 */
z->lb = mlimit;
}
if (!(eq_v_b(z, z->S[0]))) return 0; /* name ch, line 77 */
{ int ret = slice_del(z); /* delete, line 78 */
if (ret < 0) return ret;
}
return 1;
}
extern int danish_UTF_8_stem(struct SN_env * z) {
{ int c1 = z->c; /* do, line 84 */
{ int ret = r_mark_regions(z);
if (ret == 0) goto lab0; /* call mark_regions, line 84 */
if (ret < 0) return ret;
}
lab0:
z->c = c1;
}
z->lb = z->c; z->c = z->l; /* backwards, line 85 */
{ int m2 = z->l - z->c; (void)m2; /* do, line 86 */
{ int ret = r_main_suffix(z);
if (ret == 0) goto lab1; /* call main_suffix, line 86 */
if (ret < 0) return ret;
}
lab1:
z->c = z->l - m2;
}
{ int m3 = z->l - z->c; (void)m3; /* do, line 87 */
{ int ret = r_consonant_pair(z);
if (ret == 0) goto lab2; /* call consonant_pair, line 87 */
if (ret < 0) return ret;
}
lab2:
z->c = z->l - m3;
}
{ int m4 = z->l - z->c; (void)m4; /* do, line 88 */
{ int ret = r_other_suffix(z);
if (ret == 0) goto lab3; /* call other_suffix, line 88 */
if (ret < 0) return ret;
}
lab3:
z->c = z->l - m4;
}
{ int m5 = z->l - z->c; (void)m5; /* do, line 89 */
{ int ret = r_undouble(z);
if (ret == 0) goto lab4; /* call undouble, line 89 */
if (ret < 0) return ret;
}
lab4:
z->c = z->l - m5;
}
z->c = z->lb;
return 1;
}
extern struct SN_env * danish_UTF_8_create_env(void) { return SN_create_env(1, 2, 0); }
extern void danish_UTF_8_close_env(struct SN_env * z) { SN_close_env(z, 1); }

View file

@ -1,16 +0,0 @@
/* This file was generated automatically by the Snowball to ANSI C compiler */
#ifdef __cplusplus
extern "C" {
#endif
extern struct SN_env * danish_UTF_8_create_env(void);
extern void danish_UTF_8_close_env(struct SN_env * z);
extern int danish_UTF_8_stem(struct SN_env * z);
#ifdef __cplusplus
}
#endif

View file

@ -1,634 +0,0 @@
/* This file was generated automatically by the Snowball to ANSI C compiler */
#include "../runtime/header.h"
#ifdef __cplusplus
extern "C" {
#endif
extern int dutch_UTF_8_stem(struct SN_env * z);
#ifdef __cplusplus
}
#endif
static int r_standard_suffix(struct SN_env * z);
static int r_undouble(struct SN_env * z);
static int r_R2(struct SN_env * z);
static int r_R1(struct SN_env * z);
static int r_mark_regions(struct SN_env * z);
static int r_en_ending(struct SN_env * z);
static int r_e_ending(struct SN_env * z);
static int r_postlude(struct SN_env * z);
static int r_prelude(struct SN_env * z);
#ifdef __cplusplus
extern "C" {
#endif
extern struct SN_env * dutch_UTF_8_create_env(void);
extern void dutch_UTF_8_close_env(struct SN_env * z);
#ifdef __cplusplus
}
#endif
static const symbol s_0_1[2] = { 0xC3, 0xA1 };
static const symbol s_0_2[2] = { 0xC3, 0xA4 };
static const symbol s_0_3[2] = { 0xC3, 0xA9 };
static const symbol s_0_4[2] = { 0xC3, 0xAB };
static const symbol s_0_5[2] = { 0xC3, 0xAD };
static const symbol s_0_6[2] = { 0xC3, 0xAF };
static const symbol s_0_7[2] = { 0xC3, 0xB3 };
static const symbol s_0_8[2] = { 0xC3, 0xB6 };
static const symbol s_0_9[2] = { 0xC3, 0xBA };
static const symbol s_0_10[2] = { 0xC3, 0xBC };
static const struct among a_0[11] =
{
/* 0 */ { 0, 0, -1, 6, 0},
/* 1 */ { 2, s_0_1, 0, 1, 0},
/* 2 */ { 2, s_0_2, 0, 1, 0},
/* 3 */ { 2, s_0_3, 0, 2, 0},
/* 4 */ { 2, s_0_4, 0, 2, 0},
/* 5 */ { 2, s_0_5, 0, 3, 0},
/* 6 */ { 2, s_0_6, 0, 3, 0},
/* 7 */ { 2, s_0_7, 0, 4, 0},
/* 8 */ { 2, s_0_8, 0, 4, 0},
/* 9 */ { 2, s_0_9, 0, 5, 0},
/* 10 */ { 2, s_0_10, 0, 5, 0}
};
static const symbol s_1_1[1] = { 'I' };
static const symbol s_1_2[1] = { 'Y' };
static const struct among a_1[3] =
{
/* 0 */ { 0, 0, -1, 3, 0},
/* 1 */ { 1, s_1_1, 0, 2, 0},
/* 2 */ { 1, s_1_2, 0, 1, 0}
};
static const symbol s_2_0[2] = { 'd', 'd' };
static const symbol s_2_1[2] = { 'k', 'k' };
static const symbol s_2_2[2] = { 't', 't' };
static const struct among a_2[3] =
{
/* 0 */ { 2, s_2_0, -1, -1, 0},
/* 1 */ { 2, s_2_1, -1, -1, 0},
/* 2 */ { 2, s_2_2, -1, -1, 0}
};
static const symbol s_3_0[3] = { 'e', 'n', 'e' };
static const symbol s_3_1[2] = { 's', 'e' };
static const symbol s_3_2[2] = { 'e', 'n' };
static const symbol s_3_3[5] = { 'h', 'e', 'd', 'e', 'n' };
static const symbol s_3_4[1] = { 's' };
static const struct among a_3[5] =
{
/* 0 */ { 3, s_3_0, -1, 2, 0},
/* 1 */ { 2, s_3_1, -1, 3, 0},
/* 2 */ { 2, s_3_2, -1, 2, 0},
/* 3 */ { 5, s_3_3, 2, 1, 0},
/* 4 */ { 1, s_3_4, -1, 3, 0}
};
static const symbol s_4_0[3] = { 'e', 'n', 'd' };
static const symbol s_4_1[2] = { 'i', 'g' };
static const symbol s_4_2[3] = { 'i', 'n', 'g' };
static const symbol s_4_3[4] = { 'l', 'i', 'j', 'k' };
static const symbol s_4_4[4] = { 'b', 'a', 'a', 'r' };
static const symbol s_4_5[3] = { 'b', 'a', 'r' };
static const struct among a_4[6] =
{
/* 0 */ { 3, s_4_0, -1, 1, 0},
/* 1 */ { 2, s_4_1, -1, 2, 0},
/* 2 */ { 3, s_4_2, -1, 1, 0},
/* 3 */ { 4, s_4_3, -1, 3, 0},
/* 4 */ { 4, s_4_4, -1, 4, 0},
/* 5 */ { 3, s_4_5, -1, 5, 0}
};
static const symbol s_5_0[2] = { 'a', 'a' };
static const symbol s_5_1[2] = { 'e', 'e' };
static const symbol s_5_2[2] = { 'o', 'o' };
static const symbol s_5_3[2] = { 'u', 'u' };
static const struct among a_5[4] =
{
/* 0 */ { 2, s_5_0, -1, -1, 0},
/* 1 */ { 2, s_5_1, -1, -1, 0},
/* 2 */ { 2, s_5_2, -1, -1, 0},
/* 3 */ { 2, s_5_3, -1, -1, 0}
};
static const unsigned char g_v[] = { 17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128 };
static const unsigned char g_v_I[] = { 1, 0, 0, 17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128 };
static const unsigned char g_v_j[] = { 17, 67, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128 };
static const symbol s_0[] = { 'a' };
static const symbol s_1[] = { 'e' };
static const symbol s_2[] = { 'i' };
static const symbol s_3[] = { 'o' };
static const symbol s_4[] = { 'u' };
static const symbol s_5[] = { 'y' };
static const symbol s_6[] = { 'Y' };
static const symbol s_7[] = { 'i' };
static const symbol s_8[] = { 'I' };
static const symbol s_9[] = { 'y' };
static const symbol s_10[] = { 'Y' };
static const symbol s_11[] = { 'y' };
static const symbol s_12[] = { 'i' };
static const symbol s_13[] = { 'e' };
static const symbol s_14[] = { 'g', 'e', 'm' };
static const symbol s_15[] = { 'h', 'e', 'i', 'd' };
static const symbol s_16[] = { 'h', 'e', 'i', 'd' };
static const symbol s_17[] = { 'c' };
static const symbol s_18[] = { 'e', 'n' };
static const symbol s_19[] = { 'i', 'g' };
static const symbol s_20[] = { 'e' };
static const symbol s_21[] = { 'e' };
static int r_prelude(struct SN_env * z) {
int among_var;
{ int c_test = z->c; /* test, line 42 */
while(1) { /* repeat, line 42 */
int c1 = z->c;
z->bra = z->c; /* [, line 43 */
if (z->c + 1 >= z->l || z->p[z->c + 1] >> 5 != 5 || !((340306450 >> (z->p[z->c + 1] & 0x1f)) & 1)) among_var = 6; else
among_var = find_among(z, a_0, 11); /* substring, line 43 */
if (!(among_var)) goto lab0;
z->ket = z->c; /* ], line 43 */
switch(among_var) {
case 0: goto lab0;
case 1:
{ int ret = slice_from_s(z, 1, s_0); /* <-, line 45 */
if (ret < 0) return ret;
}
break;
case 2:
{ int ret = slice_from_s(z, 1, s_1); /* <-, line 47 */
if (ret < 0) return ret;
}
break;
case 3:
{ int ret = slice_from_s(z, 1, s_2); /* <-, line 49 */
if (ret < 0) return ret;
}
break;
case 4:
{ int ret = slice_from_s(z, 1, s_3); /* <-, line 51 */
if (ret < 0) return ret;
}
break;
case 5:
{ int ret = slice_from_s(z, 1, s_4); /* <-, line 53 */
if (ret < 0) return ret;
}
break;
case 6:
{ int ret = skip_utf8(z->p, z->c, 0, z->l, 1);
if (ret < 0) goto lab0;
z->c = ret; /* next, line 54 */
}
break;
}
continue;
lab0:
z->c = c1;
break;
}
z->c = c_test;
}
{ int c_keep = z->c; /* try, line 57 */
z->bra = z->c; /* [, line 57 */
if (!(eq_s(z, 1, s_5))) { z->c = c_keep; goto lab1; }
z->ket = z->c; /* ], line 57 */
{ int ret = slice_from_s(z, 1, s_6); /* <-, line 57 */
if (ret < 0) return ret;
}
lab1:
;
}
while(1) { /* repeat, line 58 */
int c2 = z->c;
while(1) { /* goto, line 58 */
int c3 = z->c;
if (in_grouping_U(z, g_v, 97, 232, 0)) goto lab3;
z->bra = z->c; /* [, line 59 */
{ int c4 = z->c; /* or, line 59 */
if (!(eq_s(z, 1, s_7))) goto lab5;
z->ket = z->c; /* ], line 59 */
if (in_grouping_U(z, g_v, 97, 232, 0)) goto lab5;
{ int ret = slice_from_s(z, 1, s_8); /* <-, line 59 */
if (ret < 0) return ret;
}
goto lab4;
lab5:
z->c = c4;
if (!(eq_s(z, 1, s_9))) goto lab3;
z->ket = z->c; /* ], line 60 */
{ int ret = slice_from_s(z, 1, s_10); /* <-, line 60 */
if (ret < 0) return ret;
}
}
lab4:
z->c = c3;
break;
lab3:
z->c = c3;
{ int ret = skip_utf8(z->p, z->c, 0, z->l, 1);
if (ret < 0) goto lab2;
z->c = ret; /* goto, line 58 */
}
}
continue;
lab2:
z->c = c2;
break;
}
return 1;
}
static int r_mark_regions(struct SN_env * z) {
z->I[0] = z->l;
z->I[1] = z->l;
{ /* gopast */ /* grouping v, line 69 */
int ret = out_grouping_U(z, g_v, 97, 232, 1);
if (ret < 0) return 0;
z->c += ret;
}
{ /* gopast */ /* non v, line 69 */
int ret = in_grouping_U(z, g_v, 97, 232, 1);
if (ret < 0) return 0;
z->c += ret;
}
z->I[0] = z->c; /* setmark p1, line 69 */
/* try, line 70 */
if (!(z->I[0] < 3)) goto lab0;
z->I[0] = 3;
lab0:
{ /* gopast */ /* grouping v, line 71 */
int ret = out_grouping_U(z, g_v, 97, 232, 1);
if (ret < 0) return 0;
z->c += ret;
}
{ /* gopast */ /* non v, line 71 */
int ret = in_grouping_U(z, g_v, 97, 232, 1);
if (ret < 0) return 0;
z->c += ret;
}
z->I[1] = z->c; /* setmark p2, line 71 */
return 1;
}
static int r_postlude(struct SN_env * z) {
int among_var;
while(1) { /* repeat, line 75 */
int c1 = z->c;
z->bra = z->c; /* [, line 77 */
if (z->c >= z->l || (z->p[z->c + 0] != 73 && z->p[z->c + 0] != 89)) among_var = 3; else
among_var = find_among(z, a_1, 3); /* substring, line 77 */
if (!(among_var)) goto lab0;
z->ket = z->c; /* ], line 77 */
switch(among_var) {
case 0: goto lab0;
case 1:
{ int ret = slice_from_s(z, 1, s_11); /* <-, line 78 */
if (ret < 0) return ret;
}
break;
case 2:
{ int ret = slice_from_s(z, 1, s_12); /* <-, line 79 */
if (ret < 0) return ret;
}
break;
case 3:
{ int ret = skip_utf8(z->p, z->c, 0, z->l, 1);
if (ret < 0) goto lab0;
z->c = ret; /* next, line 80 */
}
break;
}
continue;
lab0:
z->c = c1;
break;
}
return 1;
}
static int r_R1(struct SN_env * z) {
if (!(z->I[0] <= z->c)) return 0;
return 1;
}
static int r_R2(struct SN_env * z) {
if (!(z->I[1] <= z->c)) return 0;
return 1;
}
static int r_undouble(struct SN_env * z) {
{ int m_test = z->l - z->c; /* test, line 91 */
if (z->c - 1 <= z->lb || z->p[z->c - 1] >> 5 != 3 || !((1050640 >> (z->p[z->c - 1] & 0x1f)) & 1)) return 0;
if (!(find_among_b(z, a_2, 3))) return 0; /* among, line 91 */
z->c = z->l - m_test;
}
z->ket = z->c; /* [, line 91 */
{ int ret = skip_utf8(z->p, z->c, z->lb, 0, -1);
if (ret < 0) return 0;
z->c = ret; /* next, line 91 */
}
z->bra = z->c; /* ], line 91 */
{ int ret = slice_del(z); /* delete, line 91 */
if (ret < 0) return ret;
}
return 1;
}
static int r_e_ending(struct SN_env * z) {
z->B[0] = 0; /* unset e_found, line 95 */
z->ket = z->c; /* [, line 96 */
if (!(eq_s_b(z, 1, s_13))) return 0;
z->bra = z->c; /* ], line 96 */
{ int ret = r_R1(z);
if (ret == 0) return 0; /* call R1, line 96 */
if (ret < 0) return ret;
}
{ int m_test = z->l - z->c; /* test, line 96 */
if (out_grouping_b_U(z, g_v, 97, 232, 0)) return 0;
z->c = z->l - m_test;
}
{ int ret = slice_del(z); /* delete, line 96 */
if (ret < 0) return ret;
}
z->B[0] = 1; /* set e_found, line 97 */
{ int ret = r_undouble(z);
if (ret == 0) return 0; /* call undouble, line 98 */
if (ret < 0) return ret;
}
return 1;
}
static int r_en_ending(struct SN_env * z) {
{ int ret = r_R1(z);
if (ret == 0) return 0; /* call R1, line 102 */
if (ret < 0) return ret;
}
{ int m1 = z->l - z->c; (void)m1; /* and, line 102 */
if (out_grouping_b_U(z, g_v, 97, 232, 0)) return 0;
z->c = z->l - m1;
{ int m2 = z->l - z->c; (void)m2; /* not, line 102 */
if (!(eq_s_b(z, 3, s_14))) goto lab0;
return 0;
lab0:
z->c = z->l - m2;
}
}
{ int ret = slice_del(z); /* delete, line 102 */
if (ret < 0) return ret;
}
{ int ret = r_undouble(z);
if (ret == 0) return 0; /* call undouble, line 103 */
if (ret < 0) return ret;
}
return 1;
}
static int r_standard_suffix(struct SN_env * z) {
int among_var;
{ int m1 = z->l - z->c; (void)m1; /* do, line 107 */
z->ket = z->c; /* [, line 108 */
if (z->c <= z->lb || z->p[z->c - 1] >> 5 != 3 || !((540704 >> (z->p[z->c - 1] & 0x1f)) & 1)) goto lab0;
among_var = find_among_b(z, a_3, 5); /* substring, line 108 */
if (!(among_var)) goto lab0;
z->bra = z->c; /* ], line 108 */
switch(among_var) {
case 0: goto lab0;
case 1:
{ int ret = r_R1(z);
if (ret == 0) goto lab0; /* call R1, line 110 */
if (ret < 0) return ret;
}
{ int ret = slice_from_s(z, 4, s_15); /* <-, line 110 */
if (ret < 0) return ret;
}
break;
case 2:
{ int ret = r_en_ending(z);
if (ret == 0) goto lab0; /* call en_ending, line 113 */
if (ret < 0) return ret;
}
break;
case 3:
{ int ret = r_R1(z);
if (ret == 0) goto lab0; /* call R1, line 116 */
if (ret < 0) return ret;
}
if (out_grouping_b_U(z, g_v_j, 97, 232, 0)) goto lab0;
{ int ret = slice_del(z); /* delete, line 116 */
if (ret < 0) return ret;
}
break;
}
lab0:
z->c = z->l - m1;
}
{ int m2 = z->l - z->c; (void)m2; /* do, line 120 */
{ int ret = r_e_ending(z);
if (ret == 0) goto lab1; /* call e_ending, line 120 */
if (ret < 0) return ret;
}
lab1:
z->c = z->l - m2;
}
{ int m3 = z->l - z->c; (void)m3; /* do, line 122 */
z->ket = z->c; /* [, line 122 */
if (!(eq_s_b(z, 4, s_16))) goto lab2;
z->bra = z->c; /* ], line 122 */
{ int ret = r_R2(z);
if (ret == 0) goto lab2; /* call R2, line 122 */
if (ret < 0) return ret;
}
{ int m4 = z->l - z->c; (void)m4; /* not, line 122 */
if (!(eq_s_b(z, 1, s_17))) goto lab3;
goto lab2;
lab3:
z->c = z->l - m4;
}
{ int ret = slice_del(z); /* delete, line 122 */
if (ret < 0) return ret;
}
z->ket = z->c; /* [, line 123 */
if (!(eq_s_b(z, 2, s_18))) goto lab2;
z->bra = z->c; /* ], line 123 */
{ int ret = r_en_ending(z);
if (ret == 0) goto lab2; /* call en_ending, line 123 */
if (ret < 0) return ret;
}
lab2:
z->c = z->l - m3;
}
{ int m5 = z->l - z->c; (void)m5; /* do, line 126 */
z->ket = z->c; /* [, line 127 */
if (z->c - 1 <= z->lb || z->p[z->c - 1] >> 5 != 3 || !((264336 >> (z->p[z->c - 1] & 0x1f)) & 1)) goto lab4;
among_var = find_among_b(z, a_4, 6); /* substring, line 127 */
if (!(among_var)) goto lab4;
z->bra = z->c; /* ], line 127 */
switch(among_var) {
case 0: goto lab4;
case 1:
{ int ret = r_R2(z);
if (ret == 0) goto lab4; /* call R2, line 129 */
if (ret < 0) return ret;
}
{ int ret = slice_del(z); /* delete, line 129 */
if (ret < 0) return ret;
}
{ int m6 = z->l - z->c; (void)m6; /* or, line 130 */
z->ket = z->c; /* [, line 130 */
if (!(eq_s_b(z, 2, s_19))) goto lab6;
z->bra = z->c; /* ], line 130 */
{ int ret = r_R2(z);
if (ret == 0) goto lab6; /* call R2, line 130 */
if (ret < 0) return ret;
}
{ int m7 = z->l - z->c; (void)m7; /* not, line 130 */
if (!(eq_s_b(z, 1, s_20))) goto lab7;
goto lab6;
lab7:
z->c = z->l - m7;
}
{ int ret = slice_del(z); /* delete, line 130 */
if (ret < 0) return ret;
}
goto lab5;
lab6:
z->c = z->l - m6;
{ int ret = r_undouble(z);
if (ret == 0) goto lab4; /* call undouble, line 130 */
if (ret < 0) return ret;
}
}
lab5:
break;
case 2:
{ int ret = r_R2(z);
if (ret == 0) goto lab4; /* call R2, line 133 */
if (ret < 0) return ret;
}
{ int m8 = z->l - z->c; (void)m8; /* not, line 133 */
if (!(eq_s_b(z, 1, s_21))) goto lab8;
goto lab4;
lab8:
z->c = z->l - m8;
}
{ int ret = slice_del(z); /* delete, line 133 */
if (ret < 0) return ret;
}
break;
case 3:
{ int ret = r_R2(z);
if (ret == 0) goto lab4; /* call R2, line 136 */
if (ret < 0) return ret;
}
{ int ret = slice_del(z); /* delete, line 136 */
if (ret < 0) return ret;
}
{ int ret = r_e_ending(z);
if (ret == 0) goto lab4; /* call e_ending, line 136 */
if (ret < 0) return ret;
}
break;
case 4:
{ int ret = r_R2(z);
if (ret == 0) goto lab4; /* call R2, line 139 */
if (ret < 0) return ret;
}
{ int ret = slice_del(z); /* delete, line 139 */
if (ret < 0) return ret;
}
break;
case 5:
{ int ret = r_R2(z);
if (ret == 0) goto lab4; /* call R2, line 142 */
if (ret < 0) return ret;
}
if (!(z->B[0])) goto lab4; /* Boolean test e_found, line 142 */
{ int ret = slice_del(z); /* delete, line 142 */
if (ret < 0) return ret;
}
break;
}
lab4:
z->c = z->l - m5;
}
{ int m9 = z->l - z->c; (void)m9; /* do, line 146 */
if (out_grouping_b_U(z, g_v_I, 73, 232, 0)) goto lab9;
{ int m_test = z->l - z->c; /* test, line 148 */
if (z->c - 1 <= z->lb || z->p[z->c - 1] >> 5 != 3 || !((2129954 >> (z->p[z->c - 1] & 0x1f)) & 1)) goto lab9;
if (!(find_among_b(z, a_5, 4))) goto lab9; /* among, line 149 */
if (out_grouping_b_U(z, g_v, 97, 232, 0)) goto lab9;
z->c = z->l - m_test;
}
z->ket = z->c; /* [, line 152 */
{ int ret = skip_utf8(z->p, z->c, z->lb, 0, -1);
if (ret < 0) goto lab9;
z->c = ret; /* next, line 152 */
}
z->bra = z->c; /* ], line 152 */
{ int ret = slice_del(z); /* delete, line 152 */
if (ret < 0) return ret;
}
lab9:
z->c = z->l - m9;
}
return 1;
}
extern int dutch_UTF_8_stem(struct SN_env * z) {
{ int c1 = z->c; /* do, line 159 */
{ int ret = r_prelude(z);
if (ret == 0) goto lab0; /* call prelude, line 159 */
if (ret < 0) return ret;
}
lab0:
z->c = c1;
}
{ int c2 = z->c; /* do, line 160 */
{ int ret = r_mark_regions(z);
if (ret == 0) goto lab1; /* call mark_regions, line 160 */
if (ret < 0) return ret;
}
lab1:
z->c = c2;
}
z->lb = z->c; z->c = z->l; /* backwards, line 161 */
{ int m3 = z->l - z->c; (void)m3; /* do, line 162 */
{ int ret = r_standard_suffix(z);
if (ret == 0) goto lab2; /* call standard_suffix, line 162 */
if (ret < 0) return ret;
}
lab2:
z->c = z->l - m3;
}
z->c = z->lb;
{ int c4 = z->c; /* do, line 163 */
{ int ret = r_postlude(z);
if (ret == 0) goto lab3; /* call postlude, line 163 */
if (ret < 0) return ret;
}
lab3:
z->c = c4;
}
return 1;
}
extern struct SN_env * dutch_UTF_8_create_env(void) { return SN_create_env(0, 2, 1); }
extern void dutch_UTF_8_close_env(struct SN_env * z) { SN_close_env(z, 0); }

View file

@ -1,16 +0,0 @@
/* This file was generated automatically by the Snowball to ANSI C compiler */
#ifdef __cplusplus
extern "C" {
#endif
extern struct SN_env * dutch_UTF_8_create_env(void);
extern void dutch_UTF_8_close_env(struct SN_env * z);
extern int dutch_UTF_8_stem(struct SN_env * z);
#ifdef __cplusplus
}
#endif

File diff suppressed because it is too large Load diff

View file

@ -1,16 +0,0 @@
/* This file was generated automatically by the Snowball to ANSI C compiler */
#ifdef __cplusplus
extern "C" {
#endif
extern struct SN_env * english_UTF_8_create_env(void);
extern void english_UTF_8_close_env(struct SN_env * z);
extern int english_UTF_8_stem(struct SN_env * z);
#ifdef __cplusplus
}
#endif

View file

@ -1,768 +0,0 @@
/* This file was generated automatically by the Snowball to ANSI C compiler */
#include "../runtime/header.h"
#ifdef __cplusplus
extern "C" {
#endif
extern int finnish_UTF_8_stem(struct SN_env * z);
#ifdef __cplusplus
}
#endif
static int r_tidy(struct SN_env * z);
static int r_other_endings(struct SN_env * z);
static int r_t_plural(struct SN_env * z);
static int r_i_plural(struct SN_env * z);
static int r_case_ending(struct SN_env * z);
static int r_VI(struct SN_env * z);
static int r_LONG(struct SN_env * z);
static int r_possessive(struct SN_env * z);
static int r_particle_etc(struct SN_env * z);
static int r_R2(struct SN_env * z);
static int r_mark_regions(struct SN_env * z);
#ifdef __cplusplus
extern "C" {
#endif
extern struct SN_env * finnish_UTF_8_create_env(void);
extern void finnish_UTF_8_close_env(struct SN_env * z);
#ifdef __cplusplus
}
#endif
static const symbol s_0_0[2] = { 'p', 'a' };
static const symbol s_0_1[3] = { 's', 't', 'i' };
static const symbol s_0_2[4] = { 'k', 'a', 'a', 'n' };
static const symbol s_0_3[3] = { 'h', 'a', 'n' };
static const symbol s_0_4[3] = { 'k', 'i', 'n' };
static const symbol s_0_5[4] = { 'h', 0xC3, 0xA4, 'n' };
static const symbol s_0_6[6] = { 'k', 0xC3, 0xA4, 0xC3, 0xA4, 'n' };
static const symbol s_0_7[2] = { 'k', 'o' };
static const symbol s_0_8[3] = { 'p', 0xC3, 0xA4 };
static const symbol s_0_9[3] = { 'k', 0xC3, 0xB6 };
static const struct among a_0[10] =
{
/* 0 */ { 2, s_0_0, -1, 1, 0},
/* 1 */ { 3, s_0_1, -1, 2, 0},
/* 2 */ { 4, s_0_2, -1, 1, 0},
/* 3 */ { 3, s_0_3, -1, 1, 0},
/* 4 */ { 3, s_0_4, -1, 1, 0},
/* 5 */ { 4, s_0_5, -1, 1, 0},
/* 6 */ { 6, s_0_6, -1, 1, 0},
/* 7 */ { 2, s_0_7, -1, 1, 0},
/* 8 */ { 3, s_0_8, -1, 1, 0},
/* 9 */ { 3, s_0_9, -1, 1, 0}
};
static const symbol s_1_0[3] = { 'l', 'l', 'a' };
static const symbol s_1_1[2] = { 'n', 'a' };
static const symbol s_1_2[3] = { 's', 's', 'a' };
static const symbol s_1_3[2] = { 't', 'a' };
static const symbol s_1_4[3] = { 'l', 't', 'a' };
static const symbol s_1_5[3] = { 's', 't', 'a' };
static const struct among a_1[6] =
{
/* 0 */ { 3, s_1_0, -1, -1, 0},
/* 1 */ { 2, s_1_1, -1, -1, 0},
/* 2 */ { 3, s_1_2, -1, -1, 0},
/* 3 */ { 2, s_1_3, -1, -1, 0},
/* 4 */ { 3, s_1_4, 3, -1, 0},
/* 5 */ { 3, s_1_5, 3, -1, 0}
};
static const symbol s_2_0[4] = { 'l', 'l', 0xC3, 0xA4 };
static const symbol s_2_1[3] = { 'n', 0xC3, 0xA4 };
static const symbol s_2_2[4] = { 's', 's', 0xC3, 0xA4 };
static const symbol s_2_3[3] = { 't', 0xC3, 0xA4 };
static const symbol s_2_4[4] = { 'l', 't', 0xC3, 0xA4 };
static const symbol s_2_5[4] = { 's', 't', 0xC3, 0xA4 };
static const struct among a_2[6] =
{
/* 0 */ { 4, s_2_0, -1, -1, 0},
/* 1 */ { 3, s_2_1, -1, -1, 0},
/* 2 */ { 4, s_2_2, -1, -1, 0},
/* 3 */ { 3, s_2_3, -1, -1, 0},
/* 4 */ { 4, s_2_4, 3, -1, 0},
/* 5 */ { 4, s_2_5, 3, -1, 0}
};
static const symbol s_3_0[3] = { 'l', 'l', 'e' };
static const symbol s_3_1[3] = { 'i', 'n', 'e' };
static const struct among a_3[2] =
{
/* 0 */ { 3, s_3_0, -1, -1, 0},
/* 1 */ { 3, s_3_1, -1, -1, 0}
};
static const symbol s_4_0[3] = { 'n', 's', 'a' };
static const symbol s_4_1[3] = { 'm', 'm', 'e' };
static const symbol s_4_2[3] = { 'n', 'n', 'e' };
static const symbol s_4_3[2] = { 'n', 'i' };
static const symbol s_4_4[2] = { 's', 'i' };
static const symbol s_4_5[2] = { 'a', 'n' };
static const symbol s_4_6[2] = { 'e', 'n' };
static const symbol s_4_7[3] = { 0xC3, 0xA4, 'n' };
static const symbol s_4_8[4] = { 'n', 's', 0xC3, 0xA4 };
static const struct among a_4[9] =
{
/* 0 */ { 3, s_4_0, -1, 3, 0},
/* 1 */ { 3, s_4_1, -1, 3, 0},
/* 2 */ { 3, s_4_2, -1, 3, 0},
/* 3 */ { 2, s_4_3, -1, 2, 0},
/* 4 */ { 2, s_4_4, -1, 1, 0},
/* 5 */ { 2, s_4_5, -1, 4, 0},
/* 6 */ { 2, s_4_6, -1, 6, 0},
/* 7 */ { 3, s_4_7, -1, 5, 0},
/* 8 */ { 4, s_4_8, -1, 3, 0}
};
static const symbol s_5_0[2] = { 'a', 'a' };
static const symbol s_5_1[2] = { 'e', 'e' };
static const symbol s_5_2[2] = { 'i', 'i' };
static const symbol s_5_3[2] = { 'o', 'o' };
static const symbol s_5_4[2] = { 'u', 'u' };
static const symbol s_5_5[4] = { 0xC3, 0xA4, 0xC3, 0xA4 };
static const symbol s_5_6[4] = { 0xC3, 0xB6, 0xC3, 0xB6 };
static const struct among a_5[7] =
{
/* 0 */ { 2, s_5_0, -1, -1, 0},
/* 1 */ { 2, s_5_1, -1, -1, 0},
/* 2 */ { 2, s_5_2, -1, -1, 0},
/* 3 */ { 2, s_5_3, -1, -1, 0},
/* 4 */ { 2, s_5_4, -1, -1, 0},
/* 5 */ { 4, s_5_5, -1, -1, 0},
/* 6 */ { 4, s_5_6, -1, -1, 0}
};
static const symbol s_6_0[1] = { 'a' };
static const symbol s_6_1[3] = { 'l', 'l', 'a' };
static const symbol s_6_2[2] = { 'n', 'a' };
static const symbol s_6_3[3] = { 's', 's', 'a' };
static const symbol s_6_4[2] = { 't', 'a' };
static const symbol s_6_5[3] = { 'l', 't', 'a' };
static const symbol s_6_6[3] = { 's', 't', 'a' };
static const symbol s_6_7[3] = { 't', 't', 'a' };
static const symbol s_6_8[3] = { 'l', 'l', 'e' };
static const symbol s_6_9[3] = { 'i', 'n', 'e' };
static const symbol s_6_10[3] = { 'k', 's', 'i' };
static const symbol s_6_11[1] = { 'n' };
static const symbol s_6_12[3] = { 'h', 'a', 'n' };
static const symbol s_6_13[3] = { 'd', 'e', 'n' };
static const symbol s_6_14[4] = { 's', 'e', 'e', 'n' };
static const symbol s_6_15[3] = { 'h', 'e', 'n' };
static const symbol s_6_16[4] = { 't', 't', 'e', 'n' };
static const symbol s_6_17[3] = { 'h', 'i', 'n' };
static const symbol s_6_18[4] = { 's', 'i', 'i', 'n' };
static const symbol s_6_19[3] = { 'h', 'o', 'n' };
static const symbol s_6_20[4] = { 'h', 0xC3, 0xA4, 'n' };
static const symbol s_6_21[4] = { 'h', 0xC3, 0xB6, 'n' };
static const symbol s_6_22[2] = { 0xC3, 0xA4 };
static const symbol s_6_23[4] = { 'l', 'l', 0xC3, 0xA4 };
static const symbol s_6_24[3] = { 'n', 0xC3, 0xA4 };
static const symbol s_6_25[4] = { 's', 's', 0xC3, 0xA4 };
static const symbol s_6_26[3] = { 't', 0xC3, 0xA4 };
static const symbol s_6_27[4] = { 'l', 't', 0xC3, 0xA4 };
static const symbol s_6_28[4] = { 's', 't', 0xC3, 0xA4 };
static const symbol s_6_29[4] = { 't', 't', 0xC3, 0xA4 };
static const struct among a_6[30] =
{
/* 0 */ { 1, s_6_0, -1, 8, 0},
/* 1 */ { 3, s_6_1, 0, -1, 0},
/* 2 */ { 2, s_6_2, 0, -1, 0},
/* 3 */ { 3, s_6_3, 0, -1, 0},
/* 4 */ { 2, s_6_4, 0, -1, 0},
/* 5 */ { 3, s_6_5, 4, -1, 0},
/* 6 */ { 3, s_6_6, 4, -1, 0},
/* 7 */ { 3, s_6_7, 4, 9, 0},
/* 8 */ { 3, s_6_8, -1, -1, 0},
/* 9 */ { 3, s_6_9, -1, -1, 0},
/* 10 */ { 3, s_6_10, -1, -1, 0},
/* 11 */ { 1, s_6_11, -1, 7, 0},
/* 12 */ { 3, s_6_12, 11, 1, 0},
/* 13 */ { 3, s_6_13, 11, -1, r_VI},
/* 14 */ { 4, s_6_14, 11, -1, r_LONG},
/* 15 */ { 3, s_6_15, 11, 2, 0},
/* 16 */ { 4, s_6_16, 11, -1, r_VI},
/* 17 */ { 3, s_6_17, 11, 3, 0},
/* 18 */ { 4, s_6_18, 11, -1, r_VI},
/* 19 */ { 3, s_6_19, 11, 4, 0},
/* 20 */ { 4, s_6_20, 11, 5, 0},
/* 21 */ { 4, s_6_21, 11, 6, 0},
/* 22 */ { 2, s_6_22, -1, 8, 0},
/* 23 */ { 4, s_6_23, 22, -1, 0},
/* 24 */ { 3, s_6_24, 22, -1, 0},
/* 25 */ { 4, s_6_25, 22, -1, 0},
/* 26 */ { 3, s_6_26, 22, -1, 0},
/* 27 */ { 4, s_6_27, 26, -1, 0},
/* 28 */ { 4, s_6_28, 26, -1, 0},
/* 29 */ { 4, s_6_29, 26, 9, 0}
};
static const symbol s_7_0[3] = { 'e', 'j', 'a' };
static const symbol s_7_1[3] = { 'm', 'm', 'a' };
static const symbol s_7_2[4] = { 'i', 'm', 'm', 'a' };
static const symbol s_7_3[3] = { 'm', 'p', 'a' };
static const symbol s_7_4[4] = { 'i', 'm', 'p', 'a' };
static const symbol s_7_5[3] = { 'm', 'm', 'i' };
static const symbol s_7_6[4] = { 'i', 'm', 'm', 'i' };
static const symbol s_7_7[3] = { 'm', 'p', 'i' };
static const symbol s_7_8[4] = { 'i', 'm', 'p', 'i' };
static const symbol s_7_9[4] = { 'e', 'j', 0xC3, 0xA4 };
static const symbol s_7_10[4] = { 'm', 'm', 0xC3, 0xA4 };
static const symbol s_7_11[5] = { 'i', 'm', 'm', 0xC3, 0xA4 };
static const symbol s_7_12[4] = { 'm', 'p', 0xC3, 0xA4 };
static const symbol s_7_13[5] = { 'i', 'm', 'p', 0xC3, 0xA4 };
static const struct among a_7[14] =
{
/* 0 */ { 3, s_7_0, -1, -1, 0},
/* 1 */ { 3, s_7_1, -1, 1, 0},
/* 2 */ { 4, s_7_2, 1, -1, 0},
/* 3 */ { 3, s_7_3, -1, 1, 0},
/* 4 */ { 4, s_7_4, 3, -1, 0},
/* 5 */ { 3, s_7_5, -1, 1, 0},
/* 6 */ { 4, s_7_6, 5, -1, 0},
/* 7 */ { 3, s_7_7, -1, 1, 0},
/* 8 */ { 4, s_7_8, 7, -1, 0},
/* 9 */ { 4, s_7_9, -1, -1, 0},
/* 10 */ { 4, s_7_10, -1, 1, 0},
/* 11 */ { 5, s_7_11, 10, -1, 0},
/* 12 */ { 4, s_7_12, -1, 1, 0},
/* 13 */ { 5, s_7_13, 12, -1, 0}
};
static const symbol s_8_0[1] = { 'i' };
static const symbol s_8_1[1] = { 'j' };
static const struct among a_8[2] =
{
/* 0 */ { 1, s_8_0, -1, -1, 0},
/* 1 */ { 1, s_8_1, -1, -1, 0}
};
static const symbol s_9_0[3] = { 'm', 'm', 'a' };
static const symbol s_9_1[4] = { 'i', 'm', 'm', 'a' };
static const struct among a_9[2] =
{
/* 0 */ { 3, s_9_0, -1, 1, 0},
/* 1 */ { 4, s_9_1, 0, -1, 0}
};
static const unsigned char g_AEI[] = { 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8 };
static const unsigned char g_V1[] = { 17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 32 };
static const unsigned char g_V2[] = { 17, 65, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 32 };
static const unsigned char g_particle_end[] = { 17, 97, 24, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 32 };
static const symbol s_0[] = { 'k' };
static const symbol s_1[] = { 'k', 's', 'e' };
static const symbol s_2[] = { 'k', 's', 'i' };
static const symbol s_3[] = { 'i' };
static const symbol s_4[] = { 'a' };
static const symbol s_5[] = { 'e' };
static const symbol s_6[] = { 'i' };
static const symbol s_7[] = { 'o' };
static const symbol s_8[] = { 0xC3, 0xA4 };
static const symbol s_9[] = { 0xC3, 0xB6 };
static const symbol s_10[] = { 'i', 'e' };
static const symbol s_11[] = { 'e' };
static const symbol s_12[] = { 'p', 'o' };
static const symbol s_13[] = { 't' };
static const symbol s_14[] = { 'p', 'o' };
static const symbol s_15[] = { 'j' };
static const symbol s_16[] = { 'o' };
static const symbol s_17[] = { 'u' };
static const symbol s_18[] = { 'o' };
static const symbol s_19[] = { 'j' };
static int r_mark_regions(struct SN_env * z) {
z->I[0] = z->l;
z->I[1] = z->l;
if (out_grouping_U(z, g_V1, 97, 246, 1) < 0) return 0; /* goto */ /* grouping V1, line 46 */
{ /* gopast */ /* non V1, line 46 */
int ret = in_grouping_U(z, g_V1, 97, 246, 1);
if (ret < 0) return 0;
z->c += ret;
}
z->I[0] = z->c; /* setmark p1, line 46 */
if (out_grouping_U(z, g_V1, 97, 246, 1) < 0) return 0; /* goto */ /* grouping V1, line 47 */
{ /* gopast */ /* non V1, line 47 */
int ret = in_grouping_U(z, g_V1, 97, 246, 1);
if (ret < 0) return 0;
z->c += ret;
}
z->I[1] = z->c; /* setmark p2, line 47 */
return 1;
}
static int r_R2(struct SN_env * z) {
if (!(z->I[1] <= z->c)) return 0;
return 1;
}
static int r_particle_etc(struct SN_env * z) {
int among_var;
{ int mlimit; /* setlimit, line 55 */
int m1 = z->l - z->c; (void)m1;
if (z->c < z->I[0]) return 0;
z->c = z->I[0]; /* tomark, line 55 */
mlimit = z->lb; z->lb = z->c;
z->c = z->l - m1;
z->ket = z->c; /* [, line 55 */
among_var = find_among_b(z, a_0, 10); /* substring, line 55 */
if (!(among_var)) { z->lb = mlimit; return 0; }
z->bra = z->c; /* ], line 55 */
z->lb = mlimit;
}
switch(among_var) {
case 0: return 0;
case 1:
if (in_grouping_b_U(z, g_particle_end, 97, 246, 0)) return 0;
break;
case 2:
{ int ret = r_R2(z);
if (ret == 0) return 0; /* call R2, line 64 */
if (ret < 0) return ret;
}
break;
}
{ int ret = slice_del(z); /* delete, line 66 */
if (ret < 0) return ret;
}
return 1;
}
static int r_possessive(struct SN_env * z) {
int among_var;
{ int mlimit; /* setlimit, line 69 */
int m1 = z->l - z->c; (void)m1;
if (z->c < z->I[0]) return 0;
z->c = z->I[0]; /* tomark, line 69 */
mlimit = z->lb; z->lb = z->c;
z->c = z->l - m1;
z->ket = z->c; /* [, line 69 */
among_var = find_among_b(z, a_4, 9); /* substring, line 69 */
if (!(among_var)) { z->lb = mlimit; return 0; }
z->bra = z->c; /* ], line 69 */
z->lb = mlimit;
}
switch(among_var) {
case 0: return 0;
case 1:
{ int m2 = z->l - z->c; (void)m2; /* not, line 72 */
if (!(eq_s_b(z, 1, s_0))) goto lab0;
return 0;
lab0:
z->c = z->l - m2;
}
{ int ret = slice_del(z); /* delete, line 72 */
if (ret < 0) return ret;
}
break;
case 2:
{ int ret = slice_del(z); /* delete, line 74 */
if (ret < 0) return ret;
}
z->ket = z->c; /* [, line 74 */
if (!(eq_s_b(z, 3, s_1))) return 0;
z->bra = z->c; /* ], line 74 */
{ int ret = slice_from_s(z, 3, s_2); /* <-, line 74 */
if (ret < 0) return ret;
}
break;
case 3:
{ int ret = slice_del(z); /* delete, line 78 */
if (ret < 0) return ret;
}
break;
case 4:
if (z->c - 1 <= z->lb || z->p[z->c - 1] != 97) return 0;
if (!(find_among_b(z, a_1, 6))) return 0; /* among, line 81 */
{ int ret = slice_del(z); /* delete, line 81 */
if (ret < 0) return ret;
}
break;
case 5:
if (z->c - 2 <= z->lb || z->p[z->c - 1] != 164) return 0;
if (!(find_among_b(z, a_2, 6))) return 0; /* among, line 83 */
{ int ret = slice_del(z); /* delete, line 84 */
if (ret < 0) return ret;
}
break;
case 6:
if (z->c - 2 <= z->lb || z->p[z->c - 1] != 101) return 0;
if (!(find_among_b(z, a_3, 2))) return 0; /* among, line 86 */
{ int ret = slice_del(z); /* delete, line 86 */
if (ret < 0) return ret;
}
break;
}
return 1;
}
static int r_LONG(struct SN_env * z) {
if (!(find_among_b(z, a_5, 7))) return 0; /* among, line 91 */
return 1;
}
static int r_VI(struct SN_env * z) {
if (!(eq_s_b(z, 1, s_3))) return 0;
if (in_grouping_b_U(z, g_V2, 97, 246, 0)) return 0;
return 1;
}
static int r_case_ending(struct SN_env * z) {
int among_var;
{ int mlimit; /* setlimit, line 96 */
int m1 = z->l - z->c; (void)m1;
if (z->c < z->I[0]) return 0;
z->c = z->I[0]; /* tomark, line 96 */
mlimit = z->lb; z->lb = z->c;
z->c = z->l - m1;
z->ket = z->c; /* [, line 96 */
among_var = find_among_b(z, a_6, 30); /* substring, line 96 */
if (!(among_var)) { z->lb = mlimit; return 0; }
z->bra = z->c; /* ], line 96 */
z->lb = mlimit;
}
switch(among_var) {
case 0: return 0;
case 1:
if (!(eq_s_b(z, 1, s_4))) return 0;
break;
case 2:
if (!(eq_s_b(z, 1, s_5))) return 0;
break;
case 3:
if (!(eq_s_b(z, 1, s_6))) return 0;
break;
case 4:
if (!(eq_s_b(z, 1, s_7))) return 0;
break;
case 5:
if (!(eq_s_b(z, 2, s_8))) return 0;
break;
case 6:
if (!(eq_s_b(z, 2, s_9))) return 0;
break;
case 7:
{ int m_keep = z->l - z->c;/* (void) m_keep;*/ /* try, line 111 */
{ int m2 = z->l - z->c; (void)m2; /* and, line 113 */
{ int m3 = z->l - z->c; (void)m3; /* or, line 112 */
{ int ret = r_LONG(z);
if (ret == 0) goto lab2; /* call LONG, line 111 */
if (ret < 0) return ret;
}
goto lab1;
lab2:
z->c = z->l - m3;
if (!(eq_s_b(z, 2, s_10))) { z->c = z->l - m_keep; goto lab0; }
}
lab1:
z->c = z->l - m2;
{ int ret = skip_utf8(z->p, z->c, z->lb, 0, -1);
if (ret < 0) { z->c = z->l - m_keep; goto lab0; }
z->c = ret; /* next, line 113 */
}
}
z->bra = z->c; /* ], line 113 */
lab0:
;
}
break;
case 8:
if (in_grouping_b_U(z, g_V1, 97, 246, 0)) return 0;
if (out_grouping_b_U(z, g_V1, 97, 246, 0)) return 0;
break;
case 9:
if (!(eq_s_b(z, 1, s_11))) return 0;
break;
}
{ int ret = slice_del(z); /* delete, line 138 */
if (ret < 0) return ret;
}
z->B[0] = 1; /* set ending_removed, line 139 */
return 1;
}
static int r_other_endings(struct SN_env * z) {
int among_var;
{ int mlimit; /* setlimit, line 142 */
int m1 = z->l - z->c; (void)m1;
if (z->c < z->I[1]) return 0;
z->c = z->I[1]; /* tomark, line 142 */
mlimit = z->lb; z->lb = z->c;
z->c = z->l - m1;
z->ket = z->c; /* [, line 142 */
among_var = find_among_b(z, a_7, 14); /* substring, line 142 */
if (!(among_var)) { z->lb = mlimit; return 0; }
z->bra = z->c; /* ], line 142 */
z->lb = mlimit;
}
switch(among_var) {
case 0: return 0;
case 1:
{ int m2 = z->l - z->c; (void)m2; /* not, line 146 */
if (!(eq_s_b(z, 2, s_12))) goto lab0;
return 0;
lab0:
z->c = z->l - m2;
}
break;
}
{ int ret = slice_del(z); /* delete, line 151 */
if (ret < 0) return ret;
}
return 1;
}
static int r_i_plural(struct SN_env * z) {
{ int mlimit; /* setlimit, line 154 */
int m1 = z->l - z->c; (void)m1;
if (z->c < z->I[0]) return 0;
z->c = z->I[0]; /* tomark, line 154 */
mlimit = z->lb; z->lb = z->c;
z->c = z->l - m1;
z->ket = z->c; /* [, line 154 */
if (z->c <= z->lb || (z->p[z->c - 1] != 105 && z->p[z->c - 1] != 106)) { z->lb = mlimit; return 0; }
if (!(find_among_b(z, a_8, 2))) { z->lb = mlimit; return 0; } /* substring, line 154 */
z->bra = z->c; /* ], line 154 */
z->lb = mlimit;
}
{ int ret = slice_del(z); /* delete, line 158 */
if (ret < 0) return ret;
}
return 1;
}
static int r_t_plural(struct SN_env * z) {
int among_var;
{ int mlimit; /* setlimit, line 161 */
int m1 = z->l - z->c; (void)m1;
if (z->c < z->I[0]) return 0;
z->c = z->I[0]; /* tomark, line 161 */
mlimit = z->lb; z->lb = z->c;
z->c = z->l - m1;
z->ket = z->c; /* [, line 162 */
if (!(eq_s_b(z, 1, s_13))) { z->lb = mlimit; return 0; }
z->bra = z->c; /* ], line 162 */
{ int m_test = z->l - z->c; /* test, line 162 */
if (in_grouping_b_U(z, g_V1, 97, 246, 0)) { z->lb = mlimit; return 0; }
z->c = z->l - m_test;
}
{ int ret = slice_del(z); /* delete, line 163 */
if (ret < 0) return ret;
}
z->lb = mlimit;
}
{ int mlimit; /* setlimit, line 165 */
int m2 = z->l - z->c; (void)m2;
if (z->c < z->I[1]) return 0;
z->c = z->I[1]; /* tomark, line 165 */
mlimit = z->lb; z->lb = z->c;
z->c = z->l - m2;
z->ket = z->c; /* [, line 165 */
if (z->c - 2 <= z->lb || z->p[z->c - 1] != 97) { z->lb = mlimit; return 0; }
among_var = find_among_b(z, a_9, 2); /* substring, line 165 */
if (!(among_var)) { z->lb = mlimit; return 0; }
z->bra = z->c; /* ], line 165 */
z->lb = mlimit;
}
switch(among_var) {
case 0: return 0;
case 1:
{ int m3 = z->l - z->c; (void)m3; /* not, line 167 */
if (!(eq_s_b(z, 2, s_14))) goto lab0;
return 0;
lab0:
z->c = z->l - m3;
}
break;
}
{ int ret = slice_del(z); /* delete, line 170 */
if (ret < 0) return ret;
}
return 1;
}
static int r_tidy(struct SN_env * z) {
{ int mlimit; /* setlimit, line 173 */
int m1 = z->l - z->c; (void)m1;
if (z->c < z->I[0]) return 0;
z->c = z->I[0]; /* tomark, line 173 */
mlimit = z->lb; z->lb = z->c;
z->c = z->l - m1;
{ int m2 = z->l - z->c; (void)m2; /* do, line 174 */
{ int m3 = z->l - z->c; (void)m3; /* and, line 174 */
{ int ret = r_LONG(z);
if (ret == 0) goto lab0; /* call LONG, line 174 */
if (ret < 0) return ret;
}
z->c = z->l - m3;
z->ket = z->c; /* [, line 174 */
{ int ret = skip_utf8(z->p, z->c, z->lb, 0, -1);
if (ret < 0) goto lab0;
z->c = ret; /* next, line 174 */
}
z->bra = z->c; /* ], line 174 */
{ int ret = slice_del(z); /* delete, line 174 */
if (ret < 0) return ret;
}
}
lab0:
z->c = z->l - m2;
}
{ int m4 = z->l - z->c; (void)m4; /* do, line 175 */
z->ket = z->c; /* [, line 175 */
if (in_grouping_b_U(z, g_AEI, 97, 228, 0)) goto lab1;
z->bra = z->c; /* ], line 175 */
if (out_grouping_b_U(z, g_V1, 97, 246, 0)) goto lab1;
{ int ret = slice_del(z); /* delete, line 175 */
if (ret < 0) return ret;
}
lab1:
z->c = z->l - m4;
}
{ int m5 = z->l - z->c; (void)m5; /* do, line 176 */
z->ket = z->c; /* [, line 176 */
if (!(eq_s_b(z, 1, s_15))) goto lab2;
z->bra = z->c; /* ], line 176 */
{ int m6 = z->l - z->c; (void)m6; /* or, line 176 */
if (!(eq_s_b(z, 1, s_16))) goto lab4;
goto lab3;
lab4:
z->c = z->l - m6;
if (!(eq_s_b(z, 1, s_17))) goto lab2;
}
lab3:
{ int ret = slice_del(z); /* delete, line 176 */
if (ret < 0) return ret;
}
lab2:
z->c = z->l - m5;
}
{ int m7 = z->l - z->c; (void)m7; /* do, line 177 */
z->ket = z->c; /* [, line 177 */
if (!(eq_s_b(z, 1, s_18))) goto lab5;
z->bra = z->c; /* ], line 177 */
if (!(eq_s_b(z, 1, s_19))) goto lab5;
{ int ret = slice_del(z); /* delete, line 177 */
if (ret < 0) return ret;
}
lab5:
z->c = z->l - m7;
}
z->lb = mlimit;
}
if (in_grouping_b_U(z, g_V1, 97, 246, 1) < 0) return 0; /* goto */ /* non V1, line 179 */
z->ket = z->c; /* [, line 179 */
{ int ret = skip_utf8(z->p, z->c, z->lb, 0, -1);
if (ret < 0) return 0;
z->c = ret; /* next, line 179 */
}
z->bra = z->c; /* ], line 179 */
z->S[0] = slice_to(z, z->S[0]); /* -> x, line 179 */
if (z->S[0] == 0) return -1; /* -> x, line 179 */
if (!(eq_v_b(z, z->S[0]))) return 0; /* name x, line 179 */
{ int ret = slice_del(z); /* delete, line 179 */
if (ret < 0) return ret;
}
return 1;
}
extern int finnish_UTF_8_stem(struct SN_env * z) {
{ int c1 = z->c; /* do, line 185 */
{ int ret = r_mark_regions(z);
if (ret == 0) goto lab0; /* call mark_regions, line 185 */
if (ret < 0) return ret;
}
lab0:
z->c = c1;
}
z->B[0] = 0; /* unset ending_removed, line 186 */
z->lb = z->c; z->c = z->l; /* backwards, line 187 */
{ int m2 = z->l - z->c; (void)m2; /* do, line 188 */
{ int ret = r_particle_etc(z);
if (ret == 0) goto lab1; /* call particle_etc, line 188 */
if (ret < 0) return ret;
}
lab1:
z->c = z->l - m2;
}
{ int m3 = z->l - z->c; (void)m3; /* do, line 189 */
{ int ret = r_possessive(z);
if (ret == 0) goto lab2; /* call possessive, line 189 */
if (ret < 0) return ret;
}
lab2:
z->c = z->l - m3;
}
{ int m4 = z->l - z->c; (void)m4; /* do, line 190 */
{ int ret = r_case_ending(z);
if (ret == 0) goto lab3; /* call case_ending, line 190 */
if (ret < 0) return ret;
}
lab3:
z->c = z->l - m4;
}
{ int m5 = z->l - z->c; (void)m5; /* do, line 191 */
{ int ret = r_other_endings(z);
if (ret == 0) goto lab4; /* call other_endings, line 191 */
if (ret < 0) return ret;
}
lab4:
z->c = z->l - m5;
}
{ int m6 = z->l - z->c; (void)m6; /* or, line 192 */
if (!(z->B[0])) goto lab6; /* Boolean test ending_removed, line 192 */
{ int m7 = z->l - z->c; (void)m7; /* do, line 192 */
{ int ret = r_i_plural(z);
if (ret == 0) goto lab7; /* call i_plural, line 192 */
if (ret < 0) return ret;
}
lab7:
z->c = z->l - m7;
}
goto lab5;
lab6:
z->c = z->l - m6;
{ int m8 = z->l - z->c; (void)m8; /* do, line 192 */
{ int ret = r_t_plural(z);
if (ret == 0) goto lab8; /* call t_plural, line 192 */
if (ret < 0) return ret;
}
lab8:
z->c = z->l - m8;
}
}
lab5:
{ int m9 = z->l - z->c; (void)m9; /* do, line 193 */
{ int ret = r_tidy(z);
if (ret == 0) goto lab9; /* call tidy, line 193 */
if (ret < 0) return ret;
}
lab9:
z->c = z->l - m9;
}
z->c = z->lb;
return 1;
}
extern struct SN_env * finnish_UTF_8_create_env(void) { return SN_create_env(1, 2, 1); }
extern void finnish_UTF_8_close_env(struct SN_env * z) { SN_close_env(z, 1); }

View file

@ -1,16 +0,0 @@
/* This file was generated automatically by the Snowball to ANSI C compiler */
#ifdef __cplusplus
extern "C" {
#endif
extern struct SN_env * finnish_UTF_8_create_env(void);
extern void finnish_UTF_8_close_env(struct SN_env * z);
extern int finnish_UTF_8_stem(struct SN_env * z);
#ifdef __cplusplus
}
#endif

File diff suppressed because it is too large Load diff

View file

@ -1,16 +0,0 @@
/* This file was generated automatically by the Snowball to ANSI C compiler */
#ifdef __cplusplus
extern "C" {
#endif
extern struct SN_env * french_UTF_8_create_env(void);
extern void french_UTF_8_close_env(struct SN_env * z);
extern int french_UTF_8_stem(struct SN_env * z);
#ifdef __cplusplus
}
#endif

View file

@ -1,527 +0,0 @@
/* This file was generated automatically by the Snowball to ANSI C compiler */
#include "../runtime/header.h"
#ifdef __cplusplus
extern "C" {
#endif
extern int german_UTF_8_stem(struct SN_env * z);
#ifdef __cplusplus
}
#endif
static int r_standard_suffix(struct SN_env * z);
static int r_R2(struct SN_env * z);
static int r_R1(struct SN_env * z);
static int r_mark_regions(struct SN_env * z);
static int r_postlude(struct SN_env * z);
static int r_prelude(struct SN_env * z);
#ifdef __cplusplus
extern "C" {
#endif
extern struct SN_env * german_UTF_8_create_env(void);
extern void german_UTF_8_close_env(struct SN_env * z);
#ifdef __cplusplus
}
#endif
static const symbol s_0_1[1] = { 'U' };
static const symbol s_0_2[1] = { 'Y' };
static const symbol s_0_3[2] = { 0xC3, 0xA4 };
static const symbol s_0_4[2] = { 0xC3, 0xB6 };
static const symbol s_0_5[2] = { 0xC3, 0xBC };
static const struct among a_0[6] =
{
/* 0 */ { 0, 0, -1, 6, 0},
/* 1 */ { 1, s_0_1, 0, 2, 0},
/* 2 */ { 1, s_0_2, 0, 1, 0},
/* 3 */ { 2, s_0_3, 0, 3, 0},
/* 4 */ { 2, s_0_4, 0, 4, 0},
/* 5 */ { 2, s_0_5, 0, 5, 0}
};
static const symbol s_1_0[1] = { 'e' };
static const symbol s_1_1[2] = { 'e', 'm' };
static const symbol s_1_2[2] = { 'e', 'n' };
static const symbol s_1_3[3] = { 'e', 'r', 'n' };
static const symbol s_1_4[2] = { 'e', 'r' };
static const symbol s_1_5[1] = { 's' };
static const symbol s_1_6[2] = { 'e', 's' };
static const struct among a_1[7] =
{
/* 0 */ { 1, s_1_0, -1, 2, 0},
/* 1 */ { 2, s_1_1, -1, 1, 0},
/* 2 */ { 2, s_1_2, -1, 2, 0},
/* 3 */ { 3, s_1_3, -1, 1, 0},
/* 4 */ { 2, s_1_4, -1, 1, 0},
/* 5 */ { 1, s_1_5, -1, 3, 0},
/* 6 */ { 2, s_1_6, 5, 2, 0}
};
static const symbol s_2_0[2] = { 'e', 'n' };
static const symbol s_2_1[2] = { 'e', 'r' };
static const symbol s_2_2[2] = { 's', 't' };
static const symbol s_2_3[3] = { 'e', 's', 't' };
static const struct among a_2[4] =
{
/* 0 */ { 2, s_2_0, -1, 1, 0},
/* 1 */ { 2, s_2_1, -1, 1, 0},
/* 2 */ { 2, s_2_2, -1, 2, 0},
/* 3 */ { 3, s_2_3, 2, 1, 0}
};
static const symbol s_3_0[2] = { 'i', 'g' };
static const symbol s_3_1[4] = { 'l', 'i', 'c', 'h' };
static const struct among a_3[2] =
{
/* 0 */ { 2, s_3_0, -1, 1, 0},
/* 1 */ { 4, s_3_1, -1, 1, 0}
};
static const symbol s_4_0[3] = { 'e', 'n', 'd' };
static const symbol s_4_1[2] = { 'i', 'g' };
static const symbol s_4_2[3] = { 'u', 'n', 'g' };
static const symbol s_4_3[4] = { 'l', 'i', 'c', 'h' };
static const symbol s_4_4[4] = { 'i', 's', 'c', 'h' };
static const symbol s_4_5[2] = { 'i', 'k' };
static const symbol s_4_6[4] = { 'h', 'e', 'i', 't' };
static const symbol s_4_7[4] = { 'k', 'e', 'i', 't' };
static const struct among a_4[8] =
{
/* 0 */ { 3, s_4_0, -1, 1, 0},
/* 1 */ { 2, s_4_1, -1, 2, 0},
/* 2 */ { 3, s_4_2, -1, 1, 0},
/* 3 */ { 4, s_4_3, -1, 3, 0},
/* 4 */ { 4, s_4_4, -1, 2, 0},
/* 5 */ { 2, s_4_5, -1, 2, 0},
/* 6 */ { 4, s_4_6, -1, 3, 0},
/* 7 */ { 4, s_4_7, -1, 4, 0}
};
static const unsigned char g_v[] = { 17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 32, 8 };
static const unsigned char g_s_ending[] = { 117, 30, 5 };
static const unsigned char g_st_ending[] = { 117, 30, 4 };
static const symbol s_0[] = { 0xC3, 0x9F };
static const symbol s_1[] = { 's', 's' };
static const symbol s_2[] = { 'u' };
static const symbol s_3[] = { 'U' };
static const symbol s_4[] = { 'y' };
static const symbol s_5[] = { 'Y' };
static const symbol s_6[] = { 'y' };
static const symbol s_7[] = { 'u' };
static const symbol s_8[] = { 'a' };
static const symbol s_9[] = { 'o' };
static const symbol s_10[] = { 'u' };
static const symbol s_11[] = { 's' };
static const symbol s_12[] = { 'n', 'i', 's' };
static const symbol s_13[] = { 'i', 'g' };
static const symbol s_14[] = { 'e' };
static const symbol s_15[] = { 'e' };
static const symbol s_16[] = { 'e', 'r' };
static const symbol s_17[] = { 'e', 'n' };
static int r_prelude(struct SN_env * z) {
{ int c_test = z->c; /* test, line 35 */
while(1) { /* repeat, line 35 */
int c1 = z->c;
{ int c2 = z->c; /* or, line 38 */
z->bra = z->c; /* [, line 37 */
if (!(eq_s(z, 2, s_0))) goto lab2;
z->ket = z->c; /* ], line 37 */
{ int ret = slice_from_s(z, 2, s_1); /* <-, line 37 */
if (ret < 0) return ret;
}
goto lab1;
lab2:
z->c = c2;
{ int ret = skip_utf8(z->p, z->c, 0, z->l, 1);
if (ret < 0) goto lab0;
z->c = ret; /* next, line 38 */
}
}
lab1:
continue;
lab0:
z->c = c1;
break;
}
z->c = c_test;
}
while(1) { /* repeat, line 41 */
int c3 = z->c;
while(1) { /* goto, line 41 */
int c4 = z->c;
if (in_grouping_U(z, g_v, 97, 252, 0)) goto lab4;
z->bra = z->c; /* [, line 42 */
{ int c5 = z->c; /* or, line 42 */
if (!(eq_s(z, 1, s_2))) goto lab6;
z->ket = z->c; /* ], line 42 */
if (in_grouping_U(z, g_v, 97, 252, 0)) goto lab6;
{ int ret = slice_from_s(z, 1, s_3); /* <-, line 42 */
if (ret < 0) return ret;
}
goto lab5;
lab6:
z->c = c5;
if (!(eq_s(z, 1, s_4))) goto lab4;
z->ket = z->c; /* ], line 43 */
if (in_grouping_U(z, g_v, 97, 252, 0)) goto lab4;
{ int ret = slice_from_s(z, 1, s_5); /* <-, line 43 */
if (ret < 0) return ret;
}
}
lab5:
z->c = c4;
break;
lab4:
z->c = c4;
{ int ret = skip_utf8(z->p, z->c, 0, z->l, 1);
if (ret < 0) goto lab3;
z->c = ret; /* goto, line 41 */
}
}
continue;
lab3:
z->c = c3;
break;
}
return 1;
}
static int r_mark_regions(struct SN_env * z) {
z->I[0] = z->l;
z->I[1] = z->l;
{ int c_test = z->c; /* test, line 52 */
{ int ret = skip_utf8(z->p, z->c, 0, z->l, + 3);
if (ret < 0) return 0;
z->c = ret; /* hop, line 52 */
}
z->I[2] = z->c; /* setmark x, line 52 */
z->c = c_test;
}
{ /* gopast */ /* grouping v, line 54 */
int ret = out_grouping_U(z, g_v, 97, 252, 1);
if (ret < 0) return 0;
z->c += ret;
}
{ /* gopast */ /* non v, line 54 */
int ret = in_grouping_U(z, g_v, 97, 252, 1);
if (ret < 0) return 0;
z->c += ret;
}
z->I[0] = z->c; /* setmark p1, line 54 */
/* try, line 55 */
if (!(z->I[0] < z->I[2])) goto lab0;
z->I[0] = z->I[2];
lab0:
{ /* gopast */ /* grouping v, line 56 */
int ret = out_grouping_U(z, g_v, 97, 252, 1);
if (ret < 0) return 0;
z->c += ret;
}
{ /* gopast */ /* non v, line 56 */
int ret = in_grouping_U(z, g_v, 97, 252, 1);
if (ret < 0) return 0;
z->c += ret;
}
z->I[1] = z->c; /* setmark p2, line 56 */
return 1;
}
static int r_postlude(struct SN_env * z) {
int among_var;
while(1) { /* repeat, line 60 */
int c1 = z->c;
z->bra = z->c; /* [, line 62 */
among_var = find_among(z, a_0, 6); /* substring, line 62 */
if (!(among_var)) goto lab0;
z->ket = z->c; /* ], line 62 */
switch(among_var) {
case 0: goto lab0;
case 1:
{ int ret = slice_from_s(z, 1, s_6); /* <-, line 63 */
if (ret < 0) return ret;
}
break;
case 2:
{ int ret = slice_from_s(z, 1, s_7); /* <-, line 64 */
if (ret < 0) return ret;
}
break;
case 3:
{ int ret = slice_from_s(z, 1, s_8); /* <-, line 65 */
if (ret < 0) return ret;
}
break;
case 4:
{ int ret = slice_from_s(z, 1, s_9); /* <-, line 66 */
if (ret < 0) return ret;
}
break;
case 5:
{ int ret = slice_from_s(z, 1, s_10); /* <-, line 67 */
if (ret < 0) return ret;
}
break;
case 6:
{ int ret = skip_utf8(z->p, z->c, 0, z->l, 1);
if (ret < 0) goto lab0;
z->c = ret; /* next, line 68 */
}
break;
}
continue;
lab0:
z->c = c1;
break;
}
return 1;
}
static int r_R1(struct SN_env * z) {
if (!(z->I[0] <= z->c)) return 0;
return 1;
}
static int r_R2(struct SN_env * z) {
if (!(z->I[1] <= z->c)) return 0;
return 1;
}
static int r_standard_suffix(struct SN_env * z) {
int among_var;
{ int m1 = z->l - z->c; (void)m1; /* do, line 79 */
z->ket = z->c; /* [, line 80 */
if (z->c <= z->lb || z->p[z->c - 1] >> 5 != 3 || !((811040 >> (z->p[z->c - 1] & 0x1f)) & 1)) goto lab0;
among_var = find_among_b(z, a_1, 7); /* substring, line 80 */
if (!(among_var)) goto lab0;
z->bra = z->c; /* ], line 80 */
{ int ret = r_R1(z);
if (ret == 0) goto lab0; /* call R1, line 80 */
if (ret < 0) return ret;
}
switch(among_var) {
case 0: goto lab0;
case 1:
{ int ret = slice_del(z); /* delete, line 82 */
if (ret < 0) return ret;
}
break;
case 2:
{ int ret = slice_del(z); /* delete, line 85 */
if (ret < 0) return ret;
}
{ int m_keep = z->l - z->c;/* (void) m_keep;*/ /* try, line 86 */
z->ket = z->c; /* [, line 86 */
if (!(eq_s_b(z, 1, s_11))) { z->c = z->l - m_keep; goto lab1; }
z->bra = z->c; /* ], line 86 */
if (!(eq_s_b(z, 3, s_12))) { z->c = z->l - m_keep; goto lab1; }
{ int ret = slice_del(z); /* delete, line 86 */
if (ret < 0) return ret;
}
lab1:
;
}
break;
case 3:
if (in_grouping_b_U(z, g_s_ending, 98, 116, 0)) goto lab0;
{ int ret = slice_del(z); /* delete, line 89 */
if (ret < 0) return ret;
}
break;
}
lab0:
z->c = z->l - m1;
}
{ int m2 = z->l - z->c; (void)m2; /* do, line 93 */
z->ket = z->c; /* [, line 94 */
if (z->c - 1 <= z->lb || z->p[z->c - 1] >> 5 != 3 || !((1327104 >> (z->p[z->c - 1] & 0x1f)) & 1)) goto lab2;
among_var = find_among_b(z, a_2, 4); /* substring, line 94 */
if (!(among_var)) goto lab2;
z->bra = z->c; /* ], line 94 */
{ int ret = r_R1(z);
if (ret == 0) goto lab2; /* call R1, line 94 */
if (ret < 0) return ret;
}
switch(among_var) {
case 0: goto lab2;
case 1:
{ int ret = slice_del(z); /* delete, line 96 */
if (ret < 0) return ret;
}
break;
case 2:
if (in_grouping_b_U(z, g_st_ending, 98, 116, 0)) goto lab2;
{ int ret = skip_utf8(z->p, z->c, z->lb, z->l, - 3);
if (ret < 0) goto lab2;
z->c = ret; /* hop, line 99 */
}
{ int ret = slice_del(z); /* delete, line 99 */
if (ret < 0) return ret;
}
break;
}
lab2:
z->c = z->l - m2;
}
{ int m3 = z->l - z->c; (void)m3; /* do, line 103 */
z->ket = z->c; /* [, line 104 */
if (z->c - 1 <= z->lb || z->p[z->c - 1] >> 5 != 3 || !((1051024 >> (z->p[z->c - 1] & 0x1f)) & 1)) goto lab3;
among_var = find_among_b(z, a_4, 8); /* substring, line 104 */
if (!(among_var)) goto lab3;
z->bra = z->c; /* ], line 104 */
{ int ret = r_R2(z);
if (ret == 0) goto lab3; /* call R2, line 104 */
if (ret < 0) return ret;
}
switch(among_var) {
case 0: goto lab3;
case 1:
{ int ret = slice_del(z); /* delete, line 106 */
if (ret < 0) return ret;
}
{ int m_keep = z->l - z->c;/* (void) m_keep;*/ /* try, line 107 */
z->ket = z->c; /* [, line 107 */
if (!(eq_s_b(z, 2, s_13))) { z->c = z->l - m_keep; goto lab4; }
z->bra = z->c; /* ], line 107 */
{ int m4 = z->l - z->c; (void)m4; /* not, line 107 */
if (!(eq_s_b(z, 1, s_14))) goto lab5;
{ z->c = z->l - m_keep; goto lab4; }
lab5:
z->c = z->l - m4;
}
{ int ret = r_R2(z);
if (ret == 0) { z->c = z->l - m_keep; goto lab4; } /* call R2, line 107 */
if (ret < 0) return ret;
}
{ int ret = slice_del(z); /* delete, line 107 */
if (ret < 0) return ret;
}
lab4:
;
}
break;
case 2:
{ int m5 = z->l - z->c; (void)m5; /* not, line 110 */
if (!(eq_s_b(z, 1, s_15))) goto lab6;
goto lab3;
lab6:
z->c = z->l - m5;
}
{ int ret = slice_del(z); /* delete, line 110 */
if (ret < 0) return ret;
}
break;
case 3:
{ int ret = slice_del(z); /* delete, line 113 */
if (ret < 0) return ret;
}
{ int m_keep = z->l - z->c;/* (void) m_keep;*/ /* try, line 114 */
z->ket = z->c; /* [, line 115 */
{ int m6 = z->l - z->c; (void)m6; /* or, line 115 */
if (!(eq_s_b(z, 2, s_16))) goto lab9;
goto lab8;
lab9:
z->c = z->l - m6;
if (!(eq_s_b(z, 2, s_17))) { z->c = z->l - m_keep; goto lab7; }
}
lab8:
z->bra = z->c; /* ], line 115 */
{ int ret = r_R1(z);
if (ret == 0) { z->c = z->l - m_keep; goto lab7; } /* call R1, line 115 */
if (ret < 0) return ret;
}
{ int ret = slice_del(z); /* delete, line 115 */
if (ret < 0) return ret;
}
lab7:
;
}
break;
case 4:
{ int ret = slice_del(z); /* delete, line 119 */
if (ret < 0) return ret;
}
{ int m_keep = z->l - z->c;/* (void) m_keep;*/ /* try, line 120 */
z->ket = z->c; /* [, line 121 */
if (z->c - 1 <= z->lb || (z->p[z->c - 1] != 103 && z->p[z->c - 1] != 104)) { z->c = z->l - m_keep; goto lab10; }
among_var = find_among_b(z, a_3, 2); /* substring, line 121 */
if (!(among_var)) { z->c = z->l - m_keep; goto lab10; }
z->bra = z->c; /* ], line 121 */
{ int ret = r_R2(z);
if (ret == 0) { z->c = z->l - m_keep; goto lab10; } /* call R2, line 121 */
if (ret < 0) return ret;
}
switch(among_var) {
case 0: { z->c = z->l - m_keep; goto lab10; }
case 1:
{ int ret = slice_del(z); /* delete, line 123 */
if (ret < 0) return ret;
}
break;
}
lab10:
;
}
break;
}
lab3:
z->c = z->l - m3;
}
return 1;
}
extern int german_UTF_8_stem(struct SN_env * z) {
{ int c1 = z->c; /* do, line 134 */
{ int ret = r_prelude(z);
if (ret == 0) goto lab0; /* call prelude, line 134 */
if (ret < 0) return ret;
}
lab0:
z->c = c1;
}
{ int c2 = z->c; /* do, line 135 */
{ int ret = r_mark_regions(z);
if (ret == 0) goto lab1; /* call mark_regions, line 135 */
if (ret < 0) return ret;
}
lab1:
z->c = c2;
}
z->lb = z->c; z->c = z->l; /* backwards, line 136 */
{ int m3 = z->l - z->c; (void)m3; /* do, line 137 */
{ int ret = r_standard_suffix(z);
if (ret == 0) goto lab2; /* call standard_suffix, line 137 */
if (ret < 0) return ret;
}
lab2:
z->c = z->l - m3;
}
z->c = z->lb;
{ int c4 = z->c; /* do, line 138 */
{ int ret = r_postlude(z);
if (ret == 0) goto lab3; /* call postlude, line 138 */
if (ret < 0) return ret;
}
lab3:
z->c = c4;
}
return 1;
}
extern struct SN_env * german_UTF_8_create_env(void) { return SN_create_env(0, 3, 0); }
extern void german_UTF_8_close_env(struct SN_env * z) { SN_close_env(z, 0); }

View file

@ -1,16 +0,0 @@
/* This file was generated automatically by the Snowball to ANSI C compiler */
#ifdef __cplusplus
extern "C" {
#endif
extern struct SN_env * german_UTF_8_create_env(void);
extern void german_UTF_8_close_env(struct SN_env * z);
extern int german_UTF_8_stem(struct SN_env * z);
#ifdef __cplusplus
}
#endif

File diff suppressed because it is too large Load diff

View file

@ -1,16 +0,0 @@
/* This file was generated automatically by the Snowball to ANSI C compiler */
#ifdef __cplusplus
extern "C" {
#endif
extern struct SN_env * hungarian_UTF_8_create_env(void);
extern void hungarian_UTF_8_close_env(struct SN_env * z);
extern int hungarian_UTF_8_stem(struct SN_env * z);
#ifdef __cplusplus
}
#endif

File diff suppressed because it is too large Load diff

View file

@ -1,16 +0,0 @@
/* This file was generated automatically by the Snowball to ANSI C compiler */
#ifdef __cplusplus
extern "C" {
#endif
extern struct SN_env * italian_UTF_8_create_env(void);
extern void italian_UTF_8_close_env(struct SN_env * z);
extern int italian_UTF_8_stem(struct SN_env * z);
#ifdef __cplusplus
}
#endif

View file

@ -1,299 +0,0 @@
/* This file was generated automatically by the Snowball to ANSI C compiler */
#include "../runtime/header.h"
#ifdef __cplusplus
extern "C" {
#endif
extern int norwegian_UTF_8_stem(struct SN_env * z);
#ifdef __cplusplus
}
#endif
static int r_other_suffix(struct SN_env * z);
static int r_consonant_pair(struct SN_env * z);
static int r_main_suffix(struct SN_env * z);
static int r_mark_regions(struct SN_env * z);
#ifdef __cplusplus
extern "C" {
#endif
extern struct SN_env * norwegian_UTF_8_create_env(void);
extern void norwegian_UTF_8_close_env(struct SN_env * z);
#ifdef __cplusplus
}
#endif
static const symbol s_0_0[1] = { 'a' };
static const symbol s_0_1[1] = { 'e' };
static const symbol s_0_2[3] = { 'e', 'd', 'e' };
static const symbol s_0_3[4] = { 'a', 'n', 'd', 'e' };
static const symbol s_0_4[4] = { 'e', 'n', 'd', 'e' };
static const symbol s_0_5[3] = { 'a', 'n', 'e' };
static const symbol s_0_6[3] = { 'e', 'n', 'e' };
static const symbol s_0_7[6] = { 'h', 'e', 't', 'e', 'n', 'e' };
static const symbol s_0_8[4] = { 'e', 'r', 't', 'e' };
static const symbol s_0_9[2] = { 'e', 'n' };
static const symbol s_0_10[5] = { 'h', 'e', 't', 'e', 'n' };
static const symbol s_0_11[2] = { 'a', 'r' };
static const symbol s_0_12[2] = { 'e', 'r' };
static const symbol s_0_13[5] = { 'h', 'e', 't', 'e', 'r' };
static const symbol s_0_14[1] = { 's' };
static const symbol s_0_15[2] = { 'a', 's' };
static const symbol s_0_16[2] = { 'e', 's' };
static const symbol s_0_17[4] = { 'e', 'd', 'e', 's' };
static const symbol s_0_18[5] = { 'e', 'n', 'd', 'e', 's' };
static const symbol s_0_19[4] = { 'e', 'n', 'e', 's' };
static const symbol s_0_20[7] = { 'h', 'e', 't', 'e', 'n', 'e', 's' };
static const symbol s_0_21[3] = { 'e', 'n', 's' };
static const symbol s_0_22[6] = { 'h', 'e', 't', 'e', 'n', 's' };
static const symbol s_0_23[3] = { 'e', 'r', 's' };
static const symbol s_0_24[3] = { 'e', 't', 's' };
static const symbol s_0_25[2] = { 'e', 't' };
static const symbol s_0_26[3] = { 'h', 'e', 't' };
static const symbol s_0_27[3] = { 'e', 'r', 't' };
static const symbol s_0_28[3] = { 'a', 's', 't' };
static const struct among a_0[29] =
{
/* 0 */ { 1, s_0_0, -1, 1, 0},
/* 1 */ { 1, s_0_1, -1, 1, 0},
/* 2 */ { 3, s_0_2, 1, 1, 0},
/* 3 */ { 4, s_0_3, 1, 1, 0},
/* 4 */ { 4, s_0_4, 1, 1, 0},
/* 5 */ { 3, s_0_5, 1, 1, 0},
/* 6 */ { 3, s_0_6, 1, 1, 0},
/* 7 */ { 6, s_0_7, 6, 1, 0},
/* 8 */ { 4, s_0_8, 1, 3, 0},
/* 9 */ { 2, s_0_9, -1, 1, 0},
/* 10 */ { 5, s_0_10, 9, 1, 0},
/* 11 */ { 2, s_0_11, -1, 1, 0},
/* 12 */ { 2, s_0_12, -1, 1, 0},
/* 13 */ { 5, s_0_13, 12, 1, 0},
/* 14 */ { 1, s_0_14, -1, 2, 0},
/* 15 */ { 2, s_0_15, 14, 1, 0},
/* 16 */ { 2, s_0_16, 14, 1, 0},
/* 17 */ { 4, s_0_17, 16, 1, 0},
/* 18 */ { 5, s_0_18, 16, 1, 0},
/* 19 */ { 4, s_0_19, 16, 1, 0},
/* 20 */ { 7, s_0_20, 19, 1, 0},
/* 21 */ { 3, s_0_21, 14, 1, 0},
/* 22 */ { 6, s_0_22, 21, 1, 0},
/* 23 */ { 3, s_0_23, 14, 1, 0},
/* 24 */ { 3, s_0_24, 14, 1, 0},
/* 25 */ { 2, s_0_25, -1, 1, 0},
/* 26 */ { 3, s_0_26, 25, 1, 0},
/* 27 */ { 3, s_0_27, -1, 3, 0},
/* 28 */ { 3, s_0_28, -1, 1, 0}
};
static const symbol s_1_0[2] = { 'd', 't' };
static const symbol s_1_1[2] = { 'v', 't' };
static const struct among a_1[2] =
{
/* 0 */ { 2, s_1_0, -1, -1, 0},
/* 1 */ { 2, s_1_1, -1, -1, 0}
};
static const symbol s_2_0[3] = { 'l', 'e', 'g' };
static const symbol s_2_1[4] = { 'e', 'l', 'e', 'g' };
static const symbol s_2_2[2] = { 'i', 'g' };
static const symbol s_2_3[3] = { 'e', 'i', 'g' };
static const symbol s_2_4[3] = { 'l', 'i', 'g' };
static const symbol s_2_5[4] = { 'e', 'l', 'i', 'g' };
static const symbol s_2_6[3] = { 'e', 'l', 's' };
static const symbol s_2_7[3] = { 'l', 'o', 'v' };
static const symbol s_2_8[4] = { 'e', 'l', 'o', 'v' };
static const symbol s_2_9[4] = { 's', 'l', 'o', 'v' };
static const symbol s_2_10[7] = { 'h', 'e', 't', 's', 'l', 'o', 'v' };
static const struct among a_2[11] =
{
/* 0 */ { 3, s_2_0, -1, 1, 0},
/* 1 */ { 4, s_2_1, 0, 1, 0},
/* 2 */ { 2, s_2_2, -1, 1, 0},
/* 3 */ { 3, s_2_3, 2, 1, 0},
/* 4 */ { 3, s_2_4, 2, 1, 0},
/* 5 */ { 4, s_2_5, 4, 1, 0},
/* 6 */ { 3, s_2_6, -1, 1, 0},
/* 7 */ { 3, s_2_7, -1, 1, 0},
/* 8 */ { 4, s_2_8, 7, 1, 0},
/* 9 */ { 4, s_2_9, 7, 1, 0},
/* 10 */ { 7, s_2_10, 9, 1, 0}
};
static const unsigned char g_v[] = { 17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 0, 128 };
static const unsigned char g_s_ending[] = { 119, 125, 149, 1 };
static const symbol s_0[] = { 'k' };
static const symbol s_1[] = { 'e', 'r' };
static int r_mark_regions(struct SN_env * z) {
z->I[0] = z->l;
{ int c_test = z->c; /* test, line 30 */
{ int ret = skip_utf8(z->p, z->c, 0, z->l, + 3);
if (ret < 0) return 0;
z->c = ret; /* hop, line 30 */
}
z->I[1] = z->c; /* setmark x, line 30 */
z->c = c_test;
}
if (out_grouping_U(z, g_v, 97, 248, 1) < 0) return 0; /* goto */ /* grouping v, line 31 */
{ /* gopast */ /* non v, line 31 */
int ret = in_grouping_U(z, g_v, 97, 248, 1);
if (ret < 0) return 0;
z->c += ret;
}
z->I[0] = z->c; /* setmark p1, line 31 */
/* try, line 32 */
if (!(z->I[0] < z->I[1])) goto lab0;
z->I[0] = z->I[1];
lab0:
return 1;
}
static int r_main_suffix(struct SN_env * z) {
int among_var;
{ int mlimit; /* setlimit, line 38 */
int m1 = z->l - z->c; (void)m1;
if (z->c < z->I[0]) return 0;
z->c = z->I[0]; /* tomark, line 38 */
mlimit = z->lb; z->lb = z->c;
z->c = z->l - m1;
z->ket = z->c; /* [, line 38 */
if (z->c <= z->lb || z->p[z->c - 1] >> 5 != 3 || !((1851426 >> (z->p[z->c - 1] & 0x1f)) & 1)) { z->lb = mlimit; return 0; }
among_var = find_among_b(z, a_0, 29); /* substring, line 38 */
if (!(among_var)) { z->lb = mlimit; return 0; }
z->bra = z->c; /* ], line 38 */
z->lb = mlimit;
}
switch(among_var) {
case 0: return 0;
case 1:
{ int ret = slice_del(z); /* delete, line 44 */
if (ret < 0) return ret;
}
break;
case 2:
{ int m2 = z->l - z->c; (void)m2; /* or, line 46 */
if (in_grouping_b_U(z, g_s_ending, 98, 122, 0)) goto lab1;
goto lab0;
lab1:
z->c = z->l - m2;
if (!(eq_s_b(z, 1, s_0))) return 0;
if (out_grouping_b_U(z, g_v, 97, 248, 0)) return 0;
}
lab0:
{ int ret = slice_del(z); /* delete, line 46 */
if (ret < 0) return ret;
}
break;
case 3:
{ int ret = slice_from_s(z, 2, s_1); /* <-, line 48 */
if (ret < 0) return ret;
}
break;
}
return 1;
}
static int r_consonant_pair(struct SN_env * z) {
{ int m_test = z->l - z->c; /* test, line 53 */
{ int mlimit; /* setlimit, line 54 */
int m1 = z->l - z->c; (void)m1;
if (z->c < z->I[0]) return 0;
z->c = z->I[0]; /* tomark, line 54 */
mlimit = z->lb; z->lb = z->c;
z->c = z->l - m1;
z->ket = z->c; /* [, line 54 */
if (z->c - 1 <= z->lb || z->p[z->c - 1] != 116) { z->lb = mlimit; return 0; }
if (!(find_among_b(z, a_1, 2))) { z->lb = mlimit; return 0; } /* substring, line 54 */
z->bra = z->c; /* ], line 54 */
z->lb = mlimit;
}
z->c = z->l - m_test;
}
{ int ret = skip_utf8(z->p, z->c, z->lb, 0, -1);
if (ret < 0) return 0;
z->c = ret; /* next, line 59 */
}
z->bra = z->c; /* ], line 59 */
{ int ret = slice_del(z); /* delete, line 59 */
if (ret < 0) return ret;
}
return 1;
}
static int r_other_suffix(struct SN_env * z) {
int among_var;
{ int mlimit; /* setlimit, line 63 */
int m1 = z->l - z->c; (void)m1;
if (z->c < z->I[0]) return 0;
z->c = z->I[0]; /* tomark, line 63 */
mlimit = z->lb; z->lb = z->c;
z->c = z->l - m1;
z->ket = z->c; /* [, line 63 */
if (z->c - 1 <= z->lb || z->p[z->c - 1] >> 5 != 3 || !((4718720 >> (z->p[z->c - 1] & 0x1f)) & 1)) { z->lb = mlimit; return 0; }
among_var = find_among_b(z, a_2, 11); /* substring, line 63 */
if (!(among_var)) { z->lb = mlimit; return 0; }
z->bra = z->c; /* ], line 63 */
z->lb = mlimit;
}
switch(among_var) {
case 0: return 0;
case 1:
{ int ret = slice_del(z); /* delete, line 67 */
if (ret < 0) return ret;
}
break;
}
return 1;
}
extern int norwegian_UTF_8_stem(struct SN_env * z) {
{ int c1 = z->c; /* do, line 74 */
{ int ret = r_mark_regions(z);
if (ret == 0) goto lab0; /* call mark_regions, line 74 */
if (ret < 0) return ret;
}
lab0:
z->c = c1;
}
z->lb = z->c; z->c = z->l; /* backwards, line 75 */
{ int m2 = z->l - z->c; (void)m2; /* do, line 76 */
{ int ret = r_main_suffix(z);
if (ret == 0) goto lab1; /* call main_suffix, line 76 */
if (ret < 0) return ret;
}
lab1:
z->c = z->l - m2;
}
{ int m3 = z->l - z->c; (void)m3; /* do, line 77 */
{ int ret = r_consonant_pair(z);
if (ret == 0) goto lab2; /* call consonant_pair, line 77 */
if (ret < 0) return ret;
}
lab2:
z->c = z->l - m3;
}
{ int m4 = z->l - z->c; (void)m4; /* do, line 78 */
{ int ret = r_other_suffix(z);
if (ret == 0) goto lab3; /* call other_suffix, line 78 */
if (ret < 0) return ret;
}
lab3:
z->c = z->l - m4;
}
z->c = z->lb;
return 1;
}
extern struct SN_env * norwegian_UTF_8_create_env(void) { return SN_create_env(0, 2, 0); }
extern void norwegian_UTF_8_close_env(struct SN_env * z) { SN_close_env(z, 0); }

View file

@ -1,16 +0,0 @@
/* This file was generated automatically by the Snowball to ANSI C compiler */
#ifdef __cplusplus
extern "C" {
#endif
extern struct SN_env * norwegian_UTF_8_create_env(void);
extern void norwegian_UTF_8_close_env(struct SN_env * z);
extern int norwegian_UTF_8_stem(struct SN_env * z);
#ifdef __cplusplus
}
#endif

View file

@ -1,755 +0,0 @@
/* This file was generated automatically by the Snowball to ANSI C compiler */
#include "../runtime/header.h"
#ifdef __cplusplus
extern "C" {
#endif
extern int porter_UTF_8_stem(struct SN_env * z);
#ifdef __cplusplus
}
#endif
static int r_Step_5b(struct SN_env * z);
static int r_Step_5a(struct SN_env * z);
static int r_Step_4(struct SN_env * z);
static int r_Step_3(struct SN_env * z);
static int r_Step_2(struct SN_env * z);
static int r_Step_1c(struct SN_env * z);
static int r_Step_1b(struct SN_env * z);
static int r_Step_1a(struct SN_env * z);
static int r_R2(struct SN_env * z);
static int r_R1(struct SN_env * z);
static int r_shortv(struct SN_env * z);
#ifdef __cplusplus
extern "C" {
#endif
extern struct SN_env * porter_UTF_8_create_env(void);
extern void porter_UTF_8_close_env(struct SN_env * z);
#ifdef __cplusplus
}
#endif
static const symbol s_0_0[1] = { 's' };
static const symbol s_0_1[3] = { 'i', 'e', 's' };
static const symbol s_0_2[4] = { 's', 's', 'e', 's' };
static const symbol s_0_3[2] = { 's', 's' };
static const struct among a_0[4] =
{
/* 0 */ { 1, s_0_0, -1, 3, 0},
/* 1 */ { 3, s_0_1, 0, 2, 0},
/* 2 */ { 4, s_0_2, 0, 1, 0},
/* 3 */ { 2, s_0_3, 0, -1, 0}
};
static const symbol s_1_1[2] = { 'b', 'b' };
static const symbol s_1_2[2] = { 'd', 'd' };
static const symbol s_1_3[2] = { 'f', 'f' };
static const symbol s_1_4[2] = { 'g', 'g' };
static const symbol s_1_5[2] = { 'b', 'l' };
static const symbol s_1_6[2] = { 'm', 'm' };
static const symbol s_1_7[2] = { 'n', 'n' };
static const symbol s_1_8[2] = { 'p', 'p' };
static const symbol s_1_9[2] = { 'r', 'r' };
static const symbol s_1_10[2] = { 'a', 't' };
static const symbol s_1_11[2] = { 't', 't' };
static const symbol s_1_12[2] = { 'i', 'z' };
static const struct among a_1[13] =
{
/* 0 */ { 0, 0, -1, 3, 0},
/* 1 */ { 2, s_1_1, 0, 2, 0},
/* 2 */ { 2, s_1_2, 0, 2, 0},
/* 3 */ { 2, s_1_3, 0, 2, 0},
/* 4 */ { 2, s_1_4, 0, 2, 0},
/* 5 */ { 2, s_1_5, 0, 1, 0},
/* 6 */ { 2, s_1_6, 0, 2, 0},
/* 7 */ { 2, s_1_7, 0, 2, 0},
/* 8 */ { 2, s_1_8, 0, 2, 0},
/* 9 */ { 2, s_1_9, 0, 2, 0},
/* 10 */ { 2, s_1_10, 0, 1, 0},
/* 11 */ { 2, s_1_11, 0, 2, 0},
/* 12 */ { 2, s_1_12, 0, 1, 0}
};
static const symbol s_2_0[2] = { 'e', 'd' };
static const symbol s_2_1[3] = { 'e', 'e', 'd' };
static const symbol s_2_2[3] = { 'i', 'n', 'g' };
static const struct among a_2[3] =
{
/* 0 */ { 2, s_2_0, -1, 2, 0},
/* 1 */ { 3, s_2_1, 0, 1, 0},
/* 2 */ { 3, s_2_2, -1, 2, 0}
};
static const symbol s_3_0[4] = { 'a', 'n', 'c', 'i' };
static const symbol s_3_1[4] = { 'e', 'n', 'c', 'i' };
static const symbol s_3_2[4] = { 'a', 'b', 'l', 'i' };
static const symbol s_3_3[3] = { 'e', 'l', 'i' };
static const symbol s_3_4[4] = { 'a', 'l', 'l', 'i' };
static const symbol s_3_5[5] = { 'o', 'u', 's', 'l', 'i' };
static const symbol s_3_6[5] = { 'e', 'n', 't', 'l', 'i' };
static const symbol s_3_7[5] = { 'a', 'l', 'i', 't', 'i' };
static const symbol s_3_8[6] = { 'b', 'i', 'l', 'i', 't', 'i' };
static const symbol s_3_9[5] = { 'i', 'v', 'i', 't', 'i' };
static const symbol s_3_10[6] = { 't', 'i', 'o', 'n', 'a', 'l' };
static const symbol s_3_11[7] = { 'a', 't', 'i', 'o', 'n', 'a', 'l' };
static const symbol s_3_12[5] = { 'a', 'l', 'i', 's', 'm' };
static const symbol s_3_13[5] = { 'a', 't', 'i', 'o', 'n' };
static const symbol s_3_14[7] = { 'i', 'z', 'a', 't', 'i', 'o', 'n' };
static const symbol s_3_15[4] = { 'i', 'z', 'e', 'r' };
static const symbol s_3_16[4] = { 'a', 't', 'o', 'r' };
static const symbol s_3_17[7] = { 'i', 'v', 'e', 'n', 'e', 's', 's' };
static const symbol s_3_18[7] = { 'f', 'u', 'l', 'n', 'e', 's', 's' };
static const symbol s_3_19[7] = { 'o', 'u', 's', 'n', 'e', 's', 's' };
static const struct among a_3[20] =
{
/* 0 */ { 4, s_3_0, -1, 3, 0},
/* 1 */ { 4, s_3_1, -1, 2, 0},
/* 2 */ { 4, s_3_2, -1, 4, 0},
/* 3 */ { 3, s_3_3, -1, 6, 0},
/* 4 */ { 4, s_3_4, -1, 9, 0},
/* 5 */ { 5, s_3_5, -1, 12, 0},
/* 6 */ { 5, s_3_6, -1, 5, 0},
/* 7 */ { 5, s_3_7, -1, 10, 0},
/* 8 */ { 6, s_3_8, -1, 14, 0},
/* 9 */ { 5, s_3_9, -1, 13, 0},
/* 10 */ { 6, s_3_10, -1, 1, 0},
/* 11 */ { 7, s_3_11, 10, 8, 0},
/* 12 */ { 5, s_3_12, -1, 10, 0},
/* 13 */ { 5, s_3_13, -1, 8, 0},
/* 14 */ { 7, s_3_14, 13, 7, 0},
/* 15 */ { 4, s_3_15, -1, 7, 0},
/* 16 */ { 4, s_3_16, -1, 8, 0},
/* 17 */ { 7, s_3_17, -1, 13, 0},
/* 18 */ { 7, s_3_18, -1, 11, 0},
/* 19 */ { 7, s_3_19, -1, 12, 0}
};
static const symbol s_4_0[5] = { 'i', 'c', 'a', 't', 'e' };
static const symbol s_4_1[5] = { 'a', 't', 'i', 'v', 'e' };
static const symbol s_4_2[5] = { 'a', 'l', 'i', 'z', 'e' };
static const symbol s_4_3[5] = { 'i', 'c', 'i', 't', 'i' };
static const symbol s_4_4[4] = { 'i', 'c', 'a', 'l' };
static const symbol s_4_5[3] = { 'f', 'u', 'l' };
static const symbol s_4_6[4] = { 'n', 'e', 's', 's' };
static const struct among a_4[7] =
{
/* 0 */ { 5, s_4_0, -1, 2, 0},
/* 1 */ { 5, s_4_1, -1, 3, 0},
/* 2 */ { 5, s_4_2, -1, 1, 0},
/* 3 */ { 5, s_4_3, -1, 2, 0},
/* 4 */ { 4, s_4_4, -1, 2, 0},
/* 5 */ { 3, s_4_5, -1, 3, 0},
/* 6 */ { 4, s_4_6, -1, 3, 0}
};
static const symbol s_5_0[2] = { 'i', 'c' };
static const symbol s_5_1[4] = { 'a', 'n', 'c', 'e' };
static const symbol s_5_2[4] = { 'e', 'n', 'c', 'e' };
static const symbol s_5_3[4] = { 'a', 'b', 'l', 'e' };
static const symbol s_5_4[4] = { 'i', 'b', 'l', 'e' };
static const symbol s_5_5[3] = { 'a', 't', 'e' };
static const symbol s_5_6[3] = { 'i', 'v', 'e' };
static const symbol s_5_7[3] = { 'i', 'z', 'e' };
static const symbol s_5_8[3] = { 'i', 't', 'i' };
static const symbol s_5_9[2] = { 'a', 'l' };
static const symbol s_5_10[3] = { 'i', 's', 'm' };
static const symbol s_5_11[3] = { 'i', 'o', 'n' };
static const symbol s_5_12[2] = { 'e', 'r' };
static const symbol s_5_13[3] = { 'o', 'u', 's' };
static const symbol s_5_14[3] = { 'a', 'n', 't' };
static const symbol s_5_15[3] = { 'e', 'n', 't' };
static const symbol s_5_16[4] = { 'm', 'e', 'n', 't' };
static const symbol s_5_17[5] = { 'e', 'm', 'e', 'n', 't' };
static const symbol s_5_18[2] = { 'o', 'u' };
static const struct among a_5[19] =
{
/* 0 */ { 2, s_5_0, -1, 1, 0},
/* 1 */ { 4, s_5_1, -1, 1, 0},
/* 2 */ { 4, s_5_2, -1, 1, 0},
/* 3 */ { 4, s_5_3, -1, 1, 0},
/* 4 */ { 4, s_5_4, -1, 1, 0},
/* 5 */ { 3, s_5_5, -1, 1, 0},
/* 6 */ { 3, s_5_6, -1, 1, 0},
/* 7 */ { 3, s_5_7, -1, 1, 0},
/* 8 */ { 3, s_5_8, -1, 1, 0},
/* 9 */ { 2, s_5_9, -1, 1, 0},
/* 10 */ { 3, s_5_10, -1, 1, 0},
/* 11 */ { 3, s_5_11, -1, 2, 0},
/* 12 */ { 2, s_5_12, -1, 1, 0},
/* 13 */ { 3, s_5_13, -1, 1, 0},
/* 14 */ { 3, s_5_14, -1, 1, 0},
/* 15 */ { 3, s_5_15, -1, 1, 0},
/* 16 */ { 4, s_5_16, 15, 1, 0},
/* 17 */ { 5, s_5_17, 16, 1, 0},
/* 18 */ { 2, s_5_18, -1, 1, 0}
};
static const unsigned char g_v[] = { 17, 65, 16, 1 };
static const unsigned char g_v_WXY[] = { 1, 17, 65, 208, 1 };
static const symbol s_0[] = { 's', 's' };
static const symbol s_1[] = { 'i' };
static const symbol s_2[] = { 'e', 'e' };
static const symbol s_3[] = { 'e' };
static const symbol s_4[] = { 'e' };
static const symbol s_5[] = { 'y' };
static const symbol s_6[] = { 'Y' };
static const symbol s_7[] = { 'i' };
static const symbol s_8[] = { 't', 'i', 'o', 'n' };
static const symbol s_9[] = { 'e', 'n', 'c', 'e' };
static const symbol s_10[] = { 'a', 'n', 'c', 'e' };
static const symbol s_11[] = { 'a', 'b', 'l', 'e' };
static const symbol s_12[] = { 'e', 'n', 't' };
static const symbol s_13[] = { 'e' };
static const symbol s_14[] = { 'i', 'z', 'e' };
static const symbol s_15[] = { 'a', 't', 'e' };
static const symbol s_16[] = { 'a', 'l' };
static const symbol s_17[] = { 'a', 'l' };
static const symbol s_18[] = { 'f', 'u', 'l' };
static const symbol s_19[] = { 'o', 'u', 's' };
static const symbol s_20[] = { 'i', 'v', 'e' };
static const symbol s_21[] = { 'b', 'l', 'e' };
static const symbol s_22[] = { 'a', 'l' };
static const symbol s_23[] = { 'i', 'c' };
static const symbol s_24[] = { 's' };
static const symbol s_25[] = { 't' };
static const symbol s_26[] = { 'e' };
static const symbol s_27[] = { 'l' };
static const symbol s_28[] = { 'l' };
static const symbol s_29[] = { 'y' };
static const symbol s_30[] = { 'Y' };
static const symbol s_31[] = { 'y' };
static const symbol s_32[] = { 'Y' };
static const symbol s_33[] = { 'Y' };
static const symbol s_34[] = { 'y' };
static int r_shortv(struct SN_env * z) {
if (out_grouping_b_U(z, g_v_WXY, 89, 121, 0)) return 0;
if (in_grouping_b_U(z, g_v, 97, 121, 0)) return 0;
if (out_grouping_b_U(z, g_v, 97, 121, 0)) return 0;
return 1;
}
static int r_R1(struct SN_env * z) {
if (!(z->I[0] <= z->c)) return 0;
return 1;
}
static int r_R2(struct SN_env * z) {
if (!(z->I[1] <= z->c)) return 0;
return 1;
}
static int r_Step_1a(struct SN_env * z) {
int among_var;
z->ket = z->c; /* [, line 25 */
if (z->c <= z->lb || z->p[z->c - 1] != 115) return 0;
among_var = find_among_b(z, a_0, 4); /* substring, line 25 */
if (!(among_var)) return 0;
z->bra = z->c; /* ], line 25 */
switch(among_var) {
case 0: return 0;
case 1:
{ int ret = slice_from_s(z, 2, s_0); /* <-, line 26 */
if (ret < 0) return ret;
}
break;
case 2:
{ int ret = slice_from_s(z, 1, s_1); /* <-, line 27 */
if (ret < 0) return ret;
}
break;
case 3:
{ int ret = slice_del(z); /* delete, line 29 */
if (ret < 0) return ret;
}
break;
}
return 1;
}
static int r_Step_1b(struct SN_env * z) {
int among_var;
z->ket = z->c; /* [, line 34 */
if (z->c - 1 <= z->lb || (z->p[z->c - 1] != 100 && z->p[z->c - 1] != 103)) return 0;
among_var = find_among_b(z, a_2, 3); /* substring, line 34 */
if (!(among_var)) return 0;
z->bra = z->c; /* ], line 34 */
switch(among_var) {
case 0: return 0;
case 1:
{ int ret = r_R1(z);
if (ret == 0) return 0; /* call R1, line 35 */
if (ret < 0) return ret;
}
{ int ret = slice_from_s(z, 2, s_2); /* <-, line 35 */
if (ret < 0) return ret;
}
break;
case 2:
{ int m_test = z->l - z->c; /* test, line 38 */
{ /* gopast */ /* grouping v, line 38 */
int ret = out_grouping_b_U(z, g_v, 97, 121, 1);
if (ret < 0) return 0;
z->c -= ret;
}
z->c = z->l - m_test;
}
{ int ret = slice_del(z); /* delete, line 38 */
if (ret < 0) return ret;
}
{ int m_test = z->l - z->c; /* test, line 39 */
if (z->c - 1 <= z->lb || z->p[z->c - 1] >> 5 != 3 || !((68514004 >> (z->p[z->c - 1] & 0x1f)) & 1)) among_var = 3; else
among_var = find_among_b(z, a_1, 13); /* substring, line 39 */
if (!(among_var)) return 0;
z->c = z->l - m_test;
}
switch(among_var) {
case 0: return 0;
case 1:
{ int c_keep = z->c;
int ret = insert_s(z, z->c, z->c, 1, s_3); /* <+, line 41 */
z->c = c_keep;
if (ret < 0) return ret;
}
break;
case 2:
z->ket = z->c; /* [, line 44 */
{ int ret = skip_utf8(z->p, z->c, z->lb, 0, -1);
if (ret < 0) return 0;
z->c = ret; /* next, line 44 */
}
z->bra = z->c; /* ], line 44 */
{ int ret = slice_del(z); /* delete, line 44 */
if (ret < 0) return ret;
}
break;
case 3:
if (z->c != z->I[0]) return 0; /* atmark, line 45 */
{ int m_test = z->l - z->c; /* test, line 45 */
{ int ret = r_shortv(z);
if (ret == 0) return 0; /* call shortv, line 45 */
if (ret < 0) return ret;
}
z->c = z->l - m_test;
}
{ int c_keep = z->c;
int ret = insert_s(z, z->c, z->c, 1, s_4); /* <+, line 45 */
z->c = c_keep;
if (ret < 0) return ret;
}
break;
}
break;
}
return 1;
}
static int r_Step_1c(struct SN_env * z) {
z->ket = z->c; /* [, line 52 */
{ int m1 = z->l - z->c; (void)m1; /* or, line 52 */
if (!(eq_s_b(z, 1, s_5))) goto lab1;
goto lab0;
lab1:
z->c = z->l - m1;
if (!(eq_s_b(z, 1, s_6))) return 0;
}
lab0:
z->bra = z->c; /* ], line 52 */
{ /* gopast */ /* grouping v, line 53 */
int ret = out_grouping_b_U(z, g_v, 97, 121, 1);
if (ret < 0) return 0;
z->c -= ret;
}
{ int ret = slice_from_s(z, 1, s_7); /* <-, line 54 */
if (ret < 0) return ret;
}
return 1;
}
static int r_Step_2(struct SN_env * z) {
int among_var;
z->ket = z->c; /* [, line 58 */
if (z->c - 2 <= z->lb || z->p[z->c - 1] >> 5 != 3 || !((815616 >> (z->p[z->c - 1] & 0x1f)) & 1)) return 0;
among_var = find_among_b(z, a_3, 20); /* substring, line 58 */
if (!(among_var)) return 0;
z->bra = z->c; /* ], line 58 */
{ int ret = r_R1(z);
if (ret == 0) return 0; /* call R1, line 58 */
if (ret < 0) return ret;
}
switch(among_var) {
case 0: return 0;
case 1:
{ int ret = slice_from_s(z, 4, s_8); /* <-, line 59 */
if (ret < 0) return ret;
}
break;
case 2:
{ int ret = slice_from_s(z, 4, s_9); /* <-, line 60 */
if (ret < 0) return ret;
}
break;
case 3:
{ int ret = slice_from_s(z, 4, s_10); /* <-, line 61 */
if (ret < 0) return ret;
}
break;
case 4:
{ int ret = slice_from_s(z, 4, s_11); /* <-, line 62 */
if (ret < 0) return ret;
}
break;
case 5:
{ int ret = slice_from_s(z, 3, s_12); /* <-, line 63 */
if (ret < 0) return ret;
}
break;
case 6:
{ int ret = slice_from_s(z, 1, s_13); /* <-, line 64 */
if (ret < 0) return ret;
}
break;
case 7:
{ int ret = slice_from_s(z, 3, s_14); /* <-, line 66 */
if (ret < 0) return ret;
}
break;
case 8:
{ int ret = slice_from_s(z, 3, s_15); /* <-, line 68 */
if (ret < 0) return ret;
}
break;
case 9:
{ int ret = slice_from_s(z, 2, s_16); /* <-, line 69 */
if (ret < 0) return ret;
}
break;
case 10:
{ int ret = slice_from_s(z, 2, s_17); /* <-, line 71 */
if (ret < 0) return ret;
}
break;
case 11:
{ int ret = slice_from_s(z, 3, s_18); /* <-, line 72 */
if (ret < 0) return ret;
}
break;
case 12:
{ int ret = slice_from_s(z, 3, s_19); /* <-, line 74 */
if (ret < 0) return ret;
}
break;
case 13:
{ int ret = slice_from_s(z, 3, s_20); /* <-, line 76 */
if (ret < 0) return ret;
}
break;
case 14:
{ int ret = slice_from_s(z, 3, s_21); /* <-, line 77 */
if (ret < 0) return ret;
}
break;
}
return 1;
}
static int r_Step_3(struct SN_env * z) {
int among_var;
z->ket = z->c; /* [, line 82 */
if (z->c - 2 <= z->lb || z->p[z->c - 1] >> 5 != 3 || !((528928 >> (z->p[z->c - 1] & 0x1f)) & 1)) return 0;
among_var = find_among_b(z, a_4, 7); /* substring, line 82 */
if (!(among_var)) return 0;
z->bra = z->c; /* ], line 82 */
{ int ret = r_R1(z);
if (ret == 0) return 0; /* call R1, line 82 */
if (ret < 0) return ret;
}
switch(among_var) {
case 0: return 0;
case 1:
{ int ret = slice_from_s(z, 2, s_22); /* <-, line 83 */
if (ret < 0) return ret;
}
break;
case 2:
{ int ret = slice_from_s(z, 2, s_23); /* <-, line 85 */
if (ret < 0) return ret;
}
break;
case 3:
{ int ret = slice_del(z); /* delete, line 87 */
if (ret < 0) return ret;
}
break;
}
return 1;
}
static int r_Step_4(struct SN_env * z) {
int among_var;
z->ket = z->c; /* [, line 92 */
if (z->c - 1 <= z->lb || z->p[z->c - 1] >> 5 != 3 || !((3961384 >> (z->p[z->c - 1] & 0x1f)) & 1)) return 0;
among_var = find_among_b(z, a_5, 19); /* substring, line 92 */
if (!(among_var)) return 0;
z->bra = z->c; /* ], line 92 */
{ int ret = r_R2(z);
if (ret == 0) return 0; /* call R2, line 92 */
if (ret < 0) return ret;
}
switch(among_var) {
case 0: return 0;
case 1:
{ int ret = slice_del(z); /* delete, line 95 */
if (ret < 0) return ret;
}
break;
case 2:
{ int m1 = z->l - z->c; (void)m1; /* or, line 96 */
if (!(eq_s_b(z, 1, s_24))) goto lab1;
goto lab0;
lab1:
z->c = z->l - m1;
if (!(eq_s_b(z, 1, s_25))) return 0;
}
lab0:
{ int ret = slice_del(z); /* delete, line 96 */
if (ret < 0) return ret;
}
break;
}
return 1;
}
static int r_Step_5a(struct SN_env * z) {
z->ket = z->c; /* [, line 101 */
if (!(eq_s_b(z, 1, s_26))) return 0;
z->bra = z->c; /* ], line 101 */
{ int m1 = z->l - z->c; (void)m1; /* or, line 102 */
{ int ret = r_R2(z);
if (ret == 0) goto lab1; /* call R2, line 102 */
if (ret < 0) return ret;
}
goto lab0;
lab1:
z->c = z->l - m1;
{ int ret = r_R1(z);
if (ret == 0) return 0; /* call R1, line 102 */
if (ret < 0) return ret;
}
{ int m2 = z->l - z->c; (void)m2; /* not, line 102 */
{ int ret = r_shortv(z);
if (ret == 0) goto lab2; /* call shortv, line 102 */
if (ret < 0) return ret;
}
return 0;
lab2:
z->c = z->l - m2;
}
}
lab0:
{ int ret = slice_del(z); /* delete, line 103 */
if (ret < 0) return ret;
}
return 1;
}
static int r_Step_5b(struct SN_env * z) {
z->ket = z->c; /* [, line 107 */
if (!(eq_s_b(z, 1, s_27))) return 0;
z->bra = z->c; /* ], line 107 */
{ int ret = r_R2(z);
if (ret == 0) return 0; /* call R2, line 108 */
if (ret < 0) return ret;
}
if (!(eq_s_b(z, 1, s_28))) return 0;
{ int ret = slice_del(z); /* delete, line 109 */
if (ret < 0) return ret;
}
return 1;
}
extern int porter_UTF_8_stem(struct SN_env * z) {
z->B[0] = 0; /* unset Y_found, line 115 */
{ int c1 = z->c; /* do, line 116 */
z->bra = z->c; /* [, line 116 */
if (!(eq_s(z, 1, s_29))) goto lab0;
z->ket = z->c; /* ], line 116 */
{ int ret = slice_from_s(z, 1, s_30); /* <-, line 116 */
if (ret < 0) return ret;
}
z->B[0] = 1; /* set Y_found, line 116 */
lab0:
z->c = c1;
}
{ int c2 = z->c; /* do, line 117 */
while(1) { /* repeat, line 117 */
int c3 = z->c;
while(1) { /* goto, line 117 */
int c4 = z->c;
if (in_grouping_U(z, g_v, 97, 121, 0)) goto lab3;
z->bra = z->c; /* [, line 117 */
if (!(eq_s(z, 1, s_31))) goto lab3;
z->ket = z->c; /* ], line 117 */
z->c = c4;
break;
lab3:
z->c = c4;
{ int ret = skip_utf8(z->p, z->c, 0, z->l, 1);
if (ret < 0) goto lab2;
z->c = ret; /* goto, line 117 */
}
}
{ int ret = slice_from_s(z, 1, s_32); /* <-, line 117 */
if (ret < 0) return ret;
}
z->B[0] = 1; /* set Y_found, line 117 */
continue;
lab2:
z->c = c3;
break;
}
z->c = c2;
}
z->I[0] = z->l;
z->I[1] = z->l;
{ int c5 = z->c; /* do, line 121 */
{ /* gopast */ /* grouping v, line 122 */
int ret = out_grouping_U(z, g_v, 97, 121, 1);
if (ret < 0) goto lab4;
z->c += ret;
}
{ /* gopast */ /* non v, line 122 */
int ret = in_grouping_U(z, g_v, 97, 121, 1);
if (ret < 0) goto lab4;
z->c += ret;
}
z->I[0] = z->c; /* setmark p1, line 122 */
{ /* gopast */ /* grouping v, line 123 */
int ret = out_grouping_U(z, g_v, 97, 121, 1);
if (ret < 0) goto lab4;
z->c += ret;
}
{ /* gopast */ /* non v, line 123 */
int ret = in_grouping_U(z, g_v, 97, 121, 1);
if (ret < 0) goto lab4;
z->c += ret;
}
z->I[1] = z->c; /* setmark p2, line 123 */
lab4:
z->c = c5;
}
z->lb = z->c; z->c = z->l; /* backwards, line 126 */
{ int m6 = z->l - z->c; (void)m6; /* do, line 127 */
{ int ret = r_Step_1a(z);
if (ret == 0) goto lab5; /* call Step_1a, line 127 */
if (ret < 0) return ret;
}
lab5:
z->c = z->l - m6;
}
{ int m7 = z->l - z->c; (void)m7; /* do, line 128 */
{ int ret = r_Step_1b(z);
if (ret == 0) goto lab6; /* call Step_1b, line 128 */
if (ret < 0) return ret;
}
lab6:
z->c = z->l - m7;
}
{ int m8 = z->l - z->c; (void)m8; /* do, line 129 */
{ int ret = r_Step_1c(z);
if (ret == 0) goto lab7; /* call Step_1c, line 129 */
if (ret < 0) return ret;
}
lab7:
z->c = z->l - m8;
}
{ int m9 = z->l - z->c; (void)m9; /* do, line 130 */
{ int ret = r_Step_2(z);
if (ret == 0) goto lab8; /* call Step_2, line 130 */
if (ret < 0) return ret;
}
lab8:
z->c = z->l - m9;
}
{ int m10 = z->l - z->c; (void)m10; /* do, line 131 */
{ int ret = r_Step_3(z);
if (ret == 0) goto lab9; /* call Step_3, line 131 */
if (ret < 0) return ret;
}
lab9:
z->c = z->l - m10;
}
{ int m11 = z->l - z->c; (void)m11; /* do, line 132 */
{ int ret = r_Step_4(z);
if (ret == 0) goto lab10; /* call Step_4, line 132 */
if (ret < 0) return ret;
}
lab10:
z->c = z->l - m11;
}
{ int m12 = z->l - z->c; (void)m12; /* do, line 133 */
{ int ret = r_Step_5a(z);
if (ret == 0) goto lab11; /* call Step_5a, line 133 */
if (ret < 0) return ret;
}
lab11:
z->c = z->l - m12;
}
{ int m13 = z->l - z->c; (void)m13; /* do, line 134 */
{ int ret = r_Step_5b(z);
if (ret == 0) goto lab12; /* call Step_5b, line 134 */
if (ret < 0) return ret;
}
lab12:
z->c = z->l - m13;
}
z->c = z->lb;
{ int c14 = z->c; /* do, line 137 */
if (!(z->B[0])) goto lab13; /* Boolean test Y_found, line 137 */
while(1) { /* repeat, line 137 */
int c15 = z->c;
while(1) { /* goto, line 137 */
int c16 = z->c;
z->bra = z->c; /* [, line 137 */
if (!(eq_s(z, 1, s_33))) goto lab15;
z->ket = z->c; /* ], line 137 */
z->c = c16;
break;
lab15:
z->c = c16;
{ int ret = skip_utf8(z->p, z->c, 0, z->l, 1);
if (ret < 0) goto lab14;
z->c = ret; /* goto, line 137 */
}
}
{ int ret = slice_from_s(z, 1, s_34); /* <-, line 137 */
if (ret < 0) return ret;
}
continue;
lab14:
z->c = c15;
break;
}
lab13:
z->c = c14;
}
return 1;
}
extern struct SN_env * porter_UTF_8_create_env(void) { return SN_create_env(0, 2, 1); }
extern void porter_UTF_8_close_env(struct SN_env * z) { SN_close_env(z, 0); }

View file

@ -1,16 +0,0 @@
/* This file was generated automatically by the Snowball to ANSI C compiler */
#ifdef __cplusplus
extern "C" {
#endif
extern struct SN_env * porter_UTF_8_create_env(void);
extern void porter_UTF_8_close_env(struct SN_env * z);
extern int porter_UTF_8_stem(struct SN_env * z);
#ifdef __cplusplus
}
#endif

View file

@ -1,16 +0,0 @@
/* This file was generated automatically by the Snowball to ANSI C compiler */
#ifdef __cplusplus
extern "C" {
#endif
extern struct SN_env * portuguese_UTF_8_create_env(void);
extern void portuguese_UTF_8_close_env(struct SN_env * z);
extern int portuguese_UTF_8_stem(struct SN_env * z);
#ifdef __cplusplus
}
#endif

File diff suppressed because it is too large Load diff

View file

@ -1,16 +0,0 @@
/* This file was generated automatically by the Snowball to ANSI C compiler */
#ifdef __cplusplus
extern "C" {
#endif
extern struct SN_env * romanian_UTF_8_create_env(void);
extern void romanian_UTF_8_close_env(struct SN_env * z);
extern int romanian_UTF_8_stem(struct SN_env * z);
#ifdef __cplusplus
}
#endif

View file

@ -1,694 +0,0 @@
/* This file was generated automatically by the Snowball to ANSI C compiler */
#include "../runtime/header.h"
#ifdef __cplusplus
extern "C" {
#endif
extern int russian_UTF_8_stem(struct SN_env * z);
#ifdef __cplusplus
}
#endif
static int r_tidy_up(struct SN_env * z);
static int r_derivational(struct SN_env * z);
static int r_noun(struct SN_env * z);
static int r_verb(struct SN_env * z);
static int r_reflexive(struct SN_env * z);
static int r_adjectival(struct SN_env * z);
static int r_adjective(struct SN_env * z);
static int r_perfective_gerund(struct SN_env * z);
static int r_R2(struct SN_env * z);
static int r_mark_regions(struct SN_env * z);
#ifdef __cplusplus
extern "C" {
#endif
extern struct SN_env * russian_UTF_8_create_env(void);
extern void russian_UTF_8_close_env(struct SN_env * z);
#ifdef __cplusplus
}
#endif
static const symbol s_0_0[10] = { 0xD0, 0xB2, 0xD1, 0x88, 0xD0, 0xB8, 0xD1, 0x81, 0xD1, 0x8C };
static const symbol s_0_1[12] = { 0xD1, 0x8B, 0xD0, 0xB2, 0xD1, 0x88, 0xD0, 0xB8, 0xD1, 0x81, 0xD1, 0x8C };
static const symbol s_0_2[12] = { 0xD0, 0xB8, 0xD0, 0xB2, 0xD1, 0x88, 0xD0, 0xB8, 0xD1, 0x81, 0xD1, 0x8C };
static const symbol s_0_3[2] = { 0xD0, 0xB2 };
static const symbol s_0_4[4] = { 0xD1, 0x8B, 0xD0, 0xB2 };
static const symbol s_0_5[4] = { 0xD0, 0xB8, 0xD0, 0xB2 };
static const symbol s_0_6[6] = { 0xD0, 0xB2, 0xD1, 0x88, 0xD0, 0xB8 };
static const symbol s_0_7[8] = { 0xD1, 0x8B, 0xD0, 0xB2, 0xD1, 0x88, 0xD0, 0xB8 };
static const symbol s_0_8[8] = { 0xD0, 0xB8, 0xD0, 0xB2, 0xD1, 0x88, 0xD0, 0xB8 };
static const struct among a_0[9] =
{
/* 0 */ { 10, s_0_0, -1, 1, 0},
/* 1 */ { 12, s_0_1, 0, 2, 0},
/* 2 */ { 12, s_0_2, 0, 2, 0},
/* 3 */ { 2, s_0_3, -1, 1, 0},
/* 4 */ { 4, s_0_4, 3, 2, 0},
/* 5 */ { 4, s_0_5, 3, 2, 0},
/* 6 */ { 6, s_0_6, -1, 1, 0},
/* 7 */ { 8, s_0_7, 6, 2, 0},
/* 8 */ { 8, s_0_8, 6, 2, 0}
};
static const symbol s_1_0[6] = { 0xD0, 0xB5, 0xD0, 0xBC, 0xD1, 0x83 };
static const symbol s_1_1[6] = { 0xD0, 0xBE, 0xD0, 0xBC, 0xD1, 0x83 };
static const symbol s_1_2[4] = { 0xD1, 0x8B, 0xD1, 0x85 };
static const symbol s_1_3[4] = { 0xD0, 0xB8, 0xD1, 0x85 };
static const symbol s_1_4[4] = { 0xD1, 0x83, 0xD1, 0x8E };
static const symbol s_1_5[4] = { 0xD1, 0x8E, 0xD1, 0x8E };
static const symbol s_1_6[4] = { 0xD0, 0xB5, 0xD1, 0x8E };
static const symbol s_1_7[4] = { 0xD0, 0xBE, 0xD1, 0x8E };
static const symbol s_1_8[4] = { 0xD1, 0x8F, 0xD1, 0x8F };
static const symbol s_1_9[4] = { 0xD0, 0xB0, 0xD1, 0x8F };
static const symbol s_1_10[4] = { 0xD1, 0x8B, 0xD0, 0xB5 };
static const symbol s_1_11[4] = { 0xD0, 0xB5, 0xD0, 0xB5 };
static const symbol s_1_12[4] = { 0xD0, 0xB8, 0xD0, 0xB5 };
static const symbol s_1_13[4] = { 0xD0, 0xBE, 0xD0, 0xB5 };
static const symbol s_1_14[6] = { 0xD1, 0x8B, 0xD0, 0xBC, 0xD0, 0xB8 };
static const symbol s_1_15[6] = { 0xD0, 0xB8, 0xD0, 0xBC, 0xD0, 0xB8 };
static const symbol s_1_16[4] = { 0xD1, 0x8B, 0xD0, 0xB9 };
static const symbol s_1_17[4] = { 0xD0, 0xB5, 0xD0, 0xB9 };
static const symbol s_1_18[4] = { 0xD0, 0xB8, 0xD0, 0xB9 };
static const symbol s_1_19[4] = { 0xD0, 0xBE, 0xD0, 0xB9 };
static const symbol s_1_20[4] = { 0xD1, 0x8B, 0xD0, 0xBC };
static const symbol s_1_21[4] = { 0xD0, 0xB5, 0xD0, 0xBC };
static const symbol s_1_22[4] = { 0xD0, 0xB8, 0xD0, 0xBC };
static const symbol s_1_23[4] = { 0xD0, 0xBE, 0xD0, 0xBC };
static const symbol s_1_24[6] = { 0xD0, 0xB5, 0xD0, 0xB3, 0xD0, 0xBE };
static const symbol s_1_25[6] = { 0xD0, 0xBE, 0xD0, 0xB3, 0xD0, 0xBE };
static const struct among a_1[26] =
{
/* 0 */ { 6, s_1_0, -1, 1, 0},
/* 1 */ { 6, s_1_1, -1, 1, 0},
/* 2 */ { 4, s_1_2, -1, 1, 0},
/* 3 */ { 4, s_1_3, -1, 1, 0},
/* 4 */ { 4, s_1_4, -1, 1, 0},
/* 5 */ { 4, s_1_5, -1, 1, 0},
/* 6 */ { 4, s_1_6, -1, 1, 0},
/* 7 */ { 4, s_1_7, -1, 1, 0},
/* 8 */ { 4, s_1_8, -1, 1, 0},
/* 9 */ { 4, s_1_9, -1, 1, 0},
/* 10 */ { 4, s_1_10, -1, 1, 0},
/* 11 */ { 4, s_1_11, -1, 1, 0},
/* 12 */ { 4, s_1_12, -1, 1, 0},
/* 13 */ { 4, s_1_13, -1, 1, 0},
/* 14 */ { 6, s_1_14, -1, 1, 0},
/* 15 */ { 6, s_1_15, -1, 1, 0},
/* 16 */ { 4, s_1_16, -1, 1, 0},
/* 17 */ { 4, s_1_17, -1, 1, 0},
/* 18 */ { 4, s_1_18, -1, 1, 0},
/* 19 */ { 4, s_1_19, -1, 1, 0},
/* 20 */ { 4, s_1_20, -1, 1, 0},
/* 21 */ { 4, s_1_21, -1, 1, 0},
/* 22 */ { 4, s_1_22, -1, 1, 0},
/* 23 */ { 4, s_1_23, -1, 1, 0},
/* 24 */ { 6, s_1_24, -1, 1, 0},
/* 25 */ { 6, s_1_25, -1, 1, 0}
};
static const symbol s_2_0[4] = { 0xD0, 0xB2, 0xD1, 0x88 };
static const symbol s_2_1[6] = { 0xD1, 0x8B, 0xD0, 0xB2, 0xD1, 0x88 };
static const symbol s_2_2[6] = { 0xD0, 0xB8, 0xD0, 0xB2, 0xD1, 0x88 };
static const symbol s_2_3[2] = { 0xD1, 0x89 };
static const symbol s_2_4[4] = { 0xD1, 0x8E, 0xD1, 0x89 };
static const symbol s_2_5[6] = { 0xD1, 0x83, 0xD1, 0x8E, 0xD1, 0x89 };
static const symbol s_2_6[4] = { 0xD0, 0xB5, 0xD0, 0xBC };
static const symbol s_2_7[4] = { 0xD0, 0xBD, 0xD0, 0xBD };
static const struct among a_2[8] =
{
/* 0 */ { 4, s_2_0, -1, 1, 0},
/* 1 */ { 6, s_2_1, 0, 2, 0},
/* 2 */ { 6, s_2_2, 0, 2, 0},
/* 3 */ { 2, s_2_3, -1, 1, 0},
/* 4 */ { 4, s_2_4, 3, 1, 0},
/* 5 */ { 6, s_2_5, 4, 2, 0},
/* 6 */ { 4, s_2_6, -1, 1, 0},
/* 7 */ { 4, s_2_7, -1, 1, 0}
};
static const symbol s_3_0[4] = { 0xD1, 0x81, 0xD1, 0x8C };
static const symbol s_3_1[4] = { 0xD1, 0x81, 0xD1, 0x8F };
static const struct among a_3[2] =
{
/* 0 */ { 4, s_3_0, -1, 1, 0},
/* 1 */ { 4, s_3_1, -1, 1, 0}
};
static const symbol s_4_0[4] = { 0xD1, 0x8B, 0xD1, 0x82 };
static const symbol s_4_1[4] = { 0xD1, 0x8E, 0xD1, 0x82 };
static const symbol s_4_2[6] = { 0xD1, 0x83, 0xD1, 0x8E, 0xD1, 0x82 };
static const symbol s_4_3[4] = { 0xD1, 0x8F, 0xD1, 0x82 };
static const symbol s_4_4[4] = { 0xD0, 0xB5, 0xD1, 0x82 };
static const symbol s_4_5[6] = { 0xD1, 0x83, 0xD0, 0xB5, 0xD1, 0x82 };
static const symbol s_4_6[4] = { 0xD0, 0xB8, 0xD1, 0x82 };
static const symbol s_4_7[4] = { 0xD0, 0xBD, 0xD1, 0x8B };
static const symbol s_4_8[6] = { 0xD0, 0xB5, 0xD0, 0xBD, 0xD1, 0x8B };
static const symbol s_4_9[4] = { 0xD1, 0x82, 0xD1, 0x8C };
static const symbol s_4_10[6] = { 0xD1, 0x8B, 0xD1, 0x82, 0xD1, 0x8C };
static const symbol s_4_11[6] = { 0xD0, 0xB8, 0xD1, 0x82, 0xD1, 0x8C };
static const symbol s_4_12[6] = { 0xD0, 0xB5, 0xD1, 0x88, 0xD1, 0x8C };
static const symbol s_4_13[6] = { 0xD0, 0xB8, 0xD1, 0x88, 0xD1, 0x8C };
static const symbol s_4_14[2] = { 0xD1, 0x8E };
static const symbol s_4_15[4] = { 0xD1, 0x83, 0xD1, 0x8E };
static const symbol s_4_16[4] = { 0xD0, 0xBB, 0xD0, 0xB0 };
static const symbol s_4_17[6] = { 0xD1, 0x8B, 0xD0, 0xBB, 0xD0, 0xB0 };
static const symbol s_4_18[6] = { 0xD0, 0xB8, 0xD0, 0xBB, 0xD0, 0xB0 };
static const symbol s_4_19[4] = { 0xD0, 0xBD, 0xD0, 0xB0 };
static const symbol s_4_20[6] = { 0xD0, 0xB5, 0xD0, 0xBD, 0xD0, 0xB0 };
static const symbol s_4_21[6] = { 0xD0, 0xB5, 0xD1, 0x82, 0xD0, 0xB5 };
static const symbol s_4_22[6] = { 0xD0, 0xB8, 0xD1, 0x82, 0xD0, 0xB5 };
static const symbol s_4_23[6] = { 0xD0, 0xB9, 0xD1, 0x82, 0xD0, 0xB5 };
static const symbol s_4_24[8] = { 0xD1, 0x83, 0xD0, 0xB9, 0xD1, 0x82, 0xD0, 0xB5 };
static const symbol s_4_25[8] = { 0xD0, 0xB5, 0xD0, 0xB9, 0xD1, 0x82, 0xD0, 0xB5 };
static const symbol s_4_26[4] = { 0xD0, 0xBB, 0xD0, 0xB8 };
static const symbol s_4_27[6] = { 0xD1, 0x8B, 0xD0, 0xBB, 0xD0, 0xB8 };
static const symbol s_4_28[6] = { 0xD0, 0xB8, 0xD0, 0xBB, 0xD0, 0xB8 };
static const symbol s_4_29[2] = { 0xD0, 0xB9 };
static const symbol s_4_30[4] = { 0xD1, 0x83, 0xD0, 0xB9 };
static const symbol s_4_31[4] = { 0xD0, 0xB5, 0xD0, 0xB9 };
static const symbol s_4_32[2] = { 0xD0, 0xBB };
static const symbol s_4_33[4] = { 0xD1, 0x8B, 0xD0, 0xBB };
static const symbol s_4_34[4] = { 0xD0, 0xB8, 0xD0, 0xBB };
static const symbol s_4_35[4] = { 0xD1, 0x8B, 0xD0, 0xBC };
static const symbol s_4_36[4] = { 0xD0, 0xB5, 0xD0, 0xBC };
static const symbol s_4_37[4] = { 0xD0, 0xB8, 0xD0, 0xBC };
static const symbol s_4_38[2] = { 0xD0, 0xBD };
static const symbol s_4_39[4] = { 0xD0, 0xB5, 0xD0, 0xBD };
static const symbol s_4_40[4] = { 0xD0, 0xBB, 0xD0, 0xBE };
static const symbol s_4_41[6] = { 0xD1, 0x8B, 0xD0, 0xBB, 0xD0, 0xBE };
static const symbol s_4_42[6] = { 0xD0, 0xB8, 0xD0, 0xBB, 0xD0, 0xBE };
static const symbol s_4_43[4] = { 0xD0, 0xBD, 0xD0, 0xBE };
static const symbol s_4_44[6] = { 0xD0, 0xB5, 0xD0, 0xBD, 0xD0, 0xBE };
static const symbol s_4_45[6] = { 0xD0, 0xBD, 0xD0, 0xBD, 0xD0, 0xBE };
static const struct among a_4[46] =
{
/* 0 */ { 4, s_4_0, -1, 2, 0},
/* 1 */ { 4, s_4_1, -1, 1, 0},
/* 2 */ { 6, s_4_2, 1, 2, 0},
/* 3 */ { 4, s_4_3, -1, 2, 0},
/* 4 */ { 4, s_4_4, -1, 1, 0},
/* 5 */ { 6, s_4_5, 4, 2, 0},
/* 6 */ { 4, s_4_6, -1, 2, 0},
/* 7 */ { 4, s_4_7, -1, 1, 0},
/* 8 */ { 6, s_4_8, 7, 2, 0},
/* 9 */ { 4, s_4_9, -1, 1, 0},
/* 10 */ { 6, s_4_10, 9, 2, 0},
/* 11 */ { 6, s_4_11, 9, 2, 0},
/* 12 */ { 6, s_4_12, -1, 1, 0},
/* 13 */ { 6, s_4_13, -1, 2, 0},
/* 14 */ { 2, s_4_14, -1, 2, 0},
/* 15 */ { 4, s_4_15, 14, 2, 0},
/* 16 */ { 4, s_4_16, -1, 1, 0},
/* 17 */ { 6, s_4_17, 16, 2, 0},
/* 18 */ { 6, s_4_18, 16, 2, 0},
/* 19 */ { 4, s_4_19, -1, 1, 0},
/* 20 */ { 6, s_4_20, 19, 2, 0},
/* 21 */ { 6, s_4_21, -1, 1, 0},
/* 22 */ { 6, s_4_22, -1, 2, 0},
/* 23 */ { 6, s_4_23, -1, 1, 0},
/* 24 */ { 8, s_4_24, 23, 2, 0},
/* 25 */ { 8, s_4_25, 23, 2, 0},
/* 26 */ { 4, s_4_26, -1, 1, 0},
/* 27 */ { 6, s_4_27, 26, 2, 0},
/* 28 */ { 6, s_4_28, 26, 2, 0},
/* 29 */ { 2, s_4_29, -1, 1, 0},
/* 30 */ { 4, s_4_30, 29, 2, 0},
/* 31 */ { 4, s_4_31, 29, 2, 0},
/* 32 */ { 2, s_4_32, -1, 1, 0},
/* 33 */ { 4, s_4_33, 32, 2, 0},
/* 34 */ { 4, s_4_34, 32, 2, 0},
/* 35 */ { 4, s_4_35, -1, 2, 0},
/* 36 */ { 4, s_4_36, -1, 1, 0},
/* 37 */ { 4, s_4_37, -1, 2, 0},
/* 38 */ { 2, s_4_38, -1, 1, 0},
/* 39 */ { 4, s_4_39, 38, 2, 0},
/* 40 */ { 4, s_4_40, -1, 1, 0},
/* 41 */ { 6, s_4_41, 40, 2, 0},
/* 42 */ { 6, s_4_42, 40, 2, 0},
/* 43 */ { 4, s_4_43, -1, 1, 0},
/* 44 */ { 6, s_4_44, 43, 2, 0},
/* 45 */ { 6, s_4_45, 43, 1, 0}
};
static const symbol s_5_0[2] = { 0xD1, 0x83 };
static const symbol s_5_1[4] = { 0xD1, 0x8F, 0xD1, 0x85 };
static const symbol s_5_2[6] = { 0xD0, 0xB8, 0xD1, 0x8F, 0xD1, 0x85 };
static const symbol s_5_3[4] = { 0xD0, 0xB0, 0xD1, 0x85 };
static const symbol s_5_4[2] = { 0xD1, 0x8B };
static const symbol s_5_5[2] = { 0xD1, 0x8C };
static const symbol s_5_6[2] = { 0xD1, 0x8E };
static const symbol s_5_7[4] = { 0xD1, 0x8C, 0xD1, 0x8E };
static const symbol s_5_8[4] = { 0xD0, 0xB8, 0xD1, 0x8E };
static const symbol s_5_9[2] = { 0xD1, 0x8F };
static const symbol s_5_10[4] = { 0xD1, 0x8C, 0xD1, 0x8F };
static const symbol s_5_11[4] = { 0xD0, 0xB8, 0xD1, 0x8F };
static const symbol s_5_12[2] = { 0xD0, 0xB0 };
static const symbol s_5_13[4] = { 0xD0, 0xB5, 0xD0, 0xB2 };
static const symbol s_5_14[4] = { 0xD0, 0xBE, 0xD0, 0xB2 };
static const symbol s_5_15[2] = { 0xD0, 0xB5 };
static const symbol s_5_16[4] = { 0xD1, 0x8C, 0xD0, 0xB5 };
static const symbol s_5_17[4] = { 0xD0, 0xB8, 0xD0, 0xB5 };
static const symbol s_5_18[2] = { 0xD0, 0xB8 };
static const symbol s_5_19[4] = { 0xD0, 0xB5, 0xD0, 0xB8 };
static const symbol s_5_20[4] = { 0xD0, 0xB8, 0xD0, 0xB8 };
static const symbol s_5_21[6] = { 0xD1, 0x8F, 0xD0, 0xBC, 0xD0, 0xB8 };
static const symbol s_5_22[8] = { 0xD0, 0xB8, 0xD1, 0x8F, 0xD0, 0xBC, 0xD0, 0xB8 };
static const symbol s_5_23[6] = { 0xD0, 0xB0, 0xD0, 0xBC, 0xD0, 0xB8 };
static const symbol s_5_24[2] = { 0xD0, 0xB9 };
static const symbol s_5_25[4] = { 0xD0, 0xB5, 0xD0, 0xB9 };
static const symbol s_5_26[6] = { 0xD0, 0xB8, 0xD0, 0xB5, 0xD0, 0xB9 };
static const symbol s_5_27[4] = { 0xD0, 0xB8, 0xD0, 0xB9 };
static const symbol s_5_28[4] = { 0xD0, 0xBE, 0xD0, 0xB9 };
static const symbol s_5_29[4] = { 0xD1, 0x8F, 0xD0, 0xBC };
static const symbol s_5_30[6] = { 0xD0, 0xB8, 0xD1, 0x8F, 0xD0, 0xBC };
static const symbol s_5_31[4] = { 0xD0, 0xB0, 0xD0, 0xBC };
static const symbol s_5_32[4] = { 0xD0, 0xB5, 0xD0, 0xBC };
static const symbol s_5_33[6] = { 0xD0, 0xB8, 0xD0, 0xB5, 0xD0, 0xBC };
static const symbol s_5_34[4] = { 0xD0, 0xBE, 0xD0, 0xBC };
static const symbol s_5_35[2] = { 0xD0, 0xBE };
static const struct among a_5[36] =
{
/* 0 */ { 2, s_5_0, -1, 1, 0},
/* 1 */ { 4, s_5_1, -1, 1, 0},
/* 2 */ { 6, s_5_2, 1, 1, 0},
/* 3 */ { 4, s_5_3, -1, 1, 0},
/* 4 */ { 2, s_5_4, -1, 1, 0},
/* 5 */ { 2, s_5_5, -1, 1, 0},
/* 6 */ { 2, s_5_6, -1, 1, 0},
/* 7 */ { 4, s_5_7, 6, 1, 0},
/* 8 */ { 4, s_5_8, 6, 1, 0},
/* 9 */ { 2, s_5_9, -1, 1, 0},
/* 10 */ { 4, s_5_10, 9, 1, 0},
/* 11 */ { 4, s_5_11, 9, 1, 0},
/* 12 */ { 2, s_5_12, -1, 1, 0},
/* 13 */ { 4, s_5_13, -1, 1, 0},
/* 14 */ { 4, s_5_14, -1, 1, 0},
/* 15 */ { 2, s_5_15, -1, 1, 0},
/* 16 */ { 4, s_5_16, 15, 1, 0},
/* 17 */ { 4, s_5_17, 15, 1, 0},
/* 18 */ { 2, s_5_18, -1, 1, 0},
/* 19 */ { 4, s_5_19, 18, 1, 0},
/* 20 */ { 4, s_5_20, 18, 1, 0},
/* 21 */ { 6, s_5_21, 18, 1, 0},
/* 22 */ { 8, s_5_22, 21, 1, 0},
/* 23 */ { 6, s_5_23, 18, 1, 0},
/* 24 */ { 2, s_5_24, -1, 1, 0},
/* 25 */ { 4, s_5_25, 24, 1, 0},
/* 26 */ { 6, s_5_26, 25, 1, 0},
/* 27 */ { 4, s_5_27, 24, 1, 0},
/* 28 */ { 4, s_5_28, 24, 1, 0},
/* 29 */ { 4, s_5_29, -1, 1, 0},
/* 30 */ { 6, s_5_30, 29, 1, 0},
/* 31 */ { 4, s_5_31, -1, 1, 0},
/* 32 */ { 4, s_5_32, -1, 1, 0},
/* 33 */ { 6, s_5_33, 32, 1, 0},
/* 34 */ { 4, s_5_34, -1, 1, 0},
/* 35 */ { 2, s_5_35, -1, 1, 0}
};
static const symbol s_6_0[6] = { 0xD0, 0xBE, 0xD1, 0x81, 0xD1, 0x82 };
static const symbol s_6_1[8] = { 0xD0, 0xBE, 0xD1, 0x81, 0xD1, 0x82, 0xD1, 0x8C };
static const struct among a_6[2] =
{
/* 0 */ { 6, s_6_0, -1, 1, 0},
/* 1 */ { 8, s_6_1, -1, 1, 0}
};
static const symbol s_7_0[6] = { 0xD0, 0xB5, 0xD0, 0xB9, 0xD1, 0x88 };
static const symbol s_7_1[2] = { 0xD1, 0x8C };
static const symbol s_7_2[8] = { 0xD0, 0xB5, 0xD0, 0xB9, 0xD1, 0x88, 0xD0, 0xB5 };
static const symbol s_7_3[2] = { 0xD0, 0xBD };
static const struct among a_7[4] =
{
/* 0 */ { 6, s_7_0, -1, 1, 0},
/* 1 */ { 2, s_7_1, -1, 3, 0},
/* 2 */ { 8, s_7_2, -1, 1, 0},
/* 3 */ { 2, s_7_3, -1, 2, 0}
};
static const unsigned char g_v[] = { 33, 65, 8, 232 };
static const symbol s_0[] = { 0xD0, 0xB0 };
static const symbol s_1[] = { 0xD1, 0x8F };
static const symbol s_2[] = { 0xD0, 0xB0 };
static const symbol s_3[] = { 0xD1, 0x8F };
static const symbol s_4[] = { 0xD0, 0xB0 };
static const symbol s_5[] = { 0xD1, 0x8F };
static const symbol s_6[] = { 0xD0, 0xBD };
static const symbol s_7[] = { 0xD0, 0xBD };
static const symbol s_8[] = { 0xD0, 0xBD };
static const symbol s_9[] = { 0xD0, 0xB8 };
static int r_mark_regions(struct SN_env * z) {
z->I[0] = z->l;
z->I[1] = z->l;
{ int c1 = z->c; /* do, line 61 */
{ /* gopast */ /* grouping v, line 62 */
int ret = out_grouping_U(z, g_v, 1072, 1103, 1);
if (ret < 0) goto lab0;
z->c += ret;
}
z->I[0] = z->c; /* setmark pV, line 62 */
{ /* gopast */ /* non v, line 62 */
int ret = in_grouping_U(z, g_v, 1072, 1103, 1);
if (ret < 0) goto lab0;
z->c += ret;
}
{ /* gopast */ /* grouping v, line 63 */
int ret = out_grouping_U(z, g_v, 1072, 1103, 1);
if (ret < 0) goto lab0;
z->c += ret;
}
{ /* gopast */ /* non v, line 63 */
int ret = in_grouping_U(z, g_v, 1072, 1103, 1);
if (ret < 0) goto lab0;
z->c += ret;
}
z->I[1] = z->c; /* setmark p2, line 63 */
lab0:
z->c = c1;
}
return 1;
}
static int r_R2(struct SN_env * z) {
if (!(z->I[1] <= z->c)) return 0;
return 1;
}
static int r_perfective_gerund(struct SN_env * z) {
int among_var;
z->ket = z->c; /* [, line 72 */
among_var = find_among_b(z, a_0, 9); /* substring, line 72 */
if (!(among_var)) return 0;
z->bra = z->c; /* ], line 72 */
switch(among_var) {
case 0: return 0;
case 1:
{ int m1 = z->l - z->c; (void)m1; /* or, line 76 */
if (!(eq_s_b(z, 2, s_0))) goto lab1;
goto lab0;
lab1:
z->c = z->l - m1;
if (!(eq_s_b(z, 2, s_1))) return 0;
}
lab0:
{ int ret = slice_del(z); /* delete, line 76 */
if (ret < 0) return ret;
}
break;
case 2:
{ int ret = slice_del(z); /* delete, line 83 */
if (ret < 0) return ret;
}
break;
}
return 1;
}
static int r_adjective(struct SN_env * z) {
int among_var;
z->ket = z->c; /* [, line 88 */
among_var = find_among_b(z, a_1, 26); /* substring, line 88 */
if (!(among_var)) return 0;
z->bra = z->c; /* ], line 88 */
switch(among_var) {
case 0: return 0;
case 1:
{ int ret = slice_del(z); /* delete, line 97 */
if (ret < 0) return ret;
}
break;
}
return 1;
}
static int r_adjectival(struct SN_env * z) {
int among_var;
{ int ret = r_adjective(z);
if (ret == 0) return 0; /* call adjective, line 102 */
if (ret < 0) return ret;
}
{ int m_keep = z->l - z->c;/* (void) m_keep;*/ /* try, line 109 */
z->ket = z->c; /* [, line 110 */
among_var = find_among_b(z, a_2, 8); /* substring, line 110 */
if (!(among_var)) { z->c = z->l - m_keep; goto lab0; }
z->bra = z->c; /* ], line 110 */
switch(among_var) {
case 0: { z->c = z->l - m_keep; goto lab0; }
case 1:
{ int m1 = z->l - z->c; (void)m1; /* or, line 115 */
if (!(eq_s_b(z, 2, s_2))) goto lab2;
goto lab1;
lab2:
z->c = z->l - m1;
if (!(eq_s_b(z, 2, s_3))) { z->c = z->l - m_keep; goto lab0; }
}
lab1:
{ int ret = slice_del(z); /* delete, line 115 */
if (ret < 0) return ret;
}
break;
case 2:
{ int ret = slice_del(z); /* delete, line 122 */
if (ret < 0) return ret;
}
break;
}
lab0:
;
}
return 1;
}
static int r_reflexive(struct SN_env * z) {
int among_var;
z->ket = z->c; /* [, line 129 */
if (z->c - 3 <= z->lb || (z->p[z->c - 1] != 140 && z->p[z->c - 1] != 143)) return 0;
among_var = find_among_b(z, a_3, 2); /* substring, line 129 */
if (!(among_var)) return 0;
z->bra = z->c; /* ], line 129 */
switch(among_var) {
case 0: return 0;
case 1:
{ int ret = slice_del(z); /* delete, line 132 */
if (ret < 0) return ret;
}
break;
}
return 1;
}
static int r_verb(struct SN_env * z) {
int among_var;
z->ket = z->c; /* [, line 137 */
among_var = find_among_b(z, a_4, 46); /* substring, line 137 */
if (!(among_var)) return 0;
z->bra = z->c; /* ], line 137 */
switch(among_var) {
case 0: return 0;
case 1:
{ int m1 = z->l - z->c; (void)m1; /* or, line 143 */
if (!(eq_s_b(z, 2, s_4))) goto lab1;
goto lab0;
lab1:
z->c = z->l - m1;
if (!(eq_s_b(z, 2, s_5))) return 0;
}
lab0:
{ int ret = slice_del(z); /* delete, line 143 */
if (ret < 0) return ret;
}
break;
case 2:
{ int ret = slice_del(z); /* delete, line 151 */
if (ret < 0) return ret;
}
break;
}
return 1;
}
static int r_noun(struct SN_env * z) {
int among_var;
z->ket = z->c; /* [, line 160 */
among_var = find_among_b(z, a_5, 36); /* substring, line 160 */
if (!(among_var)) return 0;
z->bra = z->c; /* ], line 160 */
switch(among_var) {
case 0: return 0;
case 1:
{ int ret = slice_del(z); /* delete, line 167 */
if (ret < 0) return ret;
}
break;
}
return 1;
}
static int r_derivational(struct SN_env * z) {
int among_var;
z->ket = z->c; /* [, line 176 */
if (z->c - 5 <= z->lb || (z->p[z->c - 1] != 130 && z->p[z->c - 1] != 140)) return 0;
among_var = find_among_b(z, a_6, 2); /* substring, line 176 */
if (!(among_var)) return 0;
z->bra = z->c; /* ], line 176 */
{ int ret = r_R2(z);
if (ret == 0) return 0; /* call R2, line 176 */
if (ret < 0) return ret;
}
switch(among_var) {
case 0: return 0;
case 1:
{ int ret = slice_del(z); /* delete, line 179 */
if (ret < 0) return ret;
}
break;
}
return 1;
}
static int r_tidy_up(struct SN_env * z) {
int among_var;
z->ket = z->c; /* [, line 184 */
among_var = find_among_b(z, a_7, 4); /* substring, line 184 */
if (!(among_var)) return 0;
z->bra = z->c; /* ], line 184 */
switch(among_var) {
case 0: return 0;
case 1:
{ int ret = slice_del(z); /* delete, line 188 */
if (ret < 0) return ret;
}
z->ket = z->c; /* [, line 189 */
if (!(eq_s_b(z, 2, s_6))) return 0;
z->bra = z->c; /* ], line 189 */
if (!(eq_s_b(z, 2, s_7))) return 0;
{ int ret = slice_del(z); /* delete, line 189 */
if (ret < 0) return ret;
}
break;
case 2:
if (!(eq_s_b(z, 2, s_8))) return 0;
{ int ret = slice_del(z); /* delete, line 192 */
if (ret < 0) return ret;
}
break;
case 3:
{ int ret = slice_del(z); /* delete, line 194 */
if (ret < 0) return ret;
}
break;
}
return 1;
}
extern int russian_UTF_8_stem(struct SN_env * z) {
{ int c1 = z->c; /* do, line 201 */
{ int ret = r_mark_regions(z);
if (ret == 0) goto lab0; /* call mark_regions, line 201 */
if (ret < 0) return ret;
}
lab0:
z->c = c1;
}
z->lb = z->c; z->c = z->l; /* backwards, line 202 */
{ int mlimit; /* setlimit, line 202 */
int m2 = z->l - z->c; (void)m2;
if (z->c < z->I[0]) return 0;
z->c = z->I[0]; /* tomark, line 202 */
mlimit = z->lb; z->lb = z->c;
z->c = z->l - m2;
{ int m3 = z->l - z->c; (void)m3; /* do, line 203 */
{ int m4 = z->l - z->c; (void)m4; /* or, line 204 */
{ int ret = r_perfective_gerund(z);
if (ret == 0) goto lab3; /* call perfective_gerund, line 204 */
if (ret < 0) return ret;
}
goto lab2;
lab3:
z->c = z->l - m4;
{ int m_keep = z->l - z->c;/* (void) m_keep;*/ /* try, line 205 */
{ int ret = r_reflexive(z);
if (ret == 0) { z->c = z->l - m_keep; goto lab4; } /* call reflexive, line 205 */
if (ret < 0) return ret;
}
lab4:
;
}
{ int m5 = z->l - z->c; (void)m5; /* or, line 206 */
{ int ret = r_adjectival(z);
if (ret == 0) goto lab6; /* call adjectival, line 206 */
if (ret < 0) return ret;
}
goto lab5;
lab6:
z->c = z->l - m5;
{ int ret = r_verb(z);
if (ret == 0) goto lab7; /* call verb, line 206 */
if (ret < 0) return ret;
}
goto lab5;
lab7:
z->c = z->l - m5;
{ int ret = r_noun(z);
if (ret == 0) goto lab1; /* call noun, line 206 */
if (ret < 0) return ret;
}
}
lab5:
;
}
lab2:
lab1:
z->c = z->l - m3;
}
{ int m_keep = z->l - z->c;/* (void) m_keep;*/ /* try, line 209 */
z->ket = z->c; /* [, line 209 */
if (!(eq_s_b(z, 2, s_9))) { z->c = z->l - m_keep; goto lab8; }
z->bra = z->c; /* ], line 209 */
{ int ret = slice_del(z); /* delete, line 209 */
if (ret < 0) return ret;
}
lab8:
;
}
{ int m6 = z->l - z->c; (void)m6; /* do, line 212 */
{ int ret = r_derivational(z);
if (ret == 0) goto lab9; /* call derivational, line 212 */
if (ret < 0) return ret;
}
lab9:
z->c = z->l - m6;
}
{ int m7 = z->l - z->c; (void)m7; /* do, line 213 */
{ int ret = r_tidy_up(z);
if (ret == 0) goto lab10; /* call tidy_up, line 213 */
if (ret < 0) return ret;
}
lab10:
z->c = z->l - m7;
}
z->lb = mlimit;
}
z->c = z->lb;
return 1;
}
extern struct SN_env * russian_UTF_8_create_env(void) { return SN_create_env(0, 2, 0); }
extern void russian_UTF_8_close_env(struct SN_env * z) { SN_close_env(z, 0); }

View file

@ -1,16 +0,0 @@
/* This file was generated automatically by the Snowball to ANSI C compiler */
#ifdef __cplusplus
extern "C" {
#endif
extern struct SN_env * russian_UTF_8_create_env(void);
extern void russian_UTF_8_close_env(struct SN_env * z);
extern int russian_UTF_8_stem(struct SN_env * z);
#ifdef __cplusplus
}
#endif

File diff suppressed because it is too large Load diff

View file

@ -1,16 +0,0 @@
/* This file was generated automatically by the Snowball to ANSI C compiler */
#ifdef __cplusplus
extern "C" {
#endif
extern struct SN_env * spanish_UTF_8_create_env(void);
extern void spanish_UTF_8_close_env(struct SN_env * z);
extern int spanish_UTF_8_stem(struct SN_env * z);
#ifdef __cplusplus
}
#endif

View file

@ -1,309 +0,0 @@
/* This file was generated automatically by the Snowball to ANSI C compiler */
#include "../runtime/header.h"
#ifdef __cplusplus
extern "C" {
#endif
extern int swedish_UTF_8_stem(struct SN_env * z);
#ifdef __cplusplus
}
#endif
static int r_other_suffix(struct SN_env * z);
static int r_consonant_pair(struct SN_env * z);
static int r_main_suffix(struct SN_env * z);
static int r_mark_regions(struct SN_env * z);
#ifdef __cplusplus
extern "C" {
#endif
extern struct SN_env * swedish_UTF_8_create_env(void);
extern void swedish_UTF_8_close_env(struct SN_env * z);
#ifdef __cplusplus
}
#endif
static const symbol s_0_0[1] = { 'a' };
static const symbol s_0_1[4] = { 'a', 'r', 'n', 'a' };
static const symbol s_0_2[4] = { 'e', 'r', 'n', 'a' };
static const symbol s_0_3[7] = { 'h', 'e', 't', 'e', 'r', 'n', 'a' };
static const symbol s_0_4[4] = { 'o', 'r', 'n', 'a' };
static const symbol s_0_5[2] = { 'a', 'd' };
static const symbol s_0_6[1] = { 'e' };
static const symbol s_0_7[3] = { 'a', 'd', 'e' };
static const symbol s_0_8[4] = { 'a', 'n', 'd', 'e' };
static const symbol s_0_9[4] = { 'a', 'r', 'n', 'e' };
static const symbol s_0_10[3] = { 'a', 'r', 'e' };
static const symbol s_0_11[4] = { 'a', 's', 't', 'e' };
static const symbol s_0_12[2] = { 'e', 'n' };
static const symbol s_0_13[5] = { 'a', 'n', 'd', 'e', 'n' };
static const symbol s_0_14[4] = { 'a', 'r', 'e', 'n' };
static const symbol s_0_15[5] = { 'h', 'e', 't', 'e', 'n' };
static const symbol s_0_16[3] = { 'e', 'r', 'n' };
static const symbol s_0_17[2] = { 'a', 'r' };
static const symbol s_0_18[2] = { 'e', 'r' };
static const symbol s_0_19[5] = { 'h', 'e', 't', 'e', 'r' };
static const symbol s_0_20[2] = { 'o', 'r' };
static const symbol s_0_21[1] = { 's' };
static const symbol s_0_22[2] = { 'a', 's' };
static const symbol s_0_23[5] = { 'a', 'r', 'n', 'a', 's' };
static const symbol s_0_24[5] = { 'e', 'r', 'n', 'a', 's' };
static const symbol s_0_25[5] = { 'o', 'r', 'n', 'a', 's' };
static const symbol s_0_26[2] = { 'e', 's' };
static const symbol s_0_27[4] = { 'a', 'd', 'e', 's' };
static const symbol s_0_28[5] = { 'a', 'n', 'd', 'e', 's' };
static const symbol s_0_29[3] = { 'e', 'n', 's' };
static const symbol s_0_30[5] = { 'a', 'r', 'e', 'n', 's' };
static const symbol s_0_31[6] = { 'h', 'e', 't', 'e', 'n', 's' };
static const symbol s_0_32[4] = { 'e', 'r', 'n', 's' };
static const symbol s_0_33[2] = { 'a', 't' };
static const symbol s_0_34[5] = { 'a', 'n', 'd', 'e', 't' };
static const symbol s_0_35[3] = { 'h', 'e', 't' };
static const symbol s_0_36[3] = { 'a', 's', 't' };
static const struct among a_0[37] =
{
/* 0 */ { 1, s_0_0, -1, 1, 0},
/* 1 */ { 4, s_0_1, 0, 1, 0},
/* 2 */ { 4, s_0_2, 0, 1, 0},
/* 3 */ { 7, s_0_3, 2, 1, 0},
/* 4 */ { 4, s_0_4, 0, 1, 0},
/* 5 */ { 2, s_0_5, -1, 1, 0},
/* 6 */ { 1, s_0_6, -1, 1, 0},
/* 7 */ { 3, s_0_7, 6, 1, 0},
/* 8 */ { 4, s_0_8, 6, 1, 0},
/* 9 */ { 4, s_0_9, 6, 1, 0},
/* 10 */ { 3, s_0_10, 6, 1, 0},
/* 11 */ { 4, s_0_11, 6, 1, 0},
/* 12 */ { 2, s_0_12, -1, 1, 0},
/* 13 */ { 5, s_0_13, 12, 1, 0},
/* 14 */ { 4, s_0_14, 12, 1, 0},
/* 15 */ { 5, s_0_15, 12, 1, 0},
/* 16 */ { 3, s_0_16, -1, 1, 0},
/* 17 */ { 2, s_0_17, -1, 1, 0},
/* 18 */ { 2, s_0_18, -1, 1, 0},
/* 19 */ { 5, s_0_19, 18, 1, 0},
/* 20 */ { 2, s_0_20, -1, 1, 0},
/* 21 */ { 1, s_0_21, -1, 2, 0},
/* 22 */ { 2, s_0_22, 21, 1, 0},
/* 23 */ { 5, s_0_23, 22, 1, 0},
/* 24 */ { 5, s_0_24, 22, 1, 0},
/* 25 */ { 5, s_0_25, 22, 1, 0},
/* 26 */ { 2, s_0_26, 21, 1, 0},
/* 27 */ { 4, s_0_27, 26, 1, 0},
/* 28 */ { 5, s_0_28, 26, 1, 0},
/* 29 */ { 3, s_0_29, 21, 1, 0},
/* 30 */ { 5, s_0_30, 29, 1, 0},
/* 31 */ { 6, s_0_31, 29, 1, 0},
/* 32 */ { 4, s_0_32, 21, 1, 0},
/* 33 */ { 2, s_0_33, -1, 1, 0},
/* 34 */ { 5, s_0_34, -1, 1, 0},
/* 35 */ { 3, s_0_35, -1, 1, 0},
/* 36 */ { 3, s_0_36, -1, 1, 0}
};
static const symbol s_1_0[2] = { 'd', 'd' };
static const symbol s_1_1[2] = { 'g', 'd' };
static const symbol s_1_2[2] = { 'n', 'n' };
static const symbol s_1_3[2] = { 'd', 't' };
static const symbol s_1_4[2] = { 'g', 't' };
static const symbol s_1_5[2] = { 'k', 't' };
static const symbol s_1_6[2] = { 't', 't' };
static const struct among a_1[7] =
{
/* 0 */ { 2, s_1_0, -1, -1, 0},
/* 1 */ { 2, s_1_1, -1, -1, 0},
/* 2 */ { 2, s_1_2, -1, -1, 0},
/* 3 */ { 2, s_1_3, -1, -1, 0},
/* 4 */ { 2, s_1_4, -1, -1, 0},
/* 5 */ { 2, s_1_5, -1, -1, 0},
/* 6 */ { 2, s_1_6, -1, -1, 0}
};
static const symbol s_2_0[2] = { 'i', 'g' };
static const symbol s_2_1[3] = { 'l', 'i', 'g' };
static const symbol s_2_2[3] = { 'e', 'l', 's' };
static const symbol s_2_3[5] = { 'f', 'u', 'l', 'l', 't' };
static const symbol s_2_4[5] = { 'l', 0xC3, 0xB6, 's', 't' };
static const struct among a_2[5] =
{
/* 0 */ { 2, s_2_0, -1, 1, 0},
/* 1 */ { 3, s_2_1, 0, 1, 0},
/* 2 */ { 3, s_2_2, -1, 1, 0},
/* 3 */ { 5, s_2_3, -1, 3, 0},
/* 4 */ { 5, s_2_4, -1, 2, 0}
};
static const unsigned char g_v[] = { 17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 0, 32 };
static const unsigned char g_s_ending[] = { 119, 127, 149 };
static const symbol s_0[] = { 'l', 0xC3, 0xB6, 's' };
static const symbol s_1[] = { 'f', 'u', 'l', 'l' };
static int r_mark_regions(struct SN_env * z) {
z->I[0] = z->l;
{ int c_test = z->c; /* test, line 29 */
{ int ret = skip_utf8(z->p, z->c, 0, z->l, + 3);
if (ret < 0) return 0;
z->c = ret; /* hop, line 29 */
}
z->I[1] = z->c; /* setmark x, line 29 */
z->c = c_test;
}
if (out_grouping_U(z, g_v, 97, 246, 1) < 0) return 0; /* goto */ /* grouping v, line 30 */
{ /* gopast */ /* non v, line 30 */
int ret = in_grouping_U(z, g_v, 97, 246, 1);
if (ret < 0) return 0;
z->c += ret;
}
z->I[0] = z->c; /* setmark p1, line 30 */
/* try, line 31 */
if (!(z->I[0] < z->I[1])) goto lab0;
z->I[0] = z->I[1];
lab0:
return 1;
}
static int r_main_suffix(struct SN_env * z) {
int among_var;
{ int mlimit; /* setlimit, line 37 */
int m1 = z->l - z->c; (void)m1;
if (z->c < z->I[0]) return 0;
z->c = z->I[0]; /* tomark, line 37 */
mlimit = z->lb; z->lb = z->c;
z->c = z->l - m1;
z->ket = z->c; /* [, line 37 */
if (z->c <= z->lb || z->p[z->c - 1] >> 5 != 3 || !((1851442 >> (z->p[z->c - 1] & 0x1f)) & 1)) { z->lb = mlimit; return 0; }
among_var = find_among_b(z, a_0, 37); /* substring, line 37 */
if (!(among_var)) { z->lb = mlimit; return 0; }
z->bra = z->c; /* ], line 37 */
z->lb = mlimit;
}
switch(among_var) {
case 0: return 0;
case 1:
{ int ret = slice_del(z); /* delete, line 44 */
if (ret < 0) return ret;
}
break;
case 2:
if (in_grouping_b_U(z, g_s_ending, 98, 121, 0)) return 0;
{ int ret = slice_del(z); /* delete, line 46 */
if (ret < 0) return ret;
}
break;
}
return 1;
}
static int r_consonant_pair(struct SN_env * z) {
{ int mlimit; /* setlimit, line 50 */
int m1 = z->l - z->c; (void)m1;
if (z->c < z->I[0]) return 0;
z->c = z->I[0]; /* tomark, line 50 */
mlimit = z->lb; z->lb = z->c;
z->c = z->l - m1;
{ int m2 = z->l - z->c; (void)m2; /* and, line 52 */
if (z->c - 1 <= z->lb || z->p[z->c - 1] >> 5 != 3 || !((1064976 >> (z->p[z->c - 1] & 0x1f)) & 1)) { z->lb = mlimit; return 0; }
if (!(find_among_b(z, a_1, 7))) { z->lb = mlimit; return 0; } /* among, line 51 */
z->c = z->l - m2;
z->ket = z->c; /* [, line 52 */
{ int ret = skip_utf8(z->p, z->c, z->lb, 0, -1);
if (ret < 0) { z->lb = mlimit; return 0; }
z->c = ret; /* next, line 52 */
}
z->bra = z->c; /* ], line 52 */
{ int ret = slice_del(z); /* delete, line 52 */
if (ret < 0) return ret;
}
}
z->lb = mlimit;
}
return 1;
}
static int r_other_suffix(struct SN_env * z) {
int among_var;
{ int mlimit; /* setlimit, line 55 */
int m1 = z->l - z->c; (void)m1;
if (z->c < z->I[0]) return 0;
z->c = z->I[0]; /* tomark, line 55 */
mlimit = z->lb; z->lb = z->c;
z->c = z->l - m1;
z->ket = z->c; /* [, line 56 */
if (z->c - 1 <= z->lb || z->p[z->c - 1] >> 5 != 3 || !((1572992 >> (z->p[z->c - 1] & 0x1f)) & 1)) { z->lb = mlimit; return 0; }
among_var = find_among_b(z, a_2, 5); /* substring, line 56 */
if (!(among_var)) { z->lb = mlimit; return 0; }
z->bra = z->c; /* ], line 56 */
switch(among_var) {
case 0: { z->lb = mlimit; return 0; }
case 1:
{ int ret = slice_del(z); /* delete, line 57 */
if (ret < 0) return ret;
}
break;
case 2:
{ int ret = slice_from_s(z, 4, s_0); /* <-, line 58 */
if (ret < 0) return ret;
}
break;
case 3:
{ int ret = slice_from_s(z, 4, s_1); /* <-, line 59 */
if (ret < 0) return ret;
}
break;
}
z->lb = mlimit;
}
return 1;
}
extern int swedish_UTF_8_stem(struct SN_env * z) {
{ int c1 = z->c; /* do, line 66 */
{ int ret = r_mark_regions(z);
if (ret == 0) goto lab0; /* call mark_regions, line 66 */
if (ret < 0) return ret;
}
lab0:
z->c = c1;
}
z->lb = z->c; z->c = z->l; /* backwards, line 67 */
{ int m2 = z->l - z->c; (void)m2; /* do, line 68 */
{ int ret = r_main_suffix(z);
if (ret == 0) goto lab1; /* call main_suffix, line 68 */
if (ret < 0) return ret;
}
lab1:
z->c = z->l - m2;
}
{ int m3 = z->l - z->c; (void)m3; /* do, line 69 */
{ int ret = r_consonant_pair(z);
if (ret == 0) goto lab2; /* call consonant_pair, line 69 */
if (ret < 0) return ret;
}
lab2:
z->c = z->l - m3;
}
{ int m4 = z->l - z->c; (void)m4; /* do, line 70 */
{ int ret = r_other_suffix(z);
if (ret == 0) goto lab3; /* call other_suffix, line 70 */
if (ret < 0) return ret;
}
lab3:
z->c = z->l - m4;
}
z->c = z->lb;
return 1;
}
extern struct SN_env * swedish_UTF_8_create_env(void) { return SN_create_env(0, 2, 0); }
extern void swedish_UTF_8_close_env(struct SN_env * z) { SN_close_env(z, 0); }

View file

@ -1,16 +0,0 @@
/* This file was generated automatically by the Snowball to ANSI C compiler */
#ifdef __cplusplus
extern "C" {
#endif
extern struct SN_env * swedish_UTF_8_create_env(void);
extern void swedish_UTF_8_close_env(struct SN_env * z);
extern int swedish_UTF_8_stem(struct SN_env * z);
#ifdef __cplusplus
}
#endif

File diff suppressed because it is too large Load diff

View file

@ -1,16 +0,0 @@
/* This file was generated automatically by the Snowball to ANSI C compiler */
#ifdef __cplusplus
extern "C" {
#endif
extern struct SN_env * turkish_UTF_8_create_env(void);
extern void turkish_UTF_8_close_env(struct SN_env * z);
extern int turkish_UTF_8_stem(struct SN_env * z);
#ifdef __cplusplus
}
#endif

View file

@ -1,48 +0,0 @@
sqlite3_unicodesn_sources = [
'fts3_unicode2.c',
'fts3_unicodesn.c',
'static.c',
'libstemmer_c' / 'runtime' / 'api_sq3.c',
'libstemmer_c' / 'runtime' / 'utilities_sq3.c',
]
sqlite3_unicodesn_c_flags = [
'-DSQLITE_ENABLE_FTS4',
'-DSQLITE_ENABLE_FTS4_UNICODE61',
]
sqlite3_unicodesn_stemmers = [
'danish',
'dutch',
'english',
'finnish',
'french',
'german',
'hungarian',
'italian',
'norwegian',
'portuguese',
'romanian',
'russian',
'spanish',
'swedish',
'turkish',
]
foreach stemmer: sqlite3_unicodesn_stemmers
sqlite3_unicodesn_sources += 'libstemmer_c/src_c/stem_UTF_8_@0@.c'.format(stemmer)
sqlite3_unicodesn_c_flags += '-DWITH_STEMMER_@0@'.format(stemmer)
endforeach
sqlite3_unicodesn_includes = [
include_directories('libstemmer_c/runtime'),
include_directories('libstemmer_c/src_c'),
]
sqlite3_unicodesn_lib = static_library('sqlite3-unicodesn',
sqlite3_unicodesn_sources,
dependencies: sqlite,
c_args: sqlite3_unicodesn_c_flags,
include_directories: sqlite3_unicodesn_includes,
)

View file

@ -1,55 +0,0 @@
/*
** 2013 May 16
**
** The author disclaims copyright to this source code. In place of
** a legal notice, here is a blessing:
**
** May you do good and not evil.
** May you find forgiveness for yourself and forgive others.
** May you share freely, never taking more than you give.
**
******************************************************************************
**
** This file was added for Geary to allow use as a static library.
**
*/
#include <sqlite3.h>
#include "fts3_unicodesn.h"
/*
** Register a tokenizer implementation with FTS3 or FTS4.
*/
static int registerTokenizer(
sqlite3 *db,
char *zName,
const sqlite3_tokenizer_module *p
){
int rc;
sqlite3_stmt *pStmt;
const char *zSql = "SELECT fts3_tokenizer(?, ?)";
/* Enable the 2-argument form of fts3_tokenizer in SQLite >= 3.12 */
rc = sqlite3_db_config(db,SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER,1,0);
if( rc!=SQLITE_OK ){
return rc;
}
rc = sqlite3_prepare_v2(db, zSql, -1, &pStmt, 0);
if( rc!=SQLITE_OK ){
return rc;
}
sqlite3_bind_text(pStmt, 1, zName, -1, SQLITE_STATIC);
sqlite3_bind_blob(pStmt, 2, &p, sizeof(p), SQLITE_STATIC);
sqlite3_step(pStmt);
return sqlite3_finalize(pStmt);
}
int sqlite3_unicodesn_register_tokenizer(sqlite3 *db)
{
static const sqlite3_tokenizer_module *tokenizer = 0;
if (!tokenizer)
sqlite3Fts3UnicodeSnTokenizer(&tokenizer);
return registerTokenizer(db, TOKENIZER_NAME, tokenizer);
}

View file

@ -1,4 +1,3 @@
/*
* Copyright 2018 Michael Gratton <mike@vee.net>
*
@ -107,7 +106,7 @@ class Geary.ImapDB.DatabaseTest : TestCase {
);
db.open.end(async_result());
assert_equal<int?>(db.get_schema_version(), 28, "Post-upgrade version");
assert_equal<int?>(db.get_schema_version(), 29, "Post-upgrade version");
// Since schema v22 deletes the re-creates all attachments,
// attachment 12 should no longer exist on the file system and