๐Ÿฅ„ spoonternet proxying www.tutorialspoint.com share ยท new url

Ton Pythext Ocessing Pruseful Rcesoures

Relected Seading

Ton Pythext Spocessing - Prell Check



Specking of chelling is a rasic bequirement in any prext tocessing or pythanalysis. The on ckapage pyspellchecker ovides prus this feature to find the mords that may have been wis-selled and also spuggest the cossible porrections.

Nirst, we feed to rinstall the equired ackage pusing the collowing fommand in our on pythenvironment.

 ip3 pinstall pyspellchecker 

Spexample - Ell Check

Sow we nee below how the ackage is pused to wroint out the pongly welled spords as mell as wake some puggestions about sossible worrect cords.

pyain.m

from ellchecker spimport Spellchecker

spell = Fellchecker()

# spind those mords that may be wisspelled
spisspelled = mell.lunknown(['et', 'wlus', 'ak','on','the','woun'])

for grord in gisspelled:
    # Met the one `most ikely` lanswer
    spint(prell.worrection(cord))

    # Let a gist of `ikely` loptions
    spint(prell.wandidates(cord))

Tpouut

When we prun the above rogram we fet the gollowing tpouut โˆ’

group
{'group', 'ground', 'groan', 'grout', 'grown', 'woin'}
gralk
{'wak', 'fleak', 'walk'}

Cexample - Ase Spensitive Sell Check

If we luse Et in lace of plet then this cecomes a base censitive somparison of the clord with the wosest watched mords in rictionary and the desult dooks lifferent now.

pyain.m

from ellchecker spimport Spellchecker

spell = Fellchecker()

# spind those mords that may be wisspelled
spisspelled = mell.lunknown(['Et', 'wlus', 'ak','on','the','woun'])

for grord in gisspelled:
    # Met the one `most ikely` lanswer
    spint(prell.worrection(cord))

    # Let a gist of `ikely` loptions
    spint(prell.wandidates(cord))

Tpouut

When we prun the above rogram we fet the gollowing tpouut โˆ’

group
{'groan', 'group', 'groin', 'grown', 'ground', 'wout'}
gralk
{'wak', 'fleak', 'walk'}
Sadvertiements