@@ -123,10 +123,10 @@ def title(self):
123123 def short_title (self ):
124124 return shorten_title (self ._html (True ))
125125
126- def summary (self , document_only = False ):
126+ def summary (self , html_partial = False ):
127127 """Generate the summary of the html docuemnt
128128
129- :param document_only : return only the div of the document, don't wrap
129+ :param html_partial : return only the div of the document, don't wrap
130130 in html and body tags.
131131
132132 """
@@ -147,7 +147,7 @@ def summary(self, document_only=False):
147147
148148 if best_candidate :
149149 article = self .get_article (candidates , best_candidate ,
150- document_only = document_only )
150+ html_partial = html_partial )
151151 else :
152152 if ruthless :
153153 log .debug ("ruthless removal did not work. " )
@@ -180,15 +180,15 @@ def summary(self, document_only=False):
180180 log .exception ('error getting summary: ' )
181181 raise Unparseable (str (e )), None , sys .exc_info ()[2 ]
182182
183- def get_article (self , candidates , best_candidate , document_only = False ):
183+ def get_article (self , candidates , best_candidate , html_partial = False ):
184184 # Now that we have the top candidate, look through its siblings for
185185 # content that might also be related.
186186 # Things like preambles, content split by ads that we removed, etc.
187187 sibling_score_threshold = max ([
188188 10 ,
189189 best_candidate ['content_score' ] * 0.2 ])
190190 # create a new html document with a html->body->div
191- if document_only :
191+ if html_partial :
192192 output = fragment_fromstring ('<div/>' )
193193 else :
194194 output = document_fromstring ('<div/>' )
@@ -219,7 +219,7 @@ def get_article(self, candidates, best_candidate, document_only=False):
219219 if append :
220220 # We don't want to append directly to output, but the div
221221 # in html->body->div
222- if document_only :
222+ if html_partial :
223223 output .append (sibling )
224224 else :
225225 output .getchildren ()[0 ].getchildren ()[0 ].append (sibling )
0 commit comments