Python library for Sequence Matching/Comparison

2010-08-07 Thread Sohail
Hi,

Is there any sequence matching library in (apart from difflib) to
compare sequences of natural text?

thanks
-- 
http://mail.python.org/mailman/listinfo/python-list


How to parse a sentence using grammars provided by nltk?

2010-08-12 Thread Sohail
Hi,

When I define my own production rules for the grammar the code below
runs fine. Can anyone tell me how to use the built in grammars of nltk
(if there are any)?

>>> groucho_grammar = nltk.parse_cfg("""
... S -> NP VP
... PP -> P NP
... NP -> Det N | Det N PP | 'I'
... VP -> V NP | VP PP
... Det -> 'an' | 'my'
... N -> 'elephant' | 'pajamas'
... V -> 'shot'
... P -> 'in'
... """)
>>> sent = ['I', 'shot', 'an', 'elephant', 'in', 'my', 'pajamas']
>>> parser = nltk.ChartParser(groucho_grammar)
>>> trees = parser.nbest_parse(sent)
>>> for tree in trees:
... print tree

thanks
-- 
http://mail.python.org/mailman/listinfo/python-list


Error

2016-03-13 Thread Abeer Sohail
I get this error every time I open Python.
-- 
https://mail.python.org/mailman/listinfo/python-list


Unable to use pip to install packages

2021-04-01 Thread Md Sohail Ansari via Python-list
Hi Team,
Thanks for your support. I am having trouble installing any packages using pip 
in Python 3.x (earlier had Python 3.8.3, so changed to 3.8.8) in Windows 10.
Please help me with below issues:
---C:\Users\mohsohai>pip install 
pytestTraceback (most recent call last):  File 
"C:\Users\mohsohai\AppData\Local\Programs\Python\Python38\Scripts\pip-script.py",
 line 11, in     load_entry_point('pip==21.0.1', 'console_scripts', 
'pip')()  File 
"c:\users\mohsohai\appdata\local\programs\python\python38\lib\site-packages\pip\_internal\cli\main.py",
 line 71, in main    command = create_command(cmd_name, isolated=("--isolated" 
in cmd_args))  File 
"c:\users\mohsohai\appdata\local\programs\python\python38\lib\site-packages\pip\_internal\commands\__init__.py",
 line 96, in create_command    module = importlib.import_module(module_path)  
File 
"c:\users\mohsohai\appdata\local\programs\python\python38\lib\importlib\__init__.py",
 line 127, in import_module    return _bootstrap._gcd_import(name[level:], 
package, level)  File "", line 1014, in 
_gcd_import  File "", line 991, in _find_and_load  
File "", line 975, in _find_and_load_unlocked  
File "", line 671, in _load_unlocked  File 
"", line 783, in exec_module  File 
"", line 219, in _call_with_frames_removed  File 
"c:\users\mohsohai\appdata\local\programs\python\python38\lib\site-packages\pip\_internal\commands\install.py",
 line 12, in     from pip._internal.cache import 
WheelCacheModuleNotFoundError: No module named 
'pip._internal.cache'-
Note: Have included pip in Enviromnet Variables
Thank you,Sohail.
-- 
https://mail.python.org/mailman/listinfo/python-list