summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuval Adam <yuv.adm@gmail.com>2011-05-06 01:11:27 +0300
committerYuval Adam <yuv.adm@gmail.com>2011-05-06 01:11:27 +0300
commitf692db9dc73baf2ceceb17e5debe04dda8d6574f (patch)
tree0484c2aaaad1defe31303bac0053841360d34a6a
parente1ac42c8e2094521bf74bf9a4a119141fff3cb23 (diff)
added AS(adj) function
-rw-r--r--utils.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/utils.py b/utils.py
index 43f2b4a..e486013 100644
--- a/utils.py
+++ b/utils.py
@@ -3,8 +3,18 @@ from consts import SN, SN_
def NS(noun):
"""Noun sexiness function
- Returns a real value measure of the maximum similarity a noun `n not in SN`
- has to each of the `nouns in SN_`
+ 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