blob: e4860131d0b144f31f85ed1e11645d6d95c3e901 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
from brown import brown_collection
from consts import SN, SN_
def NS(noun):
"""Noun sexiness function
Returns a real value measure of the maximum similarity
a `noun not in SN` has to each `noun in SN_`
"""
# return 10**-7 for nouns that occur less than 200 times
return brown_collection.tf_idf(noun, SN_)
def AS(adj):
"""Adjective sexiness function
Returns a real value measure of how likely an adjective `adj`
is to modify a `noun in SN`.
"""
# implementation should return relative frequency of adf
# in sentences in erotica corpus that contain at least
# one noun in SN
return 0
|