This site is supported by donations to The OEIS Foundation.

Template:Count words/doc

From OeisWiki
Jump to: navigation, search

This documentation subpage contains instructions, categories, or other information for Template:Count words. [<Edit> Template:Count words]

[⧼Purge⧽ Template:Count words/doc]

The {{count words}} string function template returns the number of words in a (possibly multiline) string.

Word dividers:

  • M-dash "—" (one or more than one, no difference) (whether or not surrounded with spaces, though the typographical convention is no spaces surrounding M-dash);
  • N-dash " – " (when surrounded with spaces, as an alternative to M-dash);
  • Slash "/" (alternative between two words, e.g. and/or are two words) (unfortunately, fractions and dates are broken apart, e.g. 3/4 and 2028/23/05 respectively give two words and 3 words);
  • 1 up to 32 consecutive spaces (with possibly at least one space, then one or two consecutive <newline>s, then at least one space) and/or tabs and/or M-dashes are collapsed into a single space.

Not word dividers:

  • Apostrophe (dumb ') (smart ’) (which means that possessives, e.g. William’s, and contracted words, e.g. won’t, count as one word);
  • Hyphen "-" (possibly followed by <newline>, for justified words);
  • N-dash "–" (when not surrounded with spaces to indicate spans or differentiation, e.g. the span 45–48 is one word in pp. 45–48, and the names of the two distinct persons Erdős–Straus is one word in Erdős–Straus conjecture);
  • <newline> (when <newline> doesn't follow a hyphen for a justified word, you need to put a space after the last word preceding <newline>, otherwise words are not divided).

Affecting the word count:

  • Ditto mark (dumb " ) (english ) (french » ) (counts as one implied word, though it must be surrounded by spaces).

Not affecting the word count:

  • Punctuation (, or ; or : or . or ¡ or ! or ¿ or ? or ...) after a word;
  • Footnote indicator symbols (asterisk *) (dagger ) (double dagger ) or superscript numerals (e.g. <sup>1</sup>, <sup>2</sup>, ...) after a word;
  • Bracket punctuation (parentheses (...)) (square [...]) (braces {...}) (angle ⟨...⟩) (...);
  • Quotation marks (dumb '...' or "...") (english ‘...’ or “...”) (french ‹...› or «...»);
  • Any number of dots ., hyphens -, N-dashes ;
  • Wikitext for italic (''...''), bold ('''...''') and wikilinks ([[...]]).

Usage

{{count words|string}}

or

{{count words|string}}

or

{{count words|string|characters count}}

or

{{count words|string|characters count}}

where

  • with characters count as second argument we get the number of characters (including spaces, tabs and newlines) and the number of spaces;
  • with language = french the apostrophe is a word divisor (otherwise it is not a word divisor).

Notes:

  • The MediaWiki parser always ignore initial and final whitespace (spaces, tabs, newlines) in template arguments. (So {{count words|string}} is the same as {{count words| string }}.)
  • The MediaWiki parser has a limit of 10,000 characters for template arguments.

Examples

The code (with a space at the end of each line ending with non-hyphenated (non-justified) words to indicate that we don't have a continuation of the word on some next line [because <newline> characters can't be searched (and converted to a space)]) (Poem: “If—” By Rudyard Kipling.)

: {{count words|
If you can keep your head when all about you 
    Are losing theirs and blaming it on you, 
If you can trust yourself when all men doubt you, 
    But make allowance for their doubting too; 
If you can wait and not be... 
}}

yields (10 + 8 + 10 + 7 + 7 = 42 words), in agreement with https://wordcounter.net/

(42 word(s))

The code

: {{count words|
Three alkali metals{{dash|em}}sodium, potassium, and lithium{{dash|em}}are the usual substituents.
}}

yields (3 + 4 + 4 = 11 words), in agreement with https://wordcounter.net/

(11 word(s))

where Three alkali metals{{dash|em}}sodium, potassium, and lithium{{dash|em}}are the usual substituents. yields:

Three alkali metals—sodium, potassium, and lithium—are the usual substituents.

The code

: {{count words|
A flock of sparrows {{dash|en}} some of them juveniles {{dash|en}} alighted and sang.
}}

yields (4 + 4 + 3 = 11), in agreement with https://wordcounter.net/

(11 word(s))

where A flock of sparrows {{dash|en}} some of them juveniles {{dash|en}} alighted and sang. yields:

A flock of sparrows – some of them juveniles – alighted and sang.

The code

: {{count words|
{{"|He loved you|"}}{{dash|em}}at least she thought he had{{dash|em}}{{"|but you never cared.|"}}
}}

yields (3 + 6 + 4 = 13 words), although https://wordcounter.net/ gives 11 (without the quotes it gives 13; with spaces instead of M-dashes it gives 13; so it appears to get confused by the quotes butting against the M-dashes)

(13 word(s))

where {{"|He loved you|"}}{{dash|em}}at least she thought he had{{dash|em}}{{"|but you never cared.|"}} yields:

“He loved you”—at least she thought he had—“but you never cared.”

The code

: {{count words|
The [[Erdős{{dash|en}}Straus conjecture]] concerns a Diophantine equation, refered to as the Erdős{{dash|en}}Straus Diophantine equation, involving unit fractions. 
}}

yields (17 words, where Erdős–Straus counts as one word), in agreement with https://wordcounter.net/

(17 word(s))

where The [[Erdős{{dash|en}}Straus conjecture]] concerns a Diophantine equation, refered to as the Erdős{{dash|en}}Straus Diophantine equation, involving unit fractions. yields:

The Erdős–Straus conjecture concerns a Diophantine equation, refered to as the Erdős–Straus Diophantine equation, involving unit fractions.

The code (with a space after States)

: {{count words|
We, therefore, the represen-
tatives of the United States 
of America...
}}

yields (10 words, where represen-
tatives counts as one word), although https://wordcounter.net/ gives 11 (it counts represen- and tatives as two words, instead of a justified hyphenated word!)

(10 word(s))

The code

: {{count words|
The food (which was delicious) reminded me of home.
}}

yields (9 words), in agreement with https://wordcounter.net/

(9 word(s))

The code

: {{count words|
The French and Indian War (1754{{dash|en}}1763) was fought in western Pennsylvania and along the present US{{dash|en}}Canada border (Edwards, pp. 81{{dash|en}}101).
}}

yields (20 words, where 1754–1763 and US–Canada and 81–101 and pp. each count as one word), in agreement with https://wordcounter.net/

(20 word(s))

where The French and Indian War (1754{{dash|en}}1763) was fought in western Pennsylvania and along the present US{{dash|en}}Canada border (Edwards, pp. 81{{dash|en}}101). yields:

The French and Indian War (1754–1763) was fought in western Pennsylvania and along the present US–Canada border (Edwards, pp. 81–101).

The code (with a space after $2.10; note that ..... is preceded and followed by <tab>)

: {{count words|
Black pens, box of twenty	..... 	$2.10 
Blue  ”     ”   ”  ”     	..... 	$2.35 
}}

yields (12 words, where a ditto mark counts as one implied word, and ..... is not counted as a word), although https://wordcounter.net/ gives 14 (it counts ..... as one word)

(12 word(s))

The code

: {{count words|
Chapter 1: Getting Started . . . . . . . . . . . . . 1 
   Introduction  . . . . . . . . . . . . . . . . . . 2 
   Next Steps  . . . . . . . . . . . . . . . . . . . 3 
}}

yields (5 + 2 + 3 = 10 words), in agreement with https://wordcounter.net/

(10 word(s))

The code

: {{count words|
He will eat cake, pie, and/or brownies.
}}

yields (8 words), in agreement with https://wordcounter.net/

(8 word(s))

Examples with wikitext for ''italic'' and '''bold'''

Poem from http://examples.yourdictionary.com/examples-of-free-verse-poems.html

After the Sea-Ship by Walt Whitman

After the Sea-Ship—after the whistling winds;

After the white-gray sails, taut to their spars and ropes,

Below, a myriad, myriad waves, hastening, lifting up their necks,

Tending in ceaseless flow toward the track of the ship:

Waves of the ocean, bubbling and gurgling, blithely prying,

Waves, undulating waves—liquid, uneven, emulous waves,

Toward that whirling current, laughing and buoyant, with curves,

Where the great Vessel, sailing and tacking, displaced the surface;

The code (where each line must end with a space)

: {{count words|
''After the Sea-Ship'' '''by Walt Whitman''' 

After the Sea-Ship—after the whistling winds; 

After the white-gray sails, taut to their spars and ropes, 

Below, a myriad, myriad waves, hastening, lifting up their necks, 

Tending in ceaseless flow toward the track of the ship: 

Waves of the ocean, bubbling and gurgling, blithely prying, 

Waves, undulating waves—liquid, uneven, emulous waves, 

Toward that whirling current, laughing and buoyant, with curves, 

Where the great Vessel, sailing and tacking, displaced the surface;
| characters count 
}}

yields (520 + 16 [16 <newline>s] - ? = 535 characters and 78 words) (where https://wordcounter.net/ yields 520 characters and 78 words)

(535 character(s) [including 75 space(s)], 78 word(s))

The Axiom of Infinity (1904) By Bertrand Russell

Essay from https://users.drew.edu/jlenz/br-axiom-of-infinity.html (there are typos: they were in the text)


The Axiom of Infinity (1904)*

By Bertrand Russell

Professor Keyser’s very interesting article on “The Axiom of Infinity” contains a contention of capital importance for the theory of infinity. The view advocated by those who, like myself, believe all pure mathematics to be a mere prolongation of symbolic logic, is, that there are no new axioms at all in the later parts of mathematics, including among these both ordinary arithmetic and the arithmetic of infinite numbers. Professor Keyser maintains, on the contrary, that a special axiom is covertly invoked in all attempted demonstrations of the existence of the infinite. I believe that, in so thinking, he has been misled by the brevity, and perhaps obscurity, with which writers on this subject have usually stated their arguments. I am myself, as yet, obnoxious to the same charge; for the strict and detailed proof, with all the apparatus of logical rigour, is too long to be given incidentally, and was therefore reserved by me for vol. 2 of my Principles of Mathematics. It is possible, however, with a little care, so to set forth the outline of the proof as to make it appear that, whether “exquisite” or not, it is certainly not “round.”1

I presuppose, in setting forth this argument, the definition of number, and the proof that, with the suggested definition, every class has some perfectly well-defined number of terms. These matters I have discussed at length in Part 2 of the above-mentioned work; and so far as appears, Professor Keyser has no fault to find in regard to them.

The first step is to demonstrate that there is such a number as 0. The number of things fulfilling any condition which nothing fulfils is defined to be 0; and it may be shown that there are such conditions. For example, nothing is a proposition which is both true and false. Consequently, the number of things which are propositions that are both true and false is 0. Thus there is such a number as 0.

We next define the number 1 as follows. The number of terms in a class is 1 if there is a term in the class such that, when that term is taken away, the number of terms remaining is 0. That classes having one member exist is not hard to prove; for example, the class of things identical with the number 0 consists of the number 0 alone, and has only one member.

We proceed in like manner to the number 2, and we prove that the class consisting of the numbers 0 and 1 has two members, from which it follows that the number 2 exists.

It is in the next stage of the argument that, if I am not mistaken, Professor Keyser has been misled by an undue brevity. He appears to think that, at this point, the advocates of infinity are content with a vague “and so on” – a sort of etcetera which is intended to cover a multitude of sins. But etceteras, common as they are in ordinary mathematics, where they are represented by rows of little dots, are not tolerated by the stricter symbolic logicians. I shall try to show how it is that the argument proceeds without them.

We first prove the principle of mathematical induction2 – a principle which, in this domain, does work for us such as could hardly be expected but from an etcetera. This principle states that any property possessed by the number 0, and possessed by n+1 when it is possessed by n, is possessed by all finite numbers. By means of this principle, we prove that, if n be any finite number, the number of numbers from 0 to 12, both inclusive, is n+1. Consequently, if n exists, so does n+1. Hence, since 0 exists, it follows by mathematical induction that all finite numbers exist.

We prove also that, if m and n be two finite numbers other than 0, m+n is not identical with either m or n. It follows that, if n be any finite number, n is not the number of finite numbers, for the number of numbers from 0 to n is n+1, and n+1 is different from n. Thus no finite number is the number of finite numbers; and therefore, since the definition of cardinal numbers3 allows no doubt as to the existence of a number which is the number of finite numbers, it follows that this number is infinite. Hence, from the abstract principles of logic alone, the existence of infinite numbers is rigidly demonstrated.

The above is the strict proof appropriate to pure mathematics, since the entities with which it deals are exclusively those belonging to the domain of pure mathematics. Other proofs, such as the one from the fact that the idea of a thing is different from the thing, are not appropriate to pure mathematics, since they do, as Professor Keyser points out, assume premisses not mathematically demonstrable. But such proofs are not on that account circular or otherwise fallacious. Accepting the five postulates enumerated by Professor Keyser on p. 549 as assumed by Dedekind, I deny wholly that any one of the five presupposes the actual infinite. It is true that they together imply the actual infinite; it is indeed their purpose to do so. But it is too common, in philosophising, to confound implications with presuppositions. At this rate, all deduction would be circular. The contention advanced by Professor Keyser is essentially the following: If the conclusion (the existence of the infinite) were untrue, one of the premisses would be untrue; consequently the premisses beg the conclusion, and the argument is circular. But in all correct deductions, if the conclusion is false, so is at least one of the premisses. The falsehood of the premisses presupposes the falsehood of the conclusion; but it by no means follows that the truth of the premisses presupposes the truth of the conclusion. The root of the error seems to be that, where a deduction is very easily drawn, it comes to be viewed as actually part of the premisses; and thus very elementary arguments acquire the appearance, quite falsely, of petitiones principii.

Another point which calls for criticism is the psychological form of Professor Keyser’s statement of the axiom of infinity. He states this axiom (p. 551) as follows: “Conception and logical inference alike presuppose absolute certainty that an act which the mind finds itself capable of performing is intrinsically performable endlessly.” This statement is rendered vague by the word intrinsically; but I sincerely hope there is no such presupposition in inference, since it is a most certain empirical fact that the mind is not capable of endlessly repeating the same act. Even apart from the fact that man is mortal, he is doomed to intervals of sleep; when he is drunk, he cannot perform mental acts which he can perform when he is sober, and so on.

I am aware, of course, that such accidents are intended to be eliminated by the word intrinsically; but when they are, as they must be, explicitly and in terms eliminated, we get an axiom so complicated, and so plainly full of empirical elements, that it would require extraordinary boldness to present it as underlying all logic. The only escape would be to say that “the mind” is to be taken to mean God’s mind. But few will maintain nowadays that the existence of God is a necessary premiss for all logic.4

The truth is that, throughout logic and mathematics, the existence of the human or any other mind is totally irrelevant; mental processes are studied by means of logic, but the subject-matter of logic does not presuppose mental processes, and would be equally true if there were no mental processes. It is true that, in that case, we should not know logic; but our knowledge must not be confounded with the truths which we know, and in the case of logic, although our knowledge of course involves mental processes, that which we know does not involve them. Logic will never acquire its proper place among the sciences until it is recognised that a truth and the knowledge of it are as distinct as an apple and the eating of it.

B. Russell London


* Bertrand Russell, “The Axiom of Infinity,” Hibbert Journal 2, no. 4 (Jul 1904), 809-12 Reply to Keyser “Axiom of Infinity,” Hibbert Journal 2, no. 3 (Apr 1904), 532-52

1 See Hibbert Journal, loc. cit., pp. 549-550

2 I omit the proofs of propositions here assumed. Some of these proofs will be found in § 4 of my article in the Revue de Mathématiques, vol. 7; others in Mr A. N. Whitehead’s article in the American Journal of Mathematics, vol. 24

3 See my Principles of Mathematics, ch. 11

4 See my Philosophy of Leibniz (Cambridge, 1900), ch. 15, especially § 111


The code (scroll over the code to see the spaces and/or tabs) (initial and final spaces, tabs and newlines of template arguments are ignored by MediaWiki) (with a space at the end of each line ending with non-hyphenated (non-justified) words to indicate that we don't have a continuation of the word on some next line [because <newline> characters can't be searched (and converted to a space)])

: {{count words|
The Axiom of Infinity (1904)* 

By Bertrand Russell 

Professor Keyser’s very interesting article on “The Axiom of Infinity” contains a contention of capital importance for the theory of infinity. The view advocated by those who, like myself, believe all pure mathematics to be a mere prolongation of symbolic logic, is, that there are no new axioms at all in the later parts of mathematics, including among these both ordinary arithmetic and the arithmetic of infinite numbers. Professor Keyser maintains, on the contrary, that a special axiom is covertly invoked in all attempted demonstrations of the existence of the infinite. I believe that, in so thinking, he has been misled by the brevity, and perhaps obscurity, with which writers on this subject have usually stated their arguments. I am myself, as yet, obnoxious to the same charge; for the strict and detailed proof, with all the apparatus of logical rigour, is too long to be given incidentally, and was therefore reserved by me for vol. 2 of my Principles of Mathematics. It is possible, however, with a little care, so to set forth the outline of the proof as to make it appear that, whether “exquisite” or not, it is certainly not “round.”<sup>1</sup> 

I presuppose, in setting forth this argument, the definition of number, and the proof that, with the suggested definition, every class has some perfectly well-defined number of terms. These matters I have discussed at length in Part 2 of the above-mentioned work; and so far as appears, Professor Keyser has no fault to find in regard to them. 

The first step is to demonstrate that there is such a number as 0. The number of things fulfilling any condition which nothing fulfils is defined to be 0; and it may be shown that there are such conditions. For example, nothing is a proposition which is both true and false. Consequently, the number of things which are propositions that are both true and false is 0. Thus there is such a number as 0. 

We next define the number 1 as follows. The number of terms in a class is 1 if there is a term in the class such that, when that term is taken away, the number of terms remaining is 0. That classes having one member exist is not hard to prove; for example, the class of things identical with the number 0 consists of the number 0 alone, and has only one member. 

We proceed in like manner to the number 2, and we prove that the class consisting of the numbers 0 and 1 has two members, from which it follows that the number 2 exists. 

It is in the next stage of the argument that, if I am not mistaken, Professor Keyser has been misled by an undue brevity. He appears to think that, at this point, the advocates of infinity are content with a vague “and so on” – a sort of etcetera which is intended to cover a multitude of sins. But etceteras, common as they are in ordinary mathematics, where they are represented by rows of little dots, are not tolerated by the stricter symbolic logicians. I shall try to show how it is that the argument proceeds without them. 

We first prove the principle of mathematical induction<sup>2</sup> – a principle which, in this domain, does work for us such as could hardly be expected but from an etcetera. This principle states that any property possessed by the number 0, and possessed by n+1 when it is possessed by n, is possessed by all finite numbers. By means of this principle, we prove that, if n be any finite number, the number of numbers from 0 to 12, both inclusive, is n+1. Consequently, if n exists, so does n+1. Hence, since 0 exists, it follows by mathematical induction that all finite numbers exist. 

We prove also that, if m and n be two finite numbers other than 0, m+n is not identical with either m or n. It follows that, if n be any finite number, n is not the number of finite numbers, for the number of numbers from 0 to n is n+1, and n+1 is different from n. Thus no finite number is the number of finite numbers; and therefore, since the definition of cardinal numbers<sup>3</sup> allows no doubt as to the existence of a number which is the number of finite numbers, it follows that this number is infinite. Hence, from the abstract principles of logic alone, the existence of infinite numbers is rigidly demonstrated. 

The above is the strict proof appropriate to pure mathematics, since the entities with which it deals are exclusively those belonging to the domain of pure mathematics. Other proofs, such as the one from the fact that the idea of a thing is different from the thing, are not appropriate to pure mathematics, since they do, as Professor Keyser points out, assume premisses not mathematically demonstrable. But such proofs are not on that account circular or otherwise fallacious. Accepting the five postulates enumerated by Professor Keyser on p. 549 as assumed by Dedekind, I deny wholly that any one of the five presupposes the actual infinite. It is true that they together imply the actual infinite; it is indeed their purpose to do so. But it is too common, in philosophising, to confound implications with presuppositions. At this rate, all deduction would be circular. The contention advanced by Professor Keyser is essentially the following: If the conclusion (the existence of the infinite) were untrue, one of the premisses would be untrue; consequently the premisses beg the conclusion, and the argument is circular. But in all correct deductions, if the conclusion is false, so is at least one of the premisses. The falsehood of the premisses presupposes the falsehood of the conclusion; but it by no means follows that the truth of the premisses presupposes the truth of the conclusion. The root of the error seems to be that, where a deduction is very easily drawn, it comes to be viewed as actually part of the premisses; and thus very elementary arguments acquire the appearance, quite falsely, of petitiones principii. 

Another point which calls for criticism is the psychological form of Professor Keyser’s statement of the axiom of infinity. He states this axiom (p. 551) as follows: “Conception and logical inference alike presuppose absolute certainty that an act which the mind finds itself capable of performing is intrinsically performable endlessly.” This statement is rendered vague by the word intrinsically; but I sincerely hope there is no such presupposition in inference, since it is a most certain empirical fact that the mind is not capable of endlessly repeating the same act. Even apart from the fact that man is mortal, he is doomed to intervals of sleep; when he is drunk, he cannot perform mental acts which he can perform when he is sober, and so on. 

I am aware, of course, that such accidents are intended to be eliminated by the word intrinsically; but when they are, as they must be, explicitly and in terms eliminated, we get an axiom so complicated, and so plainly full of empirical elements, that it would require extraordinary boldness to present it as underlying all logic. The only escape would be to say that “the mind” is to be taken to mean God’s mind. But few will maintain nowadays that the existence of God is a necessary premiss for all logic.<sup>4</sup> 

The truth is that, throughout logic and mathematics, the existence of the human or any other mind is totally irrelevant; mental processes are studied by means of logic, but the subject-matter of logic does not presuppose mental processes, and would be equally true if there were no mental processes. It is true that, in that case, we should not know logic; but our knowledge must not be confounded with the truths which we know, and in the case of logic, although our knowledge of course involves mental processes, that which we know does not involve them. Logic will never acquire its proper place among the sciences until it is recognised that a truth and the knowledge of it are as distinct as an apple and the eating of it. 

B. Russell 
London 


* Bertrand Russell, “The Axiom of Infinity,” Hibbert Journal 2, no. 4 (Jul 1904), 809-12 Reply to Keyser “Axiom of Infinity,” Hibbert Journal 2, no. 3 (Apr 1904), 532-52 

1 See Hibbert Journal, loc. cit., pp. 549-550 

2 I omit the proofs of propositions here assumed. Some of these proofs will be found in § 4 of my article in the Revue de Mathématiques, vol. 7; others in Mr A. N. Whitehead’s article in the American Journal of Mathematics, vol. 24 

3 See my Principles of Mathematics, ch. 11 

4 See my Philosophy of Leibniz (Cambridge, 1900), ch. 15, especially § 111 
| characters count 
| more = yes
}}

yields (8458 + 40 (newlines) = 8498 characters: ? visible characters, ? spaces; ? words) (where the characters count is below the MediaWiki limit of 10000 characters for template arguments)

(8498 character(s) [including 1478 space(s)], 1477 word(s)) and (6 hyphen(s), 2 N-dash(es), 0 M-dash(es), 0 dumb apostrophe(s)/single quote(s), 4 smart apostrophe(s)/single opening quote(s), 4 slash(es))

whereas

  • http://wordcounter360.com/ counts 8458 characters (the 40 newlines are not counted) [including 8458 - 6980 = 1478 spaces] and 1488 words [. and / are word divisors; apostrophe not a word divisor] (Not good: when surrounded by spaces, it counts N-dashes as words!):
  • 2 N-dashes (add 2 words), 4 slashes (add 4 words), periods in “round.” and endlessly.” and logic.<sup> add 3 words;
  • http://www.charactercountonline.com/ counts 8458 characters (the 40 newlines are not counted) [including 1478 spaces] and 1479 words [apostrophe not a word divisor];
  • https://wordcounter.net/ counts 8458 (the 40 newlines are not counted) characters and 1479 words [/ are word divisors; apostrophe not a word divisor]:
  • 4 slashes (add 4 words).

The Axiom of Infinity (1904) By Bertrand Russell: Tests

The code (scroll over the code to see the spaces and/or tabs) (initial and final spaces, tabs and newlines of template arguments are ignored by MediaWiki)

: {{count words|
The Axiom of Infinity (1904)* 

By Bertrand Russell 
|characters count
}}

yields (51 characters: 42 visible characters, 7 spaces, 2 newlines; 8 words) (each of https://wordcounter.net/ and http://www.charactercountonline.com/ http://wordcounter360.com/ yield 49 characters [the two newlines are not counted] and 8 words) Green tickY

(51 character(s) [including 7 space(s)], 8 word(s))

Examples in french

The code (with a space at the end of each line ending with non-hyphenated (non-justified) words to indicate that we don't have a continuation of the word on some next line [because <newline> characters can't be searched (and converted to a space)])

: {{count words|
Traditionnellement, la théorie des nombres est une branche des mathématiques qui s'occupe des propriétés des nombres entiers (qu'ils soient entiers naturels ou entiers relatifs), et contient beaucoup de problèmes ouverts faciles à comprendre, même pour les non-mathématiciens. Plus généralement, le champ d'étude de cette théorie concerne une large classe de problèmes qui proviennent naturellement de l'étude des entiers. La théorie des nombres occupe une place particulière en mathématiques, à la fois par ses connexions avec de nombreux autres domaines, et par la fascination qu'exercent ses énoncés. Ainsi, la citation suivante, de Jürgen Neukirch : 

    « La théorie des nombres occupe parmi les disciplines mathématiques une position idéalisée analogue à celle qu'occupent les mathématiques elles-mêmes parmi les autres sciences. »<sup>1</sup> 

Le terme « arithmétique » est aussi utilisé pour faire référence à la théorie des nombres. C'est un terme assez ancien, qui n'est plus aussi populaire que par le passé ; pour éviter des confusions, on désignait aussi parfois, jusqu'au début du vingtième siècle, la théorie des nombres par le terme « arithmétique supérieure ». Néanmoins, l'adjectif arithmétique reste assez répandu, en particulier pour désigner des champs mathématiques (géométrie algébrique arithmétique, arithmétique des courbes et surfaces elliptiques, etc.). Ce sens du terme arithmétique ne doit pas être confondu avec celui utilisé en logique pour l'étude des systèmes formels axiomatisant les entiers, comme il en est dans l'arithmétique de Peano. 

La théorie des nombres peut être divisée en plusieurs champs d'étude en fonction des méthodes utilisées et des questions traitées.
| characters count
| language = french
}}

yields (1707 characters: 1701 + 6 newlines) (where http://www.combiendemots.com/ yields 1701 characters [1701 - 1450 = 251 spaces] and 258 words [it considers the hyphen as a word divisor: non-mathématiciens and elles-mêmes both count as two words, but it shouln’t]) Green tickY

(1707 character(s) [including 251 space(s)], 253 word(s))

Examples in french: tests

The code (with a space at the end of each line ending with non-hyphenated (non-justified) words to indicate that we don't have a continuation of the word on some next line [because <newline> characters can't be searched (and converted to a space)])

: {{count words|
    « La théorie des nombres occupe parmi les disciplines mathématiques une position idéalisée analogue à celle qu'occupent les mathématiques elles-mêmes parmi les autres sciences. »<sup>1</sup>
| characters count
| language = french
}}

yields (24 words) (where http://www.combiendemots.com/ yields 190 characters [190 - 166 = 24 spaces] and 28 words [it considers the hyphen a word divisor: elles-mêmes is taken as two words, but it shouldn’t]) Green tickY

(190 character(s) [including 24 space(s)], 24 word(s))

Examples in spanish

The code (with a space at the end of each line ending with non-hyphenated (non-justified) words to indicate that we don't have a continuation of the word on some next line [because <newline> characters can't be searched (and converted to a space)])

: {{count words|
La filosofía inicial del formalismo, tal como es ejemplificada por David Hilbert, es una respuesta a las paradojas de la teoría axiomática de conjuntos, que se basa en la lógica formal. Prácticamente todos los teoremas matemáticos hoy en día se pueden formular como teoremas de la teoría de conjuntos. La verdad de un enunciado matemático, en esta teoría está representada por el hecho de que una declaración se puede derivar de los axiomas de la teoría de conjuntos utilizando las reglas de la lógica formal. 

    El uso del formalismo por sí solo no explica varias cuestiones: ¿Por qué debemos utilizar estos axiomas y no otros, por qué debemos emplear unas reglas lógicas y no otras, por qué proposiciones matemáticas "verdaderas" (p. ej. las leyes de la aritmética) parecen ser verdad? y así sucesivamente. Hermann Weyl hará estas mismas preguntas a Hilbert: 

    "What "truth" or objectivity can be ascribed to this theoretic construction of the world, which presses far beyond the given, is a profound philosophical problem. It is closely connected with the further question: what impels us to take as a basis precisely the particular axiom system developed by Hilbert? Consistency is indeed a necessary but not a sufficient condition. For the time being we probably cannot answer this question...."3
| characters count
}}

yields (1308 characters: 1304 + 4 newlines; . is not a word divisor, e.g. U.S.A. and 3.14 are both one word) (where http://es.wordcounter360.com/ yields 1304 characters [including 1304 - 1087 = 217 spaces] and 211 words [because it considers . a word divisor, "3 is taken as a word]) Green tickY

(1308 character(s) [including 217 space(s)], 210 word(s))

Tests

The code

: {{#replace: {{#replace: {{#replace: {{#replace: {{#replace:
  {{#replace: aaa                                bbb | |{{nbsp}}}}
|{{nbsp}}{{nbsp}}|{{nbsp}}}} |{{nbsp}}{{nbsp}}|{{nbsp}}}} |{{nbsp}}{{nbsp}}|{{nbsp}}}} |{{nbsp}}{{nbsp}}|{{nbsp}}}} |{{nbsp}}{{nbsp}}|{{nbsp}}}}
: aaa{{nbsp}}bbb

yields (32 spaces collapsed to one single space)

aaa bbb
aaa bbb

The code

: {{#replace: {{#replace: {{#replace: {{#replace: {{#replace:
  {{#replace: aaa                                 bbb | |{{nbsp}}}}
|{{nbsp}}{{nbsp}}|{{nbsp}}}} |{{nbsp}}{{nbsp}}|{{nbsp}}}} |{{nbsp}}{{nbsp}}|{{nbsp}}}} |{{nbsp}}{{nbsp}}|{{nbsp}}}} |{{nbsp}}{{nbsp}}|{{nbsp}}}}
: aaa{{nbsp}}bbb

yields (33 spaces are NOT collapsed to one single space, but two spaces)

aaa  bbb
aaa bbb

Template tests: limit of 32 consecutive spaces and/or tabs and/or M-dashes

The code (scroll over the code to see the spaces) (initial and final spaces and newlines of template arguments are ignored by MediaWiki)

: {{count words|
aaa                                bbb
| characters count
}}

yields (38 characters: 6 visible characters, 32 spaces, 0 newline; 2 words [32 spaces collapsed to one single space]) Green tickY

(38 character(s) [including 32 space(s)], 2 word(s))


The code (scroll over the code to see the spaces) (initial and final spaces and newlines of template arguments are ignored by MediaWiki)

: {{count words|
aaa                                 bbb
| characters count
}}

yields (39 characters: 6 visible characters, 33 spaces, 0 newline; 3 words [33 spaces are NOT collapsed to one single space, but two spaces, in which case the empty string between the two spaces is counted as a word]) Red crossY

(39 character(s) [including 33 space(s)], 3 word(s))

Template tests

The code (scroll over the code to see the spaces and/or tabs) (initial and final spaces, tabs and newlines of template arguments are ignored by MediaWiki)

: {{count words|
a
b
| characters count
}}

yields (3 characters: 2 visible characters, 0 space, 1 newline; 1 word [because there is no space after a and newlines unfortunately cannot be made to be word divisors]) Green tickY

(3 character(s) [including 0 space(s)], 1 word(s))


The code (scroll over the code to see the spaces and/or tabs) (initial and final spaces, tabs and newlines of template arguments are ignored by MediaWiki)

: {{count words|
v
e
r
t
i
c
a
l
 
w
o
r
d
s
| characters count
}}

yields (27 characters: 13 visible characters, 1 space, 13 newlines; 2 words) Green tickY

(27 character(s) [including 1 space(s)], 2 word(s))


The code (scroll over the code to see the spaces and/or tabs) (initial and final spaces, tabs and newlines of template arguments are ignored by MediaWiki)

: {{count words|
a 
b
| characters count
}}

yields (4 characters: 2 visible characters, 1 space, 1 newline; 2 words [because there is a space after a]) Green tickY

(4 character(s) [including 1 space(s)], 2 word(s))


The code (scroll over the code to see the spaces and/or tabs) (initial and final spaces, tabs and newlines of template arguments are ignored by MediaWiki)

: {{count words|
	all	boats	
count
| characters count
}}

yields (16 characters: 13 visible characters, 2 tabs, 0 space, 1 newline; 1 word [because unfortunately tabs or newlines cannot be made to be word divisors: <tabs> and <newline> characters can't be searched (and converted to a space)] Red crossY

(16 character(s) [including 0 space(s)], 1 word(s))


The code (scroll over the code to see the spaces and/or tabs) (initial and final spaces, tabs and newlines of template arguments are ignored by MediaWiki)

: {{count words|
a 

b
| characters count
}}

yields (5 characters: 2 visible characters, 1 space, 2 newlines; 2 words) Green tickY

(5 character(s) [including 1 space(s)], 2 word(s))


The code (scroll over the code to see the spaces and/or tabs) (initial and final spaces, tabs and newlines of template arguments are ignored by MediaWiki)

: {{count words|
a 


b
| characters count
}}

yields (6 characters: 2 visible characters, 1 space, 3 newlines; 2 words) Green tickY

(6 character(s) [including 1 space(s)], 2 word(s))


The code (scroll over the code to see the spaces and/or tabs) (initial and final spaces, tabs and newlines of template arguments are ignored by MediaWiki)

: {{count words|
To be or not to be. 
That is the question. 
| characters count
}}

yields (42 characters: 32 visible characters, 9 spaces, 1 newline; 10 words) Green tickY

(42 character(s) [including 9 space(s)], 10 word(s))


The code (scroll over the code to see the spaces and/or tabs) (initial and final spaces, tabs and newlines of template arguments are ignored by MediaWiki)

: {{count words|

To be or not to be. 
That is the question. 

| characters count
}}

yields (42 characters: 32 visible characters, 9 spaces, 1 newline; 10 words) Green tickY

(42 character(s) [including 9 space(s)], 10 word(s))


The code (scroll over the code to see the spaces and/or tabs) (initial and final spaces, tabs and newlines of template arguments are ignored by MediaWiki)

: {{count words|


To be or not to be. 
That is the question. 


| characters count
}}

yields (42 characters: 32 visible characters, 9 spaces, 1 newline; 10 words) Green tickY

(42 character(s) [including 9 space(s)], 10 word(s))

See also