<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Wordcount splitting words on apostrophes]]></title><description><![CDATA[<p dir="auto">Hello!</p>
<p dir="auto">My Notepad++ has been giving me weird results for wordcount for a while now. I finally figured out today that the issue is apostrophes–the word counter seems to think that apostrophes are whitespace. I have a document with only the word <strong>it’s</strong> in it, and the program says there are two words instead of one.</p>
<p dir="auto">Is there any setting I can change to fix this, or should I file an issue in GitHub? I’m not sure if it’s just doing this because I messed up a setting somewhere or what. I just updated to the latest version in case that was the problem, but I am still seeing this.</p>
<p dir="auto">Thanks!</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/21232/wordcount-splitting-words-on-apostrophes</link><generator>RSS for Node</generator><lastBuildDate>Wed, 22 Jul 2026 01:53:10 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/21232.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 28 May 2021 03:35:21 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Wordcount splitting words on apostrophes on Tue, 27 Sep 2022 21:54:31 GMT]]></title><description><![CDATA[<p dir="auto">Hello, <a class="plugin-mentions-user plugin-mentions-a" href="/user/ken-h" aria-label="Profile: ken-h">@<bdi>ken-h</bdi></a>, <a class="plugin-mentions-user plugin-mentions-a" href="/user/stewart-baker" aria-label="Profile: stewart-baker">@<bdi>stewart-baker</bdi></a>, <a class="plugin-mentions-user plugin-mentions-a" href="/user/alan-kilborn" aria-label="Profile: alan-kilborn">@<bdi>alan-kilborn</bdi></a> and <strong>All</strong>,</p>
<p dir="auto">Refer also to my post <a href="https://community.notepad-plus-plus.org/post/80137">here</a></p>
<p dir="auto">Best Regards,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/80138</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/80138</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Tue, 27 Sep 2022 21:54:31 GMT</pubDate></item><item><title><![CDATA[Reply to Wordcount splitting words on apostrophes on Tue, 27 Sep 2022 20:38:09 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ken-h" aria-label="Profile: Ken-H">@<bdi>Ken-H</bdi></a> said in <a href="/post/80134">Wordcount splitting words on apostrophes</a>:</p>
<blockquote>
<p dir="auto">found that when the curly apostrophe is used in “JOHN’S CAR”, then Edit &gt; Convert Case to &gt; Proper Case, the result will be “John’S Car”</p>
</blockquote>
<p dir="auto">Sounds like a bug to me.<br />
Feel free to report it; info on doing that is <a href="https://community.notepad-plus-plus.org/topic/15741/faq-desk-feature-request-or-bug-report/1">HERE</a>.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/80136</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/80136</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Tue, 27 Sep 2022 20:38:09 GMT</pubDate></item><item><title><![CDATA[Reply to Wordcount splitting words on apostrophes on Tue, 27 Sep 2022 20:25:59 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/alan-kilborn" aria-label="Profile: Alan-Kilborn">@<bdi>Alan-Kilborn</bdi></a> For analogous reasons, I just found that when the curly apostrophe is used in “JOHN’S CAR”, then Edit &gt; Convert Case to &gt; Proper Case, the result will be “John’S Car”, which I can understand and deal with, but I was initially surprised that the possessive s was still upper case.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/80134</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/80134</guid><dc:creator><![CDATA[Ken H]]></dc:creator><pubDate>Tue, 27 Sep 2022 20:25:59 GMT</pubDate></item><item><title><![CDATA[Reply to Wordcount splitting words on apostrophes on Sun, 30 May 2021 06:16:04 GMT]]></title><description><![CDATA[<p dir="auto">Thanks for all the comments!</p>
<blockquote>
<p dir="auto">Perhaps the conclusion to be drawn is that Notepad++ is not a great counter of words. :-)</p>
</blockquote>
<p dir="auto">This does, alas, seem to be the conclusion… :)   I will live!</p>
<p dir="auto">(ETA: I didn’t realize it had turned my non-smart apostrophes into the special ones in the forum post. In the text files, I just use standard apostrophes. Oh well!)</p>
]]></description><link>https://community.notepad-plus-plus.org/post/66484</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/66484</guid><dc:creator><![CDATA[Stewart Baker]]></dc:creator><pubDate>Sun, 30 May 2021 06:16:04 GMT</pubDate></item><item><title><![CDATA[Reply to Wordcount splitting words on apostrophes on Fri, 28 May 2021 20:28:17 GMT]]></title><description><![CDATA[<p dir="auto">Just for reference the “word count” <a href="https://github.com/notepad-plus-plus/notepad-plus-plus/blob/5758b99b3edd4db7ba8a01ca08cfd5e1cc6af3e2/PowerEditor/src/Notepad_plus.cpp#L3693" rel="nofollow ugc">function</a> (found via <em>View</em> menu &gt; <em>Summary…</em> and then looking at <code>Words:</code> in the output) in Notepad++ uses this regular expression to determine what is a word:</p>
<p dir="auto">[^\x20\t\\.,;:!?()+\r\n\-\*/=\]\[{}&amp;~"'`|@$%&lt;&gt;\^]+</p>
<p dir="auto">Note that because this is a regex of the form <code>[^...]</code> that this list of characters is saying what is NOT a word character rather than what IS a word character.</p>
<p dir="auto">So we basically have these characters which will terminate counting some bit of text as a “word”:</p>
<p dir="auto">\x20\t\\.,;:!?()+\r\n\-\*/=\]\[{}&amp;~"'`|@$%&lt;&gt;\^</p>
<p dir="auto">I took some liberties with the <code>\x20</code> and the <code>\t</code> by changing them from literal space and tab character (so that they are more easily seen).</p>
<p dir="auto">Anyway, I see an apostrophe in there, so that’s what is causing <code>it's</code> to be counted as two words.</p>
<p dir="auto">But, how does this handle UTF-8 characters?<br />
If we copy the “it’s” from the OP (the bolded “it’s”) and paste it into a Notepad++ tab and then run the “word count” function, we see that it shows <code>Words: 1</code>.  Success?  Yes, but really No. :-(<br />
This is a UTF-8 special apostrophe, and it isn’t accounted for in Notepad++'s expression for what is not a word character.</p>
<p dir="auto">Perhaps the conclusion to be drawn is that Notepad++ is not a great counter of words. :-)</p>
]]></description><link>https://community.notepad-plus-plus.org/post/66431</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/66431</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Fri, 28 May 2021 20:28:17 GMT</pubDate></item><item><title><![CDATA[Reply to Wordcount splitting words on apostrophes on Wed, 28 Sep 2022 12:24:38 GMT]]></title><description><![CDATA[<p dir="auto">Hello, <a class="plugin-mentions-user plugin-mentions-a" href="/user/stewart-baker" aria-label="Profile: stewart-baker">@<bdi>stewart-baker</bdi></a>, <a class="plugin-mentions-user plugin-mentions-a" href="/user/alan-kilborn" aria-label="Profile: alan-kilborn">@<bdi>alan-kilborn</bdi></a> and *<em>All</em>,</p>
<p dir="auto">Here is an <strong>alternative</strong> to the <a class="plugin-mentions-user plugin-mentions-a" href="/user/alan-kilborn" aria-label="Profile: alan-kilborn">@<bdi>alan-kilborn</bdi></a>’s solution :</p>
<p dir="auto">Open the <strong><code>Find</code></strong> dialog ( <strong><code>Ctrl + F</code></strong> )</p>
<ul>
<li>
<p dir="auto">SEARCH <strong><code>[\w'’]+</code></strong></p>
</li>
<li>
<p dir="auto">Tick the <strong><code>Wrap around</code></strong> option</p>
</li>
<li>
<p dir="auto"><strong>Un</strong>-tick all the <strong>squared</strong> box options</p>
</li>
<li>
<p dir="auto">Select the <strong><code>Regular expression</code></strong> serch <strong>mode</strong></p>
</li>
<li>
<p dir="auto">Click on the <strong><code>Count</code></strong> button or use the <strong>default</strong> <strong><code>Alt + T</code></strong> shortcut</p>
</li>
</ul>
<hr />
<p dir="auto">The regex <strong><code>[\w'’]</code></strong> <strong>forces</strong> the regex engine to consider the <strong>two</strong> Unicode characters <em>APOSTROPHE</em> <strong><code>'</code></strong> ( <strong><code>\x{0027}</code></strong> ) and <em>RIGHT SINGLE QUOTATION MARK</em> <strong><code>’</code></strong> ( <strong><code>\x{2019}</code></strong> ) as <strong>word</strong> char, as well !</p>
<p dir="auto">In addition, you may feel <strong>interesting</strong> to have a look to this <strong>other</strong> post of mime, about the <strong><code>Summary</code></strong> feature, especially the <strong>first</strong> part :</p>
<p dir="auto"><a href="https://community.notepad-plus-plus.org/post/59069">https://community.notepad-plus-plus.org/post/59069</a></p>
<p dir="auto">Best Regards,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/66407</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/66407</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Wed, 28 Sep 2022 12:24:38 GMT</pubDate></item><item><title><![CDATA[Reply to Wordcount splitting words on apostrophes on Fri, 28 May 2021 11:23:18 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/stewart-baker" aria-label="Profile: Stewart-Baker">@<bdi>Stewart-Baker</bdi></a></p>
<p dir="auto">It does this because it doesn’t consider an apostrophe to be a “word character”.  You can certainly do a github issue if you’d like to.</p>
<p dir="auto">You might try this as an alternate method for obtaining word count:</p>
<p dir="auto">Pull up the <em>Find</em> window and do a regular expression search mode search for <code>\S+</code> by pressing the <code>Count</code> button.  Here’s a demo of it counting your <code>it's</code> as 1 word instead of 2:</p>
<p dir="auto"><img src="/assets/uploads/files/1622200905431-d997d2bf-25c0-4b43-ac32-7cdba1ae46c4-image.png" alt="d997d2bf-25c0-4b43-ac32-7cdba1ae46c4-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">BTW, <code>\S+</code> may not be appropriate in all instances.  What it means is: “Consider a match to be the longest string you can find between traditional whitespace characters”.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/66402</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/66402</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Fri, 28 May 2021 11:23:18 GMT</pubDate></item></channel></rss>