00001 /* 00002 * finflect - Algorithms and tools for inflecting Finnish nouns 00003 * Copyright (C) 2004, 2005 The FinFlect Team 00004 * 00005 * This library is free software; you can redistribute it and/or 00006 * modify it under the terms of the GNU Lesser General Public 00007 * License as published by the Free Software Foundation; either 00008 * version 2.1 of the License, or (at your option) any later version. 00009 * 00010 * This library is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 * Lesser General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU Lesser General Public 00016 * License along with this library; if not, write to the Free Software 00017 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00018 * 00019 * 00020 * For the complete legal text of the GNU Lesser General Public License, 00021 * see the file LICENSE. For a complete list of authors and copyright 00022 * holders, see the file AUTHORS. 00023 */ 00024 00025 /** 00026 * @file finflect.h The primary header of the FinFlect public API. Defines the inflection functions. 00027 */ 00028 00029 #ifndef __FINFLECT_H 00030 #define __FINFLECT_H 00031 00032 #ifdef __cplusplus 00033 extern "C" 00034 { 00035 #endif 00036 00037 #include "ffcase.h" 00038 #include "fftypes.h" 00039 00040 /** 00041 * Returns the desired form of the given word. 00042 * @param word The word to inflect 00043 * @param thecase One of the cases defined in ffcase.h 00044 * @param count Either FFCOUNT_SINGULAR or FFCOUNT_PLURAL (defined in ffcase.h) 00045 * @return The inflected word or NULL if error happened 00046 */ 00047 ffchar* ff_inflect(const ffchar* word, ffcase thecase, ffint32 count); 00048 00049 00050 /** 00051 * Returns the nominative singular of the given word. 00052 * The returned string is a malloc(3)'d C-style string that can be freed with free(3). 00053 * @param word The word to inflect 00054 * @return The inflected word or NULL if error happened 00055 */ 00056 ffchar* ff_nominative_singular(const ffchar* word); 00057 00058 /** 00059 * Returns the nominative plural of the given word. 00060 * The returned string is a malloc(3)'d C-style string that can be freed with free(3). 00061 * @param word The word to inflect 00062 * @return The inflected word or NULL if error happened 00063 */ 00064 ffchar* ff_nominative_plural(const ffchar* word); 00065 00066 /** 00067 * Returns the genitive singular of the given word. 00068 * The returned string is a malloc(3)'d C-style string that can be freed with free(3). 00069 * @param word The word to inflect 00070 * @return The inflected word or NULL if error happened 00071 */ 00072 ffchar* ff_genitive_singular(const ffchar* word); 00073 00074 /** 00075 * Returns the genitive plural of the given word. 00076 * The returned string is a malloc(3)'d C-style string that can be freed with free(3). 00077 * @param word The word to inflect 00078 * @return The inflected word or NULL if error happened 00079 */ 00080 ffchar* ff_genitive_plural(const ffchar* word); 00081 00082 /** 00083 * Returns the essive singular of the given word. 00084 * The returned string is a malloc(3)'d C-style string that can be freed with free(3). 00085 * @param word The word to inflect 00086 * @return The inflected word or NULL if error happened 00087 */ 00088 ffchar* ff_essive_singular(const ffchar* word); 00089 00090 /** 00091 * Returns the essive plural of the given word. 00092 * The returned string is a malloc(3)'d C-style string that can be freed with free(3). 00093 * @param word The word to inflect 00094 * @return The inflected word or NULL if error happened 00095 */ 00096 ffchar* ff_essive_plural(const ffchar* word); 00097 00098 /** 00099 * Returns the partitive singular of the given word. 00100 * The returned string is a malloc(3)'d C-style string that can be freed with free(3). 00101 * @param word The word to inflect 00102 * @return The inflected word or NULL if error happened 00103 */ 00104 ffchar* ff_partitive_singular(const ffchar* word); 00105 00106 /** 00107 * Returns the partitive plural of the given word. 00108 * The returned string is a malloc(3)'d C-style string that can be freed with free(3). 00109 * @param word The word to inflect 00110 * @return The inflected word or NULL if error happened 00111 */ 00112 ffchar* ff_partitive_plural(const ffchar* word); 00113 00114 /** 00115 * Returns the translative singular of the given word. 00116 * The returned string is a malloc(3)'d C-style string that can be freed with free(3). 00117 * @param word The word to inflect 00118 * @return The inflected word or NULL if error happened 00119 */ 00120 ffchar* ff_translative_singular(const ffchar* word); 00121 00122 /** 00123 * Returns the translative plural of the given word. 00124 * The returned string is a malloc(3)'d C-style string that can be freed with free(3). 00125 * @param word The word to inflect 00126 * @return The inflected word or NULL if error happened 00127 */ 00128 ffchar* ff_translative_plural(const ffchar* word); 00129 00130 /** 00131 * Returns the inessive singular of the given word. 00132 * The returned string is a malloc(3)'d C-style string that can be freed with free(3). 00133 * @param word The word to inflect 00134 * @return The inflected word or NULL if error happened 00135 */ 00136 ffchar* ff_inessive_singular(const ffchar* word); 00137 00138 /** 00139 * Returns the inessive plural of the given word. 00140 * The returned string is a malloc(3)'d C-style string that can be freed with free(3). 00141 * @param word The word to inflect 00142 * @return The inflected word or NULL if error happened 00143 */ 00144 ffchar* ff_inessive_plural(const ffchar* word); 00145 00146 /** 00147 * Returns the elative singular of the given word. 00148 * The returned string is a malloc(3)'d C-style string that can be freed with free(3). 00149 * @param word The word to inflect 00150 * @return The inflected word or NULL if error happened 00151 */ 00152 ffchar* ff_elative_singular(const ffchar* word); 00153 00154 /** 00155 * Returns the elative plural of the given word. 00156 * The returned string is a malloc(3)'d C-style string that can be freed with free(3). 00157 * @param word The word to inflect 00158 * @return The inflected word or NULL if error happened 00159 */ 00160 ffchar* ff_elative_plural(const ffchar* word); 00161 00162 /** 00163 * Returns the illative singular of the given word. 00164 * The returned string is a malloc(3)'d C-style string that can be freed with free(3). 00165 * @param word The word to inflect 00166 * @return The inflected word or NULL if error happened 00167 */ 00168 ffchar* ff_illative_singular(const ffchar* word); 00169 00170 /** 00171 * Returns the illative plural of the given word. 00172 * The returned string is a malloc(3)'d C-style string that can be freed with free(3). 00173 * @param word The word to inflect 00174 * @return The inflected word or NULL if error happened 00175 */ 00176 ffchar* ff_illative_plural(const ffchar* word); 00177 00178 /** 00179 * Returns the adessive singular of the given word. 00180 * The returned string is a malloc(3)'d C-style string that can be freed with free(3). 00181 * @param word The word to inflect 00182 * @return The inflected word or NULL if error happened 00183 */ 00184 ffchar* ff_adessive_singular(const ffchar* word); 00185 00186 /** 00187 * Returns the adessive plural of the given word. 00188 * The returned string is a malloc(3)'d C-style string that can be freed with free(3). 00189 * @param word The word to inflect 00190 * @return The inflected word or NULL if error happened 00191 */ 00192 ffchar* ff_adessive_plural(const ffchar* word); 00193 00194 /** 00195 * Returns the ablative singular of the given word. 00196 * The returned string is a malloc(3)'d C-style string that can be freed with free(3). 00197 * @param word The word to inflect 00198 * @return The inflected word or NULL if error happened 00199 */ 00200 ffchar* ff_ablative_singular(const ffchar* word); 00201 00202 /** 00203 * Returns the ablative plural of the given word. 00204 * The returned string is a malloc(3)'d C-style string that can be freed with free(3). 00205 * @param word The word to inflect 00206 * @return The inflected word or NULL if error happened 00207 */ 00208 ffchar* ff_ablative_plural(const ffchar* word); 00209 00210 /** 00211 * Returns the allative singular of the given word. 00212 * The returned string is a malloc(3)'d C-style string that can be freed with free(3). 00213 * @param word The word to inflect 00214 * @return The inflected word or NULL if error happened 00215 */ 00216 ffchar* ff_allative_singular(const ffchar* word); 00217 00218 /** 00219 * Returns the allative plural of the given word. 00220 * The returned string is a malloc(3)'d C-style string that can be freed with free(3). 00221 * @param word The word to inflect 00222 * @return The inflected word or NULL if error happened 00223 */ 00224 ffchar* ff_allative_plural(const ffchar* word); 00225 00226 /** 00227 * Returns the abessive singular of the given word. 00228 * The returned string is a malloc(3)'d C-style string that can be freed with free(3). 00229 * @param word The word to inflect 00230 * @return The inflected word or NULL if error happened 00231 */ 00232 ffchar* ff_abessive_singular(const ffchar* word); 00233 00234 /** 00235 * Returns the abessive plural of the given word. 00236 * The returned string is a malloc(3)'d C-style string that can be freed with free(3). 00237 * @param word The word to inflect 00238 * @return The inflected word or NULL if error happened 00239 */ 00240 ffchar* ff_abessive_plural(const ffchar* word); 00241 00242 /** 00243 * Returns the instructive singular of the given word. 00244 * The returned string is a malloc(3)'d C-style string that can be freed with free(3). 00245 * @param word The word to inflect 00246 * @return The inflected word or NULL if error happened 00247 */ 00248 ffchar* ff_instructive_singular(const ffchar* word); 00249 00250 /** 00251 * Returns the instructive plural of the given word. 00252 * The returned string is a malloc(3)'d C-style string that can be freed with free(3). 00253 * @param word The word to inflect 00254 * @return The inflected word or NULL if error happened 00255 */ 00256 ffchar* ff_instructive_plural(const ffchar* word); 00257 00258 /** 00259 * Returns the comitative singular of the given word. 00260 * The returned string is a malloc(3)'d C-style string that can be freed with free(3). 00261 * @param word The word to inflect 00262 * @return The inflected word or NULL if error happened 00263 */ 00264 ffchar* ff_comitative_singular(const ffchar* word); 00265 00266 /** 00267 * Returns the comitative plural of the given word. 00268 * The returned string is a malloc(3)'d C-style string that can be freed with free(3). 00269 * @param word The word to inflect 00270 * @return The inflected word or NULL if error happened 00271 */ 00272 ffchar* ff_comitative_plural(const ffchar* word); 00273 00274 #ifdef __cplusplus 00275 } 00276 #endif 00277 00278 #endif