@@ -123,10 +123,10 @@ def title(self):
123
123
def short_title (self ):
124
124
return shorten_title (self ._html (True ))
125
125
126
- def summary (self , document_only = False ):
126
+ def summary (self , html_partial = False ):
127
127
"""Generate the summary of the html docuemnt
128
128
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
130
130
in html and body tags.
131
131
132
132
"""
@@ -147,7 +147,7 @@ def summary(self, document_only=False):
147
147
148
148
if best_candidate :
149
149
article = self .get_article (candidates , best_candidate ,
150
- document_only = document_only )
150
+ html_partial = html_partial )
151
151
else :
152
152
if ruthless :
153
153
log .debug ("ruthless removal did not work. " )
@@ -180,15 +180,15 @@ def summary(self, document_only=False):
180
180
log .exception ('error getting summary: ' )
181
181
raise Unparseable (str (e )), None , sys .exc_info ()[2 ]
182
182
183
- def get_article (self , candidates , best_candidate , document_only = False ):
183
+ def get_article (self , candidates , best_candidate , html_partial = False ):
184
184
# Now that we have the top candidate, look through its siblings for
185
185
# content that might also be related.
186
186
# Things like preambles, content split by ads that we removed, etc.
187
187
sibling_score_threshold = max ([
188
188
10 ,
189
189
best_candidate ['content_score' ] * 0.2 ])
190
190
# create a new html document with a html->body->div
191
- if document_only :
191
+ if html_partial :
192
192
output = fragment_fromstring ('<div/>' )
193
193
else :
194
194
output = document_fromstring ('<div/>' )
@@ -219,7 +219,7 @@ def get_article(self, candidates, best_candidate, document_only=False):
219
219
if append :
220
220
# We don't want to append directly to output, but the div
221
221
# in html->body->div
222
- if document_only :
222
+ if html_partial :
223
223
output .append (sibling )
224
224
else :
225
225
output .getchildren ()[0 ].getchildren ()[0 ].append (sibling )
0 commit comments