Permalink
Browse files

Maintain language names in dialects

Instead of giving dialects new names derived from the parent language's,
use the same name and just change the definition. This prevents an
explosion of bizarre dialect names and make sense.

Also make state names derive from nations just like languages, gives results
like U/Ungi/Ude' and Rid/Ridhef/Ridchiz.
  • Loading branch information...
tps12 committed Nov 30, 2018
1 parent 17d3851 commit 7d4ee8938076f70ecff1d6940208d7e5e59c2f1d
Showing with 22 additions and 5 deletions.
  1. +4 −3 historysimulation.py
  2. +18 −2 language/lazy.py
@@ -299,7 +299,7 @@ def grow(self, stept):
dialect = self._languages[lang].clone()
self._languages.append(dialect)
index = len(self._languages) - 1
dialect.derive(('language', lang), ('language', index))
dialect.redefine('language', lang, index)
for f in faces:
for c in self._population[f].communities:
if c.language == lang:
@@ -614,7 +614,7 @@ def update(self):
dialect = self._languages[winnerlang].clone()
self._languages.append(dialect)
index = len(self._languages) - 1
dialect.derive(('language', winnerlang), ('language', index))
dialect.redefine('language', winnerlang, index)
oldlang = winnerlang
winnerlang = index
for concept in self._languages[lang]:
@@ -1072,7 +1072,8 @@ def langfromspecies(languagespecies):
yield None
else:
lang = language.lazy.History(HistorySimulation._timing,
[('species', s) for s in ss] + [('nation', l), ('state', l)])
[('species', s) for s in ss] + [('nation', l)])
lang.derive(('nation', l), ('state', l))
lang.derive(('nation', l), ('language', l))
yield lang
@@ -29,9 +29,9 @@ def borrow(word, stats, existing):
return derivefrom(word, stats, existing)
def reify(langs, index, ticks, borrowsubset, timing, indent):
(conceptlist, soundchanges, neologisms, loans, derivations) = (
(conceptlist, soundchanges, neologisms, loans, derivations, redefinitions) = (
langs[index]._concepts, langs[index]._changes, langs[index]._neologisms,
langs[index]._loans, langs[index]._derivations)
langs[index]._loans, langs[index]._derivations, langs[index]._redefinitions)
concept_words = {}
origins = {}
existing = set()
@@ -99,6 +99,14 @@ def reify(langs, index, ticks, borrowsubset, timing, indent):
existing.add(derived)
origins[concept] = language.dictionary.Origin(original, None)
if t in redefinitions:
timing.start('{}redefining words'.format(indent))
for (src_index, dest_index) in redefinitions[t]:
src_concept, dest_concept = conceptlist[src_index], conceptlist[dest_index]
for d in (concept_words, origins):
d[dest_concept] = d[src_concept]
del d[src_concept]
if ('language', index) not in concept_words:
import pdb; pdb.set_trace()
timing.start('{}setting origins'.format(indent))
@@ -121,6 +129,7 @@ def __init__(self, timing, concepts):
self._lookup = {}
self._loans = {}
self._derivations = {}
self._redefinitions = {}
self._neologisms = {}
self._changes = [[]]
self.coin(concepts)
@@ -131,6 +140,7 @@ def clone(self):
clone._lookup = dict(self._lookup)
clone._loans = copy.deepcopy(self._loans)
clone._derivations = copy.deepcopy(self._derivations)
clone._redefinitions = copy.deepcopy(self._redefinitions)
clone._neologisms = copy.deepcopy(self._neologisms)
clone._changes = copy.deepcopy(self._changes)
return clone
@@ -177,6 +187,12 @@ def derive(self, src_concept, dest_concept):
self._derivations[t] = []
self._derivations[t].append((src_concept, self._add(dest_concept)))
def redefine(self, kind, src_index, dest_index):
t = len(self._changes) - 1
if t not in self._redefinitions:
self._redefinitions[t] = []
self._redefinitions[t].append((self._lookup[(kind, src_index)], self._add((kind, dest_index))))
def coin(self, concepts):
t = len(self._changes) - 1
if t not in self._neologisms:

0 comments on commit 7d4ee89

Please sign in to comment.