On Nov 1, 11:21 pm, cesco <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I have a defaultdict which I have initialized as follows:
>
> def train(features):
> model = collections.defaultdict(lambda: 1)
> for f in features:
> model[f] += 1
> return model
>
> def_dict = train(large_set_of_wo
Hi,
I have a defaultdict which I have initialized as follows:
def train(features):
model = collections.defaultdict(lambda: 1)
for f in features:
model[f] += 1
return model
def_dict = train(large_set_of_words)
where large_set_of_words is the list of possible strings.
I'd lik