Main Page | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

ffpriv_exterior_local_cases.c

Go to the documentation of this file.
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 ffpriv_exterior_local_cases.c Implements functions for inflecting words
00027  * in exterior local cases. They're declared in ffpriv_exterior_local_cases.h.
00028  */
00029 
00030 #include "ffpriv_exterior_local_cases.h"
00031 #include "ffpriv_genitive_stem.h"
00032 #include "ffpriv_plural_stem.h"
00033 #include "ffutil.h"
00034 #include "ffcase.h"
00035 #include "ffpriv_single_letter.h"
00036 
00037 ffint32 ffpriv_adessive_singular(ffword* word) {
00038   ffint32 err;
00039 
00040   if (word->data.len < 2) {
00041     return ffpriv_single_letter(word, FFCASE_ADESSIVE, FFCOUNT_SINGULAR);
00042   }
00043 
00044   if ((err = ffpriv_genitive_stem(word))) {
00045     return err;
00046   }
00047 
00048   return ffstring_append(&word->data, ffpriv_vowel_harmony(&word->data, "lla", "llä"));
00049 }
00050 
00051 ffint32 ffpriv_adessive_plural(ffword* word) {
00052   ffint32 err;
00053 
00054   if (word->data.len < 2) {
00055     return ffpriv_single_letter(word, FFCASE_ADESSIVE, FFCOUNT_PLURAL);
00056   }
00057 
00058   word->metadata.cg = 0;
00059   if ((err = ffpriv_plural_stem(word))) {
00060     return err;
00061   }
00062 
00063   return ffstring_append(&word->data, ffpriv_vowel_harmony(&word->data, "lla", "llä"));
00064 }
00065 
00066 ffint32 ffpriv_ablative_singular(ffword* word) {
00067   ffint32 err;
00068 
00069   if (word->data.len < 2) {
00070     return ffpriv_single_letter(word, FFCASE_ABLATIVE, FFCOUNT_SINGULAR);
00071   }
00072 
00073   if ((err = ffpriv_genitive_stem(word))) {
00074     return err;
00075   }
00076 
00077   return ffstring_append(&word->data, ffpriv_vowel_harmony(&word->data, "lta", "ltä"));
00078 }
00079 
00080 ffint32 ffpriv_ablative_plural(ffword* word) {
00081   ffint32 err;
00082 
00083   if (word->data.len < 2) {
00084     return ffpriv_single_letter(word, FFCASE_ABLATIVE, FFCOUNT_PLURAL);
00085   }
00086 
00087   word->metadata.cg = 0;
00088   if ((err = ffpriv_plural_stem(word))) {
00089     return err;
00090   }
00091 
00092   return ffstring_append(&word->data, ffpriv_vowel_harmony(&word->data, "lta", "ltä"));
00093 }
00094 
00095 ffint32 ffpriv_allative_singular(ffword* word) {
00096   ffint32 err;
00097 
00098   if (word->data.len < 2) {
00099     return ffpriv_single_letter(word, FFCASE_ALLATIVE, FFCOUNT_SINGULAR);
00100   }
00101 
00102   if ((err = ffpriv_genitive_stem(word))) {
00103     return err;
00104   }
00105 
00106   return ffstring_append(&word->data,"lle");
00107 }
00108 
00109 ffint32 ffpriv_allative_plural(ffword* word) {
00110   ffint32 err;
00111 
00112   if (word->data.len < 2) {
00113     return ffpriv_single_letter(word, FFCASE_ALLATIVE, FFCOUNT_PLURAL);
00114   }
00115 
00116   word->metadata.cg = 0;
00117   if ((err = ffpriv_plural_stem(word))) {
00118     return err;
00119   }
00120 
00121   return ffstring_append(&word->data, "lle");
00122 }

Generated on Thu Jun 2 23:16:59 2005 for FinFlect by  doxygen 1.4.2