Complete.Org: Mailing Lists: Archives: freeciv-dev: November 1998:
[Freeciv-Dev] Zulu names 1st try
Home

[Freeciv-Dev] Zulu names 1st try

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxxx
Subject: [Freeciv-Dev] Zulu names 1st try
From: Peter Schaefer <schaefer@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 18 Nov 1998 18:38:59 +0100

I found a few Zulu words on the net, 
split them into word classes.
The function builds city names from the words.
It's probably very wrong for Zulu,
regarding flexion and syllable order, but perhaps something
like this works better for languages you know :-)

They look Zulu though.
At first I had city names with 3 syllables, but I disabled them.
A translation is included in the source.

Apply zulu_city.diff to 
common/city.c
Apply zulu_cityh.diff to
common/city.h

(OW, forgot to delete debug 1 sec - ok)
--
Peter Schaefer           mailto:schaefer@xxxxxxxxxxxxxxxxxxxxxxxxxxx     
X-Url: http://wwwhoppe.math.uni-augsburg.de/~schaefer/
--- freeciv/common/city.h       Wed Nov 18 18:25:46 1998
+++ city.h      Wed Nov 18 17:36:09 1998
@@ -156,9 +156,30 @@
 
 extern struct improvement_type improvement_types[B_LAST];
 
+enum sylab_type {
+  SYL_NONE,
+  SYL_PERSON,
+  SYL_PLACE,/* rock, valley, .. */
+  SYL_BUILDING, /* crossing, borough, .. */
+  SYL_RELATION,
+  SYL_ADJECTIVE,
+  SYL_LEADER,
+  SYL_EVENT,
+  SYL_NATION,
+  SYL_LAST
+};
+
+struct syllable {
+  char syl[40];
+  enum sylab_type syl_type;
+  char eng[40];
+  int  rank; /* 0(most often)..15 = should this appear often in city names ? */
+};
+
 /* initial functions */
 
 char *city_name_suggestion(struct player *pplayer);
+char *zulu_city_name_suggestion();
 
 /* properties */
 
--- freeciv/common/city.c       Wed Nov 18 18:25:37 1998
+++ city.c      Wed Nov 18 18:09:04 1998
@@ -17,6 +17,7 @@
 #include <map.h>
 #include <city.h>
 #include <tech.h>
+#include <shared.h>
 
 static int improvement_upkeep_asmiths(struct city *pcity, int i, int asmiths);
 
@@ -185,7 +186,10 @@
   "Zimbabwe", "Ulundi", "Bapedi", "Hlobane", "Isandhlwana",
   "Intombe", "Mpondo", "Ngome", "Swazi", "Tugela", "Umtata",
   "Umfolozi", "Ibabanago", "Isipezi", "Amatikulu",
-  "Zunguin", (char *)0
+  "Zunguin", 
+  /* battlefields, not sure if cities */
+  "Ndondakasuka","Gingindhlovu","Eshowe",
+  (char *)0
 };
 
 char *default_french_city_names[] = {
@@ -387,13 +391,24 @@
 
 char *city_name_suggestion(struct player *pplayer)
 {
-  char **nptr;
+  char **nptr,*mptr;
   int i;
   static char tempname[100];
+
+  /*if(pplayer->race!=R_ZULU) for debug zulu*/
   for(nptr=race_default_city_names[pplayer->race]; *nptr; nptr++) {
     if(!game_find_city_by_name(*nptr))
       return *nptr;
   }
+
+  if(pplayer->race==R_ZULU){
+    for (i = 0; i < 1000;i++ ) {
+      mptr= zulu_city_name_suggestion();
+      if(!game_find_city_by_name(mptr))
+       return mptr;
+    }
+  }
+
   for (i = 0; i < 1000;i++ ) {
     sprintf(tempname, "city %d", i);
     if (!game_find_city_by_name(tempname)) 
@@ -1069,3 +1084,113 @@
 {
   genlist_insert(&This->list, pcity, -1);
 }
+
+
+/* !PS: I added translation so folks have fun */
+int N_syllables_zulu=40 ;
+struct syllable syllables_zulu[]={
+  {"inkosikazi",SYL_PERSON,"wife",0},
+  {"umyeni",SYL_PERSON,"husband",0},
+  {"intombi",SYL_PERSON,"daughter",0}/* intombe== "daughtercity" ?*/,
+  {"indodana",SYL_PERSON,"son",0},
+  {"umama",SYL_PERSON,"mother",0},
+
+  {"ubaba",SYL_PERSON,"father",0},
+  {"umngane",SYL_PERSON,"friend",0},
+  {"sangoma",SYL_PERSON,"witch doctor",7},
+  {"ngi",SYL_ADJECTIVE,"good(?)",0},
+  {"kubi",SYL_ADJECTIVE,"bad",3},
+
+  {"Ngisi",SYL_NATION,"English",11}/* ( english == "sweettalker" ;-) */,
+  {"Fulentshi",SYL_NATION,"French",11},
+  {"Jalimane",SYL_NATION,"German",11},
+  {"Speyini",SYL_NATION,"Spanish",11},
+  {"Shayina",SYL_NATION,"Chinese",11},
+
+  {"iposi",SYL_BUILDING,"Post office",15},
+  {"imnyuziyamu",SYL_BUILDING,"Museum",15},
+  {"ibhange",SYL_BUILDING,"Bank",15},
+  {"ipholisitheshi",SYL_BUILDING,"Police Station",15},
+  {"isibhedlela",SYL_BUILDING,"Hospital",15},
+
+  /* wonder if should strip 'isi' ?*/
+  {"isikole",SYL_BUILDING,"School",15},
+  {"isonto",SYL_BUILDING,"Church",11},
+  {"isitaladi",SYL_BUILDING,"Street",15},
+  {"isikwele",SYL_BUILDING,"Square",11},
+  {"intaba",SYL_PLACE,"mountain",0},
+
+  {"igquma",SYL_PLACE,"hill",0},
+  {"isigodi",SYL_PLACE,"valley",0},
+  {"ulwandle",SYL_PLACE,"ocean",11},
+  {"ichibi",SYL_PLACE,"lake",0},
+  {"umfala",SYL_PLACE,"river",0},
+
+  {"ibhuloho",SYL_BUILDING,"Bridge",7},
+  /* like to have north west, etc, but cannot find */
+  {"ubunxele",SYL_RELATION,"left",11},
+  {"ubunene",SYL_RELATION,"right",11},
+  {"qondile",SYL_RELATION,"straight",11},
+  {"phezulu",SYL_RELATION,"up",7},
+
+  {"phansi",SYL_RELATION,"down",7},
+  {"kude",SYL_RELATION,"far",11},
+  {"eduze",SYL_RELATION,"near",11},
+  {"de",SYL_RELATION,"lang",7},
+  {"fushane",SYL_RELATION,"short",7}
+};
+
+int syl_order[SYL_LAST]={  
+  0,/*SYL_NONE,*/
+  1,/*SYL_PERSON,*/
+  2,/*SYL_PLACE,*/
+  3,/*SYL_BUILDING, */
+  4,/*SYL_RELATION,*/
+  5,/*SYL_ADJECTIVE,*/
+  6,/*SYL_LEADER,*/
+  7,/*SYL_EVENT,*/
+  8/*SYL_NATION,*/
+};
+
+char *zulu_city_name_suggestion(){
+  static char tempname[121];
+  int r,s,t,tmp;
+  r= myrand(N_syllables_zulu);
+  s= myrand(N_syllables_zulu);
+  t= myrand(N_syllables_zulu);
+
+  if(syl_order[syllables_zulu[r].syl_type]
+     >syl_order[syllables_zulu[s].syl_type])
+    {tmp= r; r=s; s=tmp;}
+
+  if(syl_order[syllables_zulu[s].syl_type]
+     >syl_order[syllables_zulu[t].syl_type])
+    {tmp= t; t=s; s=tmp;}
+
+  if(syl_order[syllables_zulu[r].syl_type]
+     >syl_order[syllables_zulu[s].syl_type])
+    {tmp= r; r=s; s=tmp;}
+  
+  /* for now, no 3 syllable names */
+  if(1|| syllables_zulu[r].syl_type==syllables_zulu[s].syl_type
+     ||syllables_zulu[t].syl_type==syllables_zulu[s].syl_type){
+    /* ignore s */
+    if(syllables_zulu[r].syl_type==syllables_zulu[t].syl_type){
+      /* ignore t */
+      sprintf(tempname,"%s",syllables_zulu[r].syl);
+    }
+    else{
+      sprintf(tempname,"%s%s",syllables_zulu[r].syl,syllables_zulu[t].syl);
+    }
+  }else{
+    sprintf(tempname,"%s%s%s",
+           syllables_zulu[r].syl,
+           syllables_zulu[s].syl,
+           syllables_zulu[t].syl);
+  }
+  tempname[0]= toupper(tempname[0]);
+  tempname[MAX_LENGTH_NAME-1]='\0';/* ugly */
+  return tempname;
+}
+
+

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] Zulu names 1st try, Peter Schaefer <=