Changeset 548 for confluence/genderiser
- Timestamp:
- 05/01/09 18:41:31 (15 months ago)
- Location:
- confluence/genderiser
- Files:
-
- 4 modified
-
genderiser-pmwiki/genderiser.php (modified) (3 diffs)
-
genderiser-python/LOCAL_EXAMPLE_gender.cfg (modified) (1 diff)
-
genderiser-python/example_text.txt (modified) (1 diff)
-
genderiser-python/genderiser.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
confluence/genderiser/genderiser-pmwiki/genderiser.php
r542 r548 40 40 41 41 // GET CONFIG 42 // TODO: ESCAPING COMMAS?43 42 44 43 foreach (array("Site/Genderiser","$Group/Genderiser") as $configpage) { … … 57 56 $var_words = PageTextVar($configpage,"words"); 58 57 if (isset($var_words)) { 58 $var_words = str_replace("\,", "|", $var_words); 59 59 foreach (split(", *", $var_words) as $word) { 60 60 $wordpair = PageTextVar($configpage, $word); … … 92 92 $so_gender = $gender; 93 93 } 94 $keywords[$person."_so_".$word] = $words[$word][$so_gender];94 $keywords[$person."_so_".$word] = str_replace("|", ",", $words[$word][$so_gender]); 95 95 } 96 96 } -
confluence/genderiser/genderiser-python/LOCAL_EXAMPLE_gender.cfg
r536 r548 6 6 name: Joseph, Jane 7 7 s_name: Joe, Jane 8 hobby: embroidery, hunting\, fishing and beer 8 9 9 10 [bob] -
confluence/genderiser/genderiser-python/example_text.txt
r539 r548 1 {$joe_name} is {$bob_name}'s {$joe_grandparent}. {$bob_they,c} likes {$joe_them}. 1 {$joe_name} is {$bob_name}'s {$joe_grandparent}. {$bob_they,c} likes {$joe_them}. {$joe_they,c} likes {$joe_hobby}. -
confluence/genderiser/genderiser-python/genderiser.py
r541 r548 64 64 65 65 def splitlist(string): 66 return [x.strip() for x in string.split(",")] 66 string = string.replace("\,", "|") 67 chunks = [x.strip() for x in string.split(",")] 68 return [x.replace("|",",") for x in chunks] 67 69 68 70 GENDERS = { … … 110 112 111 113 # GET CONFIG 112 # TODO: how to escape commas? CSV-esque format?113 114 114 115 conf = ConfigParser.ConfigParser()
