[ https://issues.apache.org/jira/browse/LUCENE-9235?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17040510#comment-17040510 ]
Robert Muir commented on LUCENE-9235: ------------------------------------- Attached is a patch. It depends on my upgrade of {{jpbarrette/moman}} which I have not yet sent him a pull request for. He is maintaining it on github now. All the moman tests pass with my upgrade ([https://github.com/rmuir/moman/commit/09e997de01992e9b57ea7f33293f27632ec87ba8]) Also with rmuir-moman, existing python2 code still works from "python2" and generates exactly the same .java files. However, with upgraded {{createLevAutomaton.py}} it seems to generate some states in a different order (but equivalent DFA, as all lucene tests pass!!!) its just annoying to me that that it changes stuff. For example, see how states 3 and 4 get swapped: {noformat} --- a/lucene/core/src/java/org/apache/lucene/util/automaton/Lev1ParametricDescription.java +++ b/lucene/core/src/java/org/apache/lucene/util/automaton/Lev1ParametricDescription.java @@ -88,26 +88,26 @@ class Lev1ParametricDescription extends ParametricDescription { // 4 vectors; 5 states per vector; array length = 20 private final static long[] toStates2 = new long[] /*3 bits per value */ { - 0x69a292450428003L + 0x4da292442420003L }; private final static long[] offsetIncrs2 = new long[] /*2 bits per value */ { - 0x5555588000L + 0x5555528000L }; // 8 vectors; 5 states per vector; array length = 40 private final static long[] toStates3 = new long[] /*3 bits per value */ { - 0x1690a82152018003L,0xb1a2d346448a49L + 0x14d0812112018003L,0xb1a29b46d48a49L }; private final static long[] offsetIncrs3 = new long[] /*2 bits per value */ { - 0x555555b8220f0000L,0x5555L + 0x555555e80a0f0000L,0x5555L }; // state map // 0 -> [(0, 0)] // 1 -> [(0, 1)] // 2 -> [(0, 1), (1, 1)] - // 3 -> [(0, 1), (2, 1)] - // 4 -> [(0, 1), (1, 1), (2, 1)] + // 3 -> [(0, 1), (1, 1), (2, 1)] + // 4 -> [(0, 1), (2, 1)] {noformat} > upgrade all python to python3 > ----------------------------- > > Key: LUCENE-9235 > URL: https://issues.apache.org/jira/browse/LUCENE-9235 > Project: Lucene - Core > Issue Type: Improvement > Reporter: Robert Muir > Priority: Major > Attachments: LUCENE-9235.patch > > > Lets just kill the python2 and simplify the build. Since its only being used > for regenerating sources, ideally its easy to validate. -- This message was sent by Atlassian Jira (v8.3.4#803005) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org