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_means_cases.c Implements functions for inflecting words 00027 * in means cases. They are declared in ffpriv_means_cases.h. 00028 */ 00029 00030 #include "ffpriv_means_cases.h" 00031 #include "ffpriv_genitive_stem.h" 00032 #include "ffutil.h" 00033 #include "ffpriv_plural_stem.h" 00034 00035 ffint32 ffpriv_abessive_singular(ffword* word) 00036 { 00037 ffint32 err; 00038 00039 if ( (err = ffpriv_genitive_stem(word)) ) { 00040 return err; 00041 } else { 00042 return ffstring_append(&word->data, ffpriv_vowel_harmony(&word->data, "tta", "ttä")); 00043 } 00044 } 00045 00046 ffint32 ffpriv_abessive_plural(ffword* word) 00047 { 00048 word->metadata.cg = 0; 00049 ffpriv_plural_stem(word); 00050 ffstring_append(&word->data, ffpriv_vowel_harmony(&word->data, "tta", "ttä")); 00051 return 0; 00052 } 00053 00054 ffint32 ffpriv_comitative_plural(ffword* word) 00055 { 00056 word->metadata.cg = 1; 00057 ffpriv_plural_stem(word); 00058 ffstring_append(&word->data, "ne"); 00059 return 0; 00060 } 00061 00062 ffint32 ffpriv_instructive_singular(ffword* word) 00063 { 00064 ffint32 err; 00065 00066 if ( (err = ffpriv_genitive_stem(word)) ) { 00067 return err; 00068 } else { 00069 return ffstring_append(&word->data,"n"); 00070 } 00071 } 00072 00073 ffint32 ffpriv_instructive_plural(ffword* word) 00074 { 00075 word->metadata.cg = 0; 00076 ffpriv_plural_stem(word); 00077 ffstring_append(&word->data, "n"); 00078 return 0; 00079 }