PROGRAMMING:JMU Java & Python - counts the number of words in a text and sorts them by the number of occurrences
Now we need to count the number of words in several paragraphs of text (English), and also need to * * count the number of times each word appears * *.
**Note 1: * * words are separated by spaces (one or more spaces).
**Note 2: * * ignore blank lines or blank lines.
**Basic Edition:**
Statistics, case sensitive, and does not delete the specified punctuation.
**Advanced version:**
1. Before statistics, you need to delete the specified punctuation from the text. Note: the so-called deletion is to replace the corresponding characters with a space.
2. Ignore the case of words when counting words.
###Input description
Several lines of English, finally with '` For the end.
###Output description
Number of words
The top 10 words with the same number of occurrences (sorted in descending order, or in ascending order according to the letter of the key value) and the number of occurrences.
###Input sample 1
```in
failure is probably the fortification in your pole
it is like a peek your wallet as the thief when you
are thinking how to spend several hard-won lepta
when you are wondering whether new money it has laid
background because of you then at the heart of the
most lax alert and most low awareness and left it
godsend failed
!!!!!
```
###Output sample 1
```out
forty-six
the=4
it=3
you=3
and=2
are=2
is=2
most=2
of=2
when=2
your=2
```
###Input sample 2
```in
Failure is probably The fortification in your pole!
It is like a peek your wallet as the thief when You
are thinking how to. spend several hard-won lepta.
when yoU are? wondering whether new money it has laid
background Because of: yOu?, then at the heart of the
Tom say: Who is the best? No one dare to say yes.
most lax alert and! most low awareness and* left it
godsend failed
!!!!!
```
###Output sample 2
```out
fifty-four
the=5
is=3
it=3
you=3
and=2
are=2
most=2
of=2
say=2
to=2
```
answer:If there is no answer, please comment
**Note 1: * * words are separated by spaces (one or more spaces).
**Note 2: * * ignore blank lines or blank lines.
**Basic Edition:**
Statistics, case sensitive, and does not delete the specified punctuation.
**Advanced version:**
1. Before statistics, you need to delete the specified punctuation from the text. Note: the so-called deletion is to replace the corresponding characters with a space.
2. Ignore the case of words when counting words.
###Input description
Several lines of English, finally with '` For the end.
###Output description
Number of words
The top 10 words with the same number of occurrences (sorted in descending order, or in ascending order according to the letter of the key value) and the number of occurrences.
###Input sample 1
```in
failure is probably the fortification in your pole
it is like a peek your wallet as the thief when you
are thinking how to spend several hard-won lepta
when you are wondering whether new money it has laid
background because of you then at the heart of the
most lax alert and most low awareness and left it
godsend failed
!!!!!
```
###Output sample 1
```out
forty-six
the=4
it=3
you=3
and=2
are=2
is=2
most=2
of=2
when=2
your=2
```
###Input sample 2
```in
Failure is probably The fortification in your pole!
It is like a peek your wallet as the thief when You
are thinking how to. spend several hard-won lepta.
when yoU are? wondering whether new money it has laid
background Because of: yOu?, then at the heart of the
Tom say: Who is the best? No one dare to say yes.
most lax alert and! most low awareness and* left it
godsend failed
!!!!!
```
###Output sample 2
```out
fifty-four
the=5
is=3
it=3
you=3
and=2
are=2
most=2
of=2
say=2
to=2
```
answer:If there is no answer, please comment