iit-cs429/main

a2: carification

Closed this issue · 5 comments

in main.py what does *FIND # mean?

def parse_query_strings(strings):                                                   
    r"""                                                                         
    Parse lines from TIME.QUE.                                                      

    Params:                                                                         
      strings...A list of strings, one per line, from TIME.QUE                   
    Returns:                                                                        
      A dict from query id to query text string.                                 
    >>> string = '''*FIND      1                                                    
    ...                                                                          
    ... KENNEDY ADMINISTRATION PRESSURE ON NGO DINH DIEM TO STOP                    
    ...                                                                             
    ... SUPPRESSING THE BUDDHISTS .                                              
    ...                                                                             
    ... *FIND      2                                                             
    ...                                                                             
    ... EFFORTS OF AMBASSADOR HENRY CABOT LODGE TO GET VIET NAM'S                
    ...                                                                          
    ... PRESIDENT DIEM TO CHANGE HIS POLICIES OF POLITICAL REPRESSION .          
    ...                                                                             
    ... *STOP'''                                                                    
    >>> res = parse_query_strings(string.split('\n'))                               
    >>> print('%s' % res[1])                                                        
    KENNEDY ADMINISTRATION PRESSURE ON NGO DINH DIEM TO STOP SUPPRESSING THE BUDDHISTS . 
    >>> print('%s' % res[2])                                                        
    EFFORTS OF AMBASSADOR HENRY CABOT LODGE TO GET VIET NAM'S PRESIDENT DIEM TO CHANGE HIS POLICIES OF POLITICAL REPRESSION . 
    """                                                                             
    ###TODO                                                                         
    pass                                              

That is part of the doctest. I've just cut and pasted a two sample queries from the TIME.QUE file to test that they are being parsed correctly. *FIND is simply a unique marker for the start of a new query.

Closing this issue. Please reopen if it is not clear.

Is the space necessary at the end of the doctest? It's failing because of that for me. It's no problem to add it but just want to clarify

selection_112

Same for me too. The final answer remains same but because of spaces, doctest for Main.py is failing.

No, no need to have spaces.

On Sun, Feb 28, 2016 at 3:18 PM, Simon notifications@github.com wrote:

Is the space necessary at the end of the doctest? It's failing because of
that for me. It's no problem to add it but just want to clarify

[image: selection_112]
https://cloud.githubusercontent.com/assets/3166193/13381948/7f94b7e0-de2e-11e5-98c4-04858dbda5e5.png


Reply to this email directly or view it on GitHub
#125 (comment).