[addresses] Roman numerals can be returned by Floor.random, relaxing the Zipfian distribution on floors so we get higher floors

This commit is contained in:
Al
2016-06-28 19:47:23 -04:00
parent a613bdbf74
commit 5b17a3a3ce
2 changed files with 10 additions and 2 deletions

View File

@@ -117,6 +117,7 @@ class NumberedComponent(object):
ALPHA = 'alpha'
ALPHA_PLUS_NUMERIC = 'alpha_plus_numeric'
NUMERIC_PLUS_ALPHA = 'numeric_plus_alpha'
ROMAN_NUMERAL = 'roman_numeral'
@classmethod
def choose_alphanumeric_type(cls, key, language, country=None):
@@ -127,7 +128,7 @@ class NumberedComponent(object):
values = []
probs = []
for num_type in (cls.NUMERIC, cls.ALPHA, cls.ALPHA_PLUS_NUMERIC, cls.NUMERIC_PLUS_ALPHA):
for num_type in (cls.NUMERIC, cls.ALPHA, cls.ALPHA_PLUS_NUMERIC, cls.NUMERIC_PLUS_ALPHA, cls.ROMAN_NUMERAL):
key = '{}_probability'.format(num_type)
prob = alphanumeric_props.get(key)
if prob is not None: