This repository has been archived by the owner on Dec 16, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Move domain_languages.common to semparse.common * Move exception classes from domain_langauge.py to semparse/common/errors.py * Undo over-specific semparse.common.error import changes * Fix formatting issues * Copy over common docs to .semparse.common.rst * Fix (at least part of) the docs * Fixing docs again * Moving tests to the right place
- Loading branch information
1 parent
5e3c4cd
commit 92ee421
Showing
20 changed files
with
67 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from allennlp.semparse.common.date import Date |
2 changes: 1 addition & 1 deletion
2
.../semparse/domain_languages/common/date.py → allennlp/semparse/common/date.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
class ParsingError(Exception): | ||
""" | ||
This exception gets raised when there is a parsing error during logical form processing. This | ||
might happen because you're not handling the full set of possible logical forms, for instance, | ||
and having this error provides a consistent way to catch those errors and log how frequently | ||
this occurs. | ||
""" | ||
def __init__(self, message): | ||
super().__init__() | ||
self.message = message | ||
|
||
def __str__(self): | ||
return repr(self.message) | ||
|
||
|
||
class ExecutionError(Exception): | ||
""" | ||
This exception gets raised when you're trying to execute a logical form that your executor does | ||
not understand. This may be because your logical form contains a function with an invalid name | ||
or a set of arguments whose types do not match those that the function expects. | ||
""" | ||
def __init__(self, message): | ||
super().__init__() | ||
self.message = message | ||
|
||
def __str__(self): | ||
return repr(self.message) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
from allennlp.semparse.domain_languages.domain_language import (DomainLanguage, ParsingError, | ||
ExecutionError, START_SYMBOL, | ||
from allennlp.semparse.domain_languages.domain_language import (DomainLanguage, START_SYMBOL, | ||
predicate, predicate_with_side_args) | ||
from allennlp.semparse.common.errors import ParsingError, ExecutionError | ||
from allennlp.semparse.domain_languages.nlvr_language import NlvrLanguage | ||
from allennlp.semparse.domain_languages.quarel_language import QuaRelLanguage | ||
from allennlp.semparse.domain_languages.wikitables_language import WikiTablesLanguage |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
allennlp.semparse.common | ||
======================== | ||
|
||
.. automodule:: allennlp.semparse.common | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
.. automodule:: allennlp.semparse.common.date | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
.. automodule:: allennlp.semparse.common.errors | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters