[ https://issues.apache.org/jira/browse/PYLUCENE-12?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13155397#comment-13155397 ]
Michael McCandless commented on PYLUCENE-12: -------------------------------------------- Hmm, one more unfriendliness: if the createComponents method throws an exception (eg put xxx in there so you hit a NameError), you get back an exception like this: {noformat} ====================================================================== ERROR: testReusable (__main__.ReusableAnalyzerBaseTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "test/test_ReusableAnalyzerBase.py", line 37, in testReusable stream = method("test", reader) JavaError: java.lang.RuntimeException: NameError Java stacktrace: java.lang.RuntimeException: NameError at org.apache.pylucene.analysis.PythonReusableAnalyzerBase.createComponents(Native Method) at org.apache.lucene.analysis.ReusableAnalyzerBase.reusableTokenStream(ReusableAnalyzerBase.java:73) {noformat} Somehow this is missing details (exception cause & TB) of the python source that caused the exception.... can we fix this? If it's tricky I can open a new issue... > Add PythonReusableAnalyzerBase, so we can create analyzers in Python > -------------------------------------------------------------------- > > Key: PYLUCENE-12 > URL: https://issues.apache.org/jira/browse/PYLUCENE-12 > Project: PyLucene > Issue Type: Improvement > Reporter: Michael McCandless > Attachments: PYLUCENE-12.patch, PYLUCENE-12.patch > > > Lucene now has a useful helper class, ReusableAnalyzerBase; you subclass it > and override one method, to create an analyzer that provides > reusableTokenStream impl. > I think we should expose it in Python... patch is simple. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira