³ò
4ÒÇIc           @   sÑ   d  d k  Z  d  d k l Z d  d k Td e f d „  ƒ  YZ d e f d „  ƒ  YZ d f  d	 „  ƒ  YZ d
 e f d „  ƒ  YZ d e f d „  ƒ  YZ	 d „  Z
 d „  Z d „  Z d „  Z e d j o e
 ƒ  n d S(   iÿÿÿÿN(   t   parse_dependency_grammar(   t   *t   DependencyScorerIc           B   s;   e  Z d  Z d „  Z d „  Z d „  Z d „  Z d „  Z RS(   sÊ  
    A scorer for calculated the weights on the edges of a weighted 
    dependency graph.  This is used by a 
    C{ProbabilisticNonprojectiveParser} to initialize the edge  
    weights of a C{DependencyGraph}.  While typically this would be done 
    by training a binary classifier, any class that can return a 
    multidimensional list representation of the edge weights can 
    implement this interface.  As such, it has no necessary
    fields.
    c         C   s$   |  i  t j o t d ƒ ‚ n d  S(   Ns*   DependencyScorerI is an abstract interface(   t	   __class__R   t	   TypeError(   t   self(    (    s>   /p/zhu/06/nlp/nltk/nltk/parse/nonprojectivedependencyparser.pyt   __init__    s    c         C   s   t  d ƒ ‚ d S(   s"  
        @type graphs: A list of C{DependencyGraph}
        @param graphs: A list of dependency graphs to train the scorer.
        Typically the edges present in the graphs can be used as
        positive training examples, and the edges not present as negative 
        examples.
        s*   DependencyScorerI is an abstract interfaceN(   t   AssertionError(   R   t   graphs(    (    s>   /p/zhu/06/nlp/nltk/nltk/parse/nonprojectivedependencyparser.pyt   train$   s    c         C   s   t  d ƒ ‚ d S(   sa  
        @type graph: A C{DependencyGraph}
        @param graph: A dependency graph whose set of edges need to be 
        scored.  
        @rtype: A three-dimensional list of numbers.
        @return: The score is returned in a multidimensional(3) list, such
        that the outer-dimension refers to the head, and the
        inner-dimension refers to the dependencies.  For instance,  
        scores[0][1] would reference the list of scores corresponding to 
        arcs from node 0 to node 1.  The node's 'address' field can be used 
        to determine its number identification.
        
        For further illustration, a score list corresponding to Fig.2 of 
        Keith Hall's 'K-best Spanning Tree Parsing' paper:
              scores = [[[], [5],  [1],  [1]],
                       [[], [],   [11], [4]],
                       [[], [10], [],   [5]],
                       [[], [8],  [8],  []]]
        When used in conjunction with a MaxEntClassifier, each score would 
        correspond to the confidence of a particular edge being classified 
        with the positive training examples.
        s*   DependencyScorerI is an abstract interfaceN(   R   (   R   t   graph(    (    s>   /p/zhu/06/nlp/nltk/nltk/parse/nonprojectivedependencyparser.pyt   score.   s    c         C   s   t  d ƒ ‚ d  S(   Ns*   DependencyScorerI is an abstract interface(   R   (   R   t   other(    (    s>   /p/zhu/06/nlp/nltk/nltk/parse/nonprojectivedependencyparser.pyt   __cmp__J   s    c         C   s   t  d ƒ ‚ d  S(   Ns*   DependencyScorerI is an abstract interface(   R   (   R   R   (    (    s>   /p/zhu/06/nlp/nltk/nltk/parse/nonprojectivedependencyparser.pyt   __hash__M   s    (   t   __name__t
   __module__t   __doc__R   R	   R   R   R   (    (    (    s>   /p/zhu/06/nlp/nltk/nltk/parse/nonprojectivedependencyparser.pyR      s   
		
		t   NaiveBayesDependencyScorerc           B   s)   e  Z d  Z d „  Z d „  Z d „  Z RS(   sç   
    A dependency scorer built around a MaxEnt classifier.  In this
    particular class that classifier is a C{NaiveBayesClassifier}.
    It uses head-word, head-tag, child-word, and child-tag features
    for classification.
    c         C   s   Hd  S(   N(    (   R   (    (    s>   /p/zhu/06/nlp/nltk/nltk/parse/nonprojectivedependencyparser.pyR   ^   s    c   
      C   s  g  } xÒ | D]Ê } xÁ | i  D]¶ } x­ t t | i  ƒ ƒ D]– } | i | ƒ } | | d j o
 d } n d } | d | d | d | d g } | i t d | d d | d d | d d	 | d ƒ | f ƒ q9 Wq Wq Wd
 d k }	 |	 i |	 i ƒ |	 i	 i
 i | ƒ |  _ d S(   s‡  
        Trains a C{NaiveBayesClassifier} using the edges present in 
        graphs list as positive examples, the edges not present as
        negative examples.  Uses a feature vector of head-word,
        head-tag, child-word, and child-tag.
        
        @type graphs: A list of C{DependencyGraph}
        @param graphs: A list of dependency graphs to train the scorer.     
        t   depst   Tt   Ft   wordt   tagt   at   bt   ct   diÿÿÿÿN(   t   nodelistt   ranget   lent   get_by_addresst   appendt   dictt   nltkt   usaget   ClassifierIt   classifyt   NaiveBayesClassifierR	   t
   classifier(
   R   R   t   labeled_examplesR
   t	   head_nodet   child_indext
   child_nodet   labelt   featuresR"   (    (    s>   /p/zhu/06/nlp/nltk/nltk/parse/nonprojectivedependencyparser.pyR	   a   s      
  
"Jc         C   sY  g  } x t  t | i ƒ ƒ D]† } x} t  t | i ƒ ƒ D]f } | i | ƒ } | i | ƒ } | GH| GH| i t d | d d | d d | d d | d ƒ ƒ q8 Wq Wg  } g  } d }	 xš |  i i | ƒ D]† }
 d |
 i d	 ƒ |
 i d
 ƒ f GH| i t	 i
 |
 i d	 ƒ ƒ g ƒ |	 d 7}	 |	 t | i ƒ j o | i | ƒ g  } d }	 qË qË W| S(   sÑ  
        Converts the graph into a feature-based representation of 
        each edge, and then assigns a score to each based on the 
        confidence of the classifier in assigning it to the 
        positive label.  Scores are returned in a multidimensional list.
        
        @type graph: C{DependencyGraph}
        @param graph: A dependency graph to score.
        @rtype: 3 dimensional list
        @return: Edge scores for the graph parameter.
        R   R   R   R   R   R   i    s	   %.4f %.4fR   R   i   (   R   R   R   R   R    R!   R'   t   batch_prob_classifyt   probt   matht   log(   R   R
   t   edgest   it   jR)   R+   t   edge_scorest   rowt   countt   pdist(    (    s>   /p/zhu/06/nlp/nltk/nltk/parse/nonprojectivedependencyparser.pyR   }   s.      @ !"
(   R   R   R   R   R	   R   (    (    (    s>   /p/zhu/06/nlp/nltk/nltk/parse/nonprojectivedependencyparser.pyR   V   s   		t
   DemoScorerc           B   s   e  Z d  „  Z d „  Z RS(   c         C   s	   d GHd  S(   Ns   Training...(    (   R   R   (    (    s>   /p/zhu/06/nlp/nltk/nltk/parse/nonprojectivedependencyparser.pyR	   §   s    c         C   s[   g  d g d g d g g g  g  d g d g g g  d g g  d g g g  d g d g g  g g S(   Ni   i   i   i   i
   i   (    (   R   R
   (    (    s>   /p/zhu/06/nlp/nltk/nltk/parse/nonprojectivedependencyparser.pyR   ª   s    (   R   R   R	   R   (    (    (    s>   /p/zhu/06/nlp/nltk/nltk/parse/nonprojectivedependencyparser.pyR9   ¥   s   	t    ProbabilisticNonprojectiveParserc           B   sh   e  Z d  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 d	 „  Z d
 „  Z RS(   sÞ  
    A probabilistic non-projective dependency parser.  Nonprojective 
    dependencies allows for "crossing branches" in the parse tree 
    which is necessary for representing particular linguistic 
    phenomena, or even typical parses in some languages.  This parser 
    follows the MST parsing algorithm, outlined in McDonald(2005), 
    which likens the search for the best non-projective parse to 
    finding the maximum spanning tree in a weighted directed graph.
    c         C   s	   d GHd S(   s6   
        Creates a new non-projective parser.
        s#   initializing prob. nonprojective...N(    (   R   (    (    s>   /p/zhu/06/nlp/nltk/nltk/parse/nonprojectivedependencyparser.pyR   ¿   s    c         C   s   | |  _  |  i  i | ƒ d S(   s  
        Trains a C{DependencyScorerI} from a set of C{DependencyGraph} objects,
        and establishes this as the parser's scorer.  This is used to 
        initialize the scores on a C{DependencyGraph} during the parsing 
        procedure.
        
        @type graphs: A list of C{DependencyGraph}
        @param graphs: A list of dependency graphs to train the scorer.
        @type dependency_scorer: C{DependencyScorerI}
        @param dependency_scorer: A scorer which implements the
        C{DependencyScorerI} interface.
        N(   t   _scorerR	   (   R   R   t   dependency_scorer(    (    s>   /p/zhu/06/nlp/nltk/nltk/parse/nonprojectivedependencyparser.pyR	   Å   s    	c         C   s   |  i  i | ƒ |  _ d S(   s3  
        Assigns a score to every edge in the C{DependencyGraph} graph.
        These scores are generated via the parser's scorer which 
        was assigned during the training process.
        
        @type graph: C{DependencyGraph}
        @param graph: A dependency graph to assign scores to.
        N(   R;   R   t   scores(   R   R
   (    (    s>   /p/zhu/06/nlp/nltk/nltk/parse/nonprojectivedependencyparser.pyt   initialize_edge_scoresÕ   s    	c         C   sK   d GHx | D] } | i  | ƒ q W| i i | ƒ | i | | d ƒ d S(   sX  
        Takes a list of nodes that have been identified to belong to a cycle,
        and collapses them into on larger node.  The arcs of all nodes in 
        the graph must be updated to account for this.
        
        @type new_node: Node.
        @param new_node: A Node (Dictionary) to collapse the cycle nodes into.
        @type cycle_path: A list of integers.
        @param cycle_path: A list of node addresses, each of which is in the cycle.
        @type g_graph, b_graph, c_graph: C{DependencyGraph}
        @param g_graph, b_graph, c_graph: Graphs which need to be updated.
        s   Collapsing nodes...t   addressN(   t   remove_by_addressR   R    t   redirect_arcs(   R   t   new_nodet
   cycle_patht   g_grapht   b_grapht   c_grapht   cycle_node_index(    (    s>   /p/zhu/06/nlp/nltk/nltk/parse/nonprojectivedependencyparser.pyt   collapse_nodesà   s     c         C   s®  d G| GH|  i  | ƒ } d G| GHd G|  i GHxû t |  i ƒ D]ê \ } } xÛ t |  i | ƒ D]Æ \ } } |  i | | GH| | j o | | j o t |  i | | ƒ d j or g  } |  i | | ƒ } |  i | | Gd G| GHx* |  i | | D] }	 | i |	 | ƒ qó W| |  i | | <q] q] Wq= Wxp t |  i ƒ D]_ \ } } xP t |  i | ƒ D]; \ } }
 | | j o" | | j o g  |  i | | <q[q[Wq;Wd G|  i GHd S(   sM  
        Updates the edge scores to reflect a collapse operation into
        new_node.
        
        @type new_node: A Node.
        @param new_node: The node which cycle nodes are collapsed into.
        @type cycle_path: A list of integers.
        @param cycle_path: A list of node addresses that belong to the cycle.
        t   cycles
   old cycle s   Prior to update:
i    s    - s   After update:
N(   t   compute_original_indexesR=   t	   enumerateR   t   compute_max_subtract_scoreR    (   R   RB   RC   R3   R6   R4   t   columnt   new_valst   subtract_valt   cur_valt   cell(    (    s>   /p/zhu/06/nlp/nltk/nltk/parse/nonprojectivedependencyparser.pyt   update_edge_scoresô   s0    
		  8   c         C   sœ   t  } x | o‡ g  } t } xn | D]f } |  i i | ƒ o@ xJ |  i | D]* } | | j o | i | ƒ t  } qJ qJ Wq# | i | ƒ q# W| } q	 W| S(   sÒ  
        As nodes are collapsed into others, they are replaced 
        by the new node in the graph, but it's still necessary
        to keep track of what these original nodes were.  This
        takes a list of node addresses and replaces any collapsed
        node addresses with their original addresses.
        
        @type new_address: A list of integers.
        @param new_addresses: A list of node addresses to check for
        subsumed nodes.
        (   t   Truet   Falset   inner_nodest   has_keyR    (   R   t   new_indexest   swappedt	   originalst	   new_indext   old_val(    (    s>   /p/zhu/06/nlp/nltk/nltk/parse/nonprojectivedependencyparser.pyRJ     s    
  c         C   sN   d } xA | D]9 } x0 |  i  | | D] } | | j o
 | } q% q% Wq W| S(   s  
        When updating scores the score of the highest-weighted incoming
        arc is subtracted upon collapse.  This returns the correct 
        amount to subtract from that edge.
        
        @type column_index: integer.
        @param column_index: A index representing the column of incoming arcs
        to a particular node being updated
        @type cycle_indexes: A list of integers.
        @param cycle_indexes: Only arcs from cycle nodes are considered.  This 
        is a list of such nodes addresses.
        i`yþÿ(   R=   (   R   t   column_indext   cycle_indexest	   max_scoret	   row_indexRO   (    (    s>   /p/zhu/06/nlp/nltk/nltk/parse/nonprojectivedependencyparser.pyRL   -  s      c   	      C   s÷   |  i  | g ƒ } d G| GHt } t } xŽ t t |  i ƒ ƒ D]w } xn t t |  i | ƒ ƒ D]S } | | j o@ |  i | | | j o( |  i | | } | } | Gd G| GHq] q] Wq= W| GHx3 |  i D]( } |  i | } | | j o | SqÇ qÇ W| S(   sü   
        Returns the source of the best incoming arc to the 
        node with address: node_index
        
        @type node_index: integer.
        @param node_index: The address of the 'destination' node,
        the node that is arced to.
        s
   originals:t   ,(   RJ   t   NoneR   R   R=   RU   (	   R   t
   node_indexRY   t   max_arcR^   R_   t	   col_indext   keyt   replaced_nodes(    (    s>   /p/zhu/06/nlp/nltk/nltk/parse/nonprojectivedependencyparser.pyt   best_incoming_arcB  s&    		  %
 c         C   s¸   |  i  | g ƒ } t } t } t } x‡ t t |  i ƒ ƒ D]p } xg t t |  i | ƒ ƒ D]L } | | j o9 |  i | | | j o! |  i | | } | } | } qZ qZ Wq: W| | g S(   s   
        ???
        (   RJ   Ra   R   R   R=   (   R   Rb   RY   Rc   R^   t   max_origR_   Rd   (    (    s>   /p/zhu/06/nlp/nltk/nltk/parse/nonprojectivedependencyparser.pyt   original_best_arc]  s      %c         C   s{  h  |  _  t ƒ  } x_ t | ƒ D]Q \ } } | i i h  | d <| | d <g  d <d d <| d d <ƒ q W| i ƒ  t ƒ  } x_ t | ƒ D]Q \ } } | i i h  | d <| | d <g  d <d d <| d d <ƒ q” Wt ƒ  } g  | _ t ƒ  } g  }	 t | ƒ D]H \ } } |	 h  | d <| | d <g  d <d d <| d d <q~	 | _ |  i | ƒ |  i GHg  }
 | i D] } |
 | d qŒ~
 } t | ƒ } h  } xôt | ƒ d j oà| i	 d ƒ } d	 G| GH| i
 | ƒ } d
 G| GH|  i | ƒ } |  i | ƒ | | <d G| Gd G| GHxE | | g D]7 } | i h  d d <g  d <d d <| d <ƒ q>W| i | | ƒ | i ƒ  } | oÚ h  d d <g  d <d d <| d d <} | i | ƒ |  i | | ƒ |  i | | | | | ƒ x" | D] } | i | d | ƒ qW| |  i  | d <| i d | d ƒ | d 7} x | D] } | i | ƒ q[Wn d G| GHHd G| GHHd G| GHHd G| GHd G|  i  GHHq»Wd G|  i GHd GHx; t t | ƒ d | d ƒ D] } | | | | | d <qÞWd G| GHt ƒ  } x | i D] } g  | d <qWxA t d t | ƒ d ƒ D]& } | i | | d | | d ƒ qHW| Sd GH(   sw  
        Parses a list of tokens in accordance to the MST parsing algorithm
        for non-projective dependency parses.  Assumes that the tokens to 
        be parsed have already been tagged and those tags are provided.  Various 
        scoring methods can be used by implementing the C{DependencyScorerI}
        interface and passing it to the training algorithm.
        
        @type tokens: A list of C{String}.
        @param tokens: A list of words or punctuation to be parsed.
        @type tags: A List of C{String}.
        @param tags: A list of tags corresponding by index to the words in the tokens list.
        R   R   R   t   NTOPt   reli   R?   i    s   current_vertex:s   current_node:s   best in arc: s    --> t   TEMPt   NONEs	   g_graph:
s	   b_graph:
s	   c_graph:
s   Betas:
s   replaced nodess   Final scores:
s   Recovering parse...s   Betas: s   Done.(   RU   t   DependencyGraphRK   R   R    t   connect_graphR>   R=   R   t   popR   Rg   Ri   t   add_nodet   add_arct   contains_cycleRR   RH   t   insertR@   R   (   R   t   tokenst   tagsRD   t   indext   tokent   original_graphRE   RF   t   _[1]t   _[2]t   vertext   unvisited_verticest   nr_verticest   betast   current_vertext   current_nodet   best_in_edget
   new_vertexRC   RB   t   cycle_indext   cycle_node_addressR3   t	   new_grapht   node(    (    s>   /p/zhu/06/nlp/nltk/nltk/parse/nonprojectivedependencyparser.pyt   parsen  sŽ    		 I
	 I			^(		 5. 
 				 		
  $(   R   R   R   R   R	   R>   RH   RR   RJ   RL   Rg   Ri   Rˆ   (    (    (    s>   /p/zhu/06/nlp/nltk/nltk/parse/nonprojectivedependencyparser.pyR:   µ   s   										t   NonprojectiveDependencyParserc           B   s    e  Z d  Z d „  Z d „  Z RS(   sz  
    A non-projective, rule-based, dependency parser.  This parser 
    will return the set of all possible non-projective parses based on 
    the word-to-word relations defined in the parser's dependency 
    grammar, and will allow the branches of the parse tree to cross 
    in order to capture a variety of linguistic phenomena that a 
    projective parser will not.
    c         C   s   | |  _  d S(   s¾   
        Creates a new C{NonprojectiveDependencyParser}.

        @param dependency_grammar: a grammar of word-to-word relations.
        @type depenedncy_grammar: C{DependencyGrammar}
	    N(   t   _grammar(   R   t   dependency_grammar(    (    s>   /p/zhu/06/nlp/nltk/nltk/parse/nonprojectivedependencyparser.pyR   æ  s    c         C   s”  t  ƒ  |  _ g  |  i _ xQ t | ƒ D]C \ } } |  i i i h  | d <g  d <d d <| d <ƒ q% Wx„ |  i i D]v } g  } x] |  i i D]O } |  i i | d | d ƒ o+ | d | d j o | i | d ƒ q’ q’ W| | d <qy Wg  } g  } x¢ t | ƒ D]” \ }	 }
 g  } xN t | ƒ D]@ \ } } |	 | j o' |  i i | |
 ƒ o | i | ƒ q+q+Wt | ƒ d j o | i |	 ƒ n | i | ƒ qWt | ƒ d j o d GHt SnB t | ƒ d j o. x+ t	 t | ƒ ƒ D] }	 | i |	 ƒ qêWn g  } xN| D]F} g  } g  } t	 t | ƒ ƒ D] }	 | g  q5~ } d }	 t
 } xþ|	 d j oð| oƒ t | |	 ƒ d j o | |	 d | |	 <qñt | |	 ƒ d j o d	 | |	 <qñ| |	 i ƒ  } | | |	 <| i |	 | g ƒ n | pt } x) | D]! } | d |	 j o
 t
 } qqWt | |	 ƒ } | ou | d j oh x° t t | ƒ d d	 d	 ƒ D]C } | | } | d |	 j o" | |	 i | i | ƒ d ƒ qkqkWq| oD | d j o7 | |	 i ƒ  } | | |	 <| i |	 | g ƒ t
 } qn |	 d t | ƒ j o | i | ƒ t } n | o |	 d 7}	 qZ|	 d 8}	 qZWqWg  } x+| D]#} d } g  } x; t | ƒ D]- \ }	 } | d	 j o | d 7} |	 } qˆqˆW| d j oÆ t  ƒ  } | d | i d d <x” t	 t | ƒ ƒ D]€ }	 h  | |	 d <|	 d d <} g  } t	 t | ƒ ƒ D]& } | | |	 j o | | d q4q4~ | d <| i i | ƒ q÷W| i | ƒ qiqiW| S(
   sÛ  
        Parses the input tokens with respect to the parser's grammar.  Parsing 
        is accomplished by representing the search-space of possible parses as 
        a fully-connected directed graph.  Arcs that would lead to ungrammatical 
        parses are removed and a lattice is constructed of length n, where n is 
        the number of input tokens, to represent all possible grammatical 
        traversals.  All possible paths through the lattice are then enumerated
        to produce the set of non-projective parses.

        param tokens: A list of tokens to parse.
        type tokens: A C{list} of L{String}.
        return: A set of non-projective parses.
        rtype: A C{list} of L{DependencyGraph} 
        R   R   Rj   Rk   R?   i    i   s   No parses found.iÿÿÿÿ(   Rn   t   _graphR   RK   R    RŠ   t   containsR   RT   R   RS   Rp   t   xrange(   R   Ru   Rw   Rx   R)   R   t   dep_nodet   rootst   possible_headsR3   R   t   headsR4   t   headt   analysest   roott   stackRz   t   analysist   forwardt   index_on_stackt
   stack_itemt   orig_lengthR   t
   root_countRQ   R
   R‡   R{   (    (    s>   /p/zhu/06/nlp/nltk/nltk/parse/nonprojectivedependencyparser.pyRˆ   ï  s¸     ;  4  #  -
  
*

  
	  J(   R   R   R   R   Rˆ   (    (    (    s>   /p/zhu/06/nlp/nltk/nltk/parse/nonprojectivedependencyparser.pyR‰   Ü  s   		c           C   s   t  ƒ  t ƒ  d  S(   N(   t   nonprojective_conll_parse_demot   rule_based_demo(    (    (    s>   /p/zhu/06/nlp/nltk/nltk/parse/nonprojectivedependencyparser.pyt   democ  s    c          C   sI   t  ƒ  }  |  i g  t ƒ  ƒ |  i d d d g d  d  d  g ƒ } | GHd  S(   Nt   v1t   v2t   v3(   R:   R	   R9   Rˆ   Ra   (   t   nppt   parse_graph(    (    s>   /p/zhu/06/nlp/nltk/nltk/parse/nonprojectivedependencyparser.pyt	   hall_demoi  s    	$c       
   C   s“   g  }  t  i d ƒ D] } | o |  t | ƒ q q ~  } t ƒ  } | i | t ƒ  ƒ | i d d d d d g d d d	 d
 d d g ƒ } | GHd  S(   Ns   

t   Cathyt   zagt   hent   zwaaient   .t   Nt   Vt   Pront   Adjt   Punc(   t   conll_data2t   splitRn   R:   R	   R   Rˆ   (   Rz   t   entryR   R£   R¤   (    (    s>   /p/zhu/06/nlp/nltk/nltk/parse/nonprojectivedependencyparser.pyR   o  s    4	3c          C   sl   t  d ƒ }  |  GHt |  ƒ } | i d d d d d d d d d	 d
 d g ƒ } d GHx | D] } | GHqY Wd  S(   Ns¬   
    'taught' -> 'play' | 'man'
    'man' -> 'the' | 'in'
    'in' -> 'corner'
    'corner' -> 'the'
    'play' -> 'golf' | 'dachshund' | 'to'
    'dachshund' -> 'his'
    t   thet   mant   int   cornert   taughtt   hist	   dachshundt   tot   playt   golfs   Graphs:(   R    R‰   Rˆ   (   t   grammart   ndpR   R
   (    (    s>   /p/zhu/06/nlp/nltk/nltk/parse/nonprojectivedependencyparser.pyRž   w  s    	0 t   __main__(   R0   R"   R    t   dependencygrapht   objectR   R   R9   R:   R‰   RŸ   R¥   R   Rž   R   (    (    (    s>   /p/zhu/06/nlp/nltk/nltk/parse/nonprojectivedependencyparser.pys   <module>
   s   
BOÿ (‡				