Changeset 548 for confluence/genderiser

Show
Ignore:
Timestamp:
05/01/09 18:41:31 (15 months ago)
Author:
confluence
Message:

comma escaping

Location:
confluence/genderiser
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • confluence/genderiser/genderiser-pmwiki/genderiser.php

    r542 r548  
    4040 
    4141// GET CONFIG 
    42 // TODO: ESCAPING COMMAS? 
    4342 
    4443    foreach (array("Site/Genderiser","$Group/Genderiser") as $configpage) { 
     
    5756        $var_words = PageTextVar($configpage,"words"); 
    5857        if (isset($var_words)) { 
     58            $var_words = str_replace("\,", "|", $var_words); 
    5959            foreach (split(", *", $var_words) as $word) { 
    6060                $wordpair = PageTextVar($configpage, $word); 
     
    9292                    $so_gender = $gender; 
    9393                } 
    94                 $keywords[$person."_so_".$word] = $words[$word][$so_gender]; 
     94                $keywords[$person."_so_".$word] = str_replace("|", ",", $words[$word][$so_gender]); 
    9595            } 
    9696        } 
  • confluence/genderiser/genderiser-python/LOCAL_EXAMPLE_gender.cfg

    r536 r548  
    66name: Joseph, Jane 
    77s_name: Joe, Jane 
     8hobby: embroidery, hunting\, fishing and beer 
    89 
    910[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  
    6464 
    6565def 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] 
    6769 
    6870GENDERS = { 
     
    110112 
    111113# GET CONFIG 
    112 # TODO: how to escape commas?  CSV-esque format? 
    113114 
    114115conf = ConfigParser.ConfigParser()