| | | | | linguist.page@gmail.com

3. Hardware vs Software

Hardware is the physical computer. Software is the set of instructions that tells the hardware what to do. An NLP program is software that instructs the hardware to read, process, and analyze text.

Read an Arabic file

with open("quran.txt", encoding="utf-8") as f:
    text = f.read()

print(text)

Let the CPU process the text

print(len(text))

Output

43

Count the words

print(len(text.split()))

Output

8