Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nltk
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
nltk
Commits
7e1741d3
Commit
7e1741d3
authored
Jul 27, 2014
by
Steven Bird
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
expose type_check parameter of the logic parser
parent
201cc599
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
nltk/sem/logic.py
+6
-2
No files found.
nltk/sem/logic.py
View file @
7e1741d3
...
@@ -865,10 +865,14 @@ class Expression(SubstituteBindingsI):
...
@@ -865,10 +865,14 @@ class Expression(SubstituteBindingsI):
"""This is the base abstract object for all logical expressions"""
"""This is the base abstract object for all logical expressions"""
_logic_parser
=
_LogicParser
()
_logic_parser
=
_LogicParser
()
_type_checking_logic_parser
=
_LogicParser
((
type_check
=
True
)
@classmethod
@classmethod
def
fromstring
(
cls
,
s
):
def
fromstring
(
cls
,
s
,
type_check
=
False
):
return
cls
.
_logic_parser
.
parse
(
s
)
if
type_check
:
return
cls
.
_type_checking_logic_parser
.
parse
(
s
)
else
:
return
cls
.
_logic_parser
.
parse
(
s
)
def
__call__
(
self
,
other
,
*
additional
):
def
__call__
(
self
,
other
,
*
additional
):
accum
=
self
.
applyto
(
other
)
accum
=
self
.
applyto
(
other
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment