As we all know, English is the most important language in today’s world. Having a good knowledge of English and a strong vocabulary can be highly advantageous for an individual, expediting their growth in this extremely competitive world.
Strengthening vocabulary is a long-term process. You cannot expect to develop a good vocabulary overnight. It requires reading extensively and actively trying to remember the words encountered. Building a substantial vocabulary may take years. While frequently encountered words are easier to remember, there are also many infrequently used words, such as “Floccinaucinihilipilification” or “Epicaricacy”, which can be challenging to retain.
One solution to this problem is to create a word list and review it regularly, at least every few days, if not everyday. This approach has proven beneficial for me. Personally, I have developed a computer program to manage this word list. The word list is saved as a text file, which needs to be created manually using a text editor. Additionally, new words should be added from the text editor, as the program is not designed to handle that task. However, it can perform other functions such as counting the number of words in the list, writing the list to another file, removing duplicates if present, and sorting the words in alphabetical order. It’s written in C++.
#include <bits/stdc++.h>
using namespace std;
/// ifstream reads the file if the file exists
/// ofstream writes to the file and if the file doesn't exist, creates it
void countWords() {
// copy the path of your file and paste it here
ifstream words("path_of_the_file");
string s;
vector<int> cnt(26);
if(words.is_open()) {
while(getline(words, s)) {
if(!s.empty()) {
cnt[s[0] - 'a']++;
}
}
words.close();
}
for(int i = 0; i < 26; i++) {
cout << char('a' + i) << " = " << cnt[i] << "\n";
}
cout << "\nTotal words = " << accumulate(cnt.begin(), cnt.end(), 0) << "\n";
}
void writeWordsToAnotherFile() {
ifstream words("path_of_first_file_from_which_words_will_be_written");
ofstream allWords("path_of_second_file_to_which_words_will_be_written");
string s;
string pr;
if(words.is_open() && allWords.is_open()) {
while(getline(words, s)) {
if(!s.empty()) {
if(!pr.empty() && pr[0] != s[0]) {
allWords << "\n";
}
allWords << s << "\n";
pr = s;
}
}
// for some whitepsace at the bottom
for(int i = 0; i < 10; i++) {
allWords << "\n";
}
words.close();
allWords.close();
}
}
void removeDuplicateAndSort() {
ifstream readWords("path_of_the_file");
string s;
map<string, string> mp;
if(readWords.is_open()) {
while(getline(readWords, s)) {
if(!s.empty()) {
int idx = s.find(' ');
string t = s.substr(0, idx);
string u = s.substr(idx);
if(mp.count(t) == 0) {
mp[t] = u;
}
}
}
readWords.close();
}
string pr = "";
ofstream writeWords("path_of_the_file");
if(writeWords.is_open()) {
for(auto& [u, v]: mp) {
s = u + v;
if(!pr.empty() && pr[0] != s[0]) {
// for empty space between words that start with different letters
for(int i = 0; i < 10; i++) {
writeWords << "\n";
}
}
writeWords << s << "\n";
pr = s;
}
// for some whitespace at the bottom
for(int i = 0; i < 40; i++) {
writeWords << "\n";
}
writeWords.close();
}
}
int main() {
countWords();
removeDuplicateAndSort();
writeWordsToAnotherFile();
}
You should save the words as shown in the image for the program to work properly. The word itself comes first, then any number of space you like (at least one), and then type of the word (noun, verb etc.)
Please note that merely learning new words will not make you proficient in English. You must understand the context in which you can use those words. Additionally, you should be familiar with the syntax and semantics of the language as well. To achieve this, you need to read extensively. However, having a good vocabulary is always a plus point. Therefore, I thought I should share this with you. If at least one person benefits from it, I’ll be happy.
This post is dedicated to Mr. Shashi Tharoor, one of my idols and a highly revered personality who has inspired me to learn new words and enhance my vocabulary. I have learned numerous words from him.