Custom constants in python humanname not working
Question: I'm following the instructions [here on using the python-
nameparser](https://code.google.com/p/python-nameparser/).

My problem is that for human names containing "assistant professor," I'm
getting 'assistant' is the title, and 'professor' is assigned the role of
first name.

    
    
    >>> o.full_name = 'Assistant Professor Darwin Mittenchops'
    >>> o
    <HumanName : [
        Title: 'Assistant' 
        First: 'Professor' 
        Middle: 'Darwin' 
        Last: 'Mittenchops' 
        Suffix: ''
    ]>
    

Instead of

    
    
    >>> o
    <HumanName : [
        Title: 'Assistant Professor' 
        First: 'Darwin' 
        Middle: '' 
        Last: 'Mittenchops' 
        Suffix: ''
    ]>
    

Their example for adding custom constants to address this is:

    
    
    >>> from nameparser import HumanName
    >>> from nameparser.constants import PREFIXES
    >>> 
    >>> prefixes_c = PREFIXES | set(['te'])
    >>> hn = HumanName(prefixes_c=prefixes_c)
    >>> hn.full_name = "Te Awanui-a-Rangi Black"
    >>> hn
    <HumanName : [
        Title: '' 
        First: 'Te Awanui-a-Rangi' 
        Middle: '' 
        Last: 'Black' 
        Suffix: ''
    ]>
    

So, the following should allow me to make "assistant professor" a title:

    
    
    >>> from nameparser import HumanName
    >>> from nameparser.constants import TITLES
    >>> titles_c = TITLES | set(["assistant professor"])
    >>> hn = HumanName(titles_c=titles_c)
    >>> hn.full_name = 'Assistant Professor Darwin Mittenchops'
    >>> hn
    <HumanName : [
        Title: 'Assistant' 
        First: 'Professor' 
        Middle: 'Darwin' 
        Last: 'Mittenchops' 
        Suffix: ''
    ]>
    

No dice.

    
    
    >>> "assistant professor" in titles_c
    True
    

So, I know it's there. Just doesn't seem to work.


Answer: Ah, I read too quickly. The code _can_ handle combined words, but we need to
add the words individually to the `titles_c` set, not as a unit. Example:

    
    
    >>> from nameparser import HumanName
    >>> from nameparser.constants import TITLES
    >>> titles_c = TITLES | set("assistant professor".split())
    >>> hn = HumanName(titles_c=titles_c)
    >>> hn.full_name = "Assistant Professor Darwin Mittenchops"
    >>> hn
    <HumanName : [
        Title: 'Assistant Professor' 
        First: 'Darwin' 
        Middle: '' 
        Last: 'Mittenchops' 
        Suffix: ''
    ]>
    

