{"id":216,"date":"2011-05-11T19:53:10","date_gmt":"2011-05-11T19:53:10","guid":{"rendered":"http:\/\/www.sitekickr.com\/blog\/?p=216"},"modified":"2011-05-11T19:53:10","modified_gmt":"2011-05-11T19:53:10","slug":"summarizing-large-amounts-of-text","status":"publish","type":"post","link":"https:\/\/www.sitekickr.com\/blog\/summarizing-large-amounts-of-text\/","title":{"rendered":"Summarizing large amounts of text"},"content":{"rendered":"<p>There are a few tricks that can be used to summarize a body of text into a paragraph. One of the simplest methods is to simply grab the first <em>n<\/em> characters from the text and use it as the summary.<\/p>\n<p>This method works well, but in its simplest form, shown below, you will likely end up with word fragments at the end of the summary.<\/p>\n<p>Using ColdFusion as an example:<\/p>\n<p><code>&lt;cfoutput&gt;&lt;p&gt;#Left(text, 200)#&lt;\/p&gt;&lt;\/cfoutput&gt;<br \/>\n\t<\/code><\/p>\n<p>\n\tMost languages either allow you to treat a string as a list with a specified delimitter, or to tokenize the string using a delimitter. In this case, the space (&quot; &quot;) will be our delimitter.<\/p>\n<p>Again using ColdFusion as an example:<\/p>\n<p><code>&lt;cfset summary_length = 200&gt;<br \/>\n\t&lt;p&gt;<br \/>\n\t&nbsp; &lt;cfif len(text) lt summary_length&gt;<br \/>\n\t&nbsp;&nbsp;&nbsp; #text#<br \/>\n\t&nbsp; &lt;cfelse&gt;<br \/>\n\t&nbsp;&nbsp;&nbsp; #ListDeleteAt(Left(text, summary_length), ListLen(Left(text, summary_length), &quot; &quot;), &quot; &quot;)#<br \/>\n\t&nbsp;&nbsp;&nbsp; &amp;hellip; &lt;!--- a nice touch to let the viewer know there is more to the story ---&gt;<br \/>\n\t&nbsp; &lt;\/cfif&gt;<br \/>\n\t&lt;\/p&gt;<br \/>\n\t<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>There are a few tricks that can be used to summarize a body of text into a paragraph. One of the simplest methods is to&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"amp_status":""},"categories":[15,34],"tags":[],"_links":{"self":[{"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/posts\/216"}],"collection":[{"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/comments?post=216"}],"version-history":[{"count":1,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/posts\/216\/revisions"}],"predecessor-version":[{"id":217,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/posts\/216\/revisions\/217"}],"wp:attachment":[{"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/media?parent=216"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/categories?post=216"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/tags?post=216"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}