4848 from decomp .semantics .predpatt .typing import T , UDSchema
4949
5050# Optional imports for sentence parsing functionality
51+ # NOTE: UDParser integration is a planned future feature.
52+ # The decomp.semantics.predpatt.parsing.parser module does not exist yet.
53+ # When implemented, it will provide state-of-the-art UD parsing capabilities.
5154try :
52- from decomp .semantics .predpatt .util . UDParser import Parser
55+ from decomp .semantics .predpatt .parsing . parser import UDParser
5356 _UDPARSER_AVAILABLE = True
5457except ImportError :
55- Parser = None
58+ UDParser = None
5659 _UDPARSER_AVAILABLE = False
5760
5861
@@ -203,6 +206,11 @@ def from_constituency(
203206 ) -> PredPattEngine :
204207 """Create PredPattEngine from a constituency parse string.
205208
209+ .. warning::
210+ This method is not yet implemented. Automatic parsing is a planned
211+ future feature. Currently, you must use pre-parsed UD data with
212+ the standard constructor or load_conllu().
213+
206214 Converts constituency parse to Universal Dependencies automatically.
207215 [English only]
208216
@@ -219,12 +227,21 @@ def from_constituency(
219227 -------
220228 PredPattEngine
221229 Engine instance with extraction results from converted parse.
230+
231+ Raises
232+ ------
233+ NotImplementedError
234+ Always raised as this feature is not yet implemented.
222235 """
223236 if not _UDPARSER_AVAILABLE :
224- raise ImportError ("UDParser not available. Install required dependencies." )
237+ raise NotImplementedError (
238+ "Automatic UD parsing is not yet implemented. This is a planned future feature.\n "
239+ "Currently, you must provide pre-parsed Universal Dependencies data.\n "
240+ "To use PredPatt, load your data using load_conllu() with existing UD parses."
241+ )
225242 global _PARSER
226243 if _PARSER is None :
227- _PARSER = Parser .get_instance (cacheable )
244+ _PARSER = UDParser .get_instance (cacheable )
228245 parse = _PARSER .to_ud (parse_string )
229246 return cls (parse , opts = opts )
230247
@@ -237,6 +254,11 @@ def from_sentence(
237254 ) -> PredPattEngine :
238255 """Create PredPattEngine from a sentence string.
239256
257+ .. warning::
258+ This method is not yet implemented. Automatic parsing is a planned
259+ future feature. Currently, you must use pre-parsed UD data with
260+ the standard constructor or load_conllu().
261+
240262 Parses sentence and converts to Universal Dependencies automatically.
241263 [English only]
242264
@@ -253,12 +275,21 @@ def from_sentence(
253275 -------
254276 PredPattEngine
255277 Engine instance with extraction results from parsed sentence.
278+
279+ Raises
280+ ------
281+ NotImplementedError
282+ Always raised as this feature is not yet implemented.
256283 """
257284 if not _UDPARSER_AVAILABLE :
258- raise ImportError ("UDParser not available. Install required dependencies." )
285+ raise NotImplementedError (
286+ "Automatic UD parsing is not yet implemented. This is a planned future feature.\n "
287+ "Currently, you must provide pre-parsed Universal Dependencies data.\n "
288+ "To use PredPatt, load your data using load_conllu() with existing UD parses."
289+ )
259290 global _PARSER
260291 if _PARSER is None :
261- _PARSER = Parser .get_instance (cacheable )
292+ _PARSER = UDParser .get_instance (cacheable )
262293 parse = _PARSER (sentence )
263294 return cls (parse , opts = opts )
264295
0 commit comments