Repository navigation
logs/ is made on Linux and macOS; a CRLF .kbb or .dict loads there (4.2.52) - #815
Merged
Merged
Conversation
….2.52)
dir_exists() and make_dir() in lite/mach.cpp are no-ops off Windows, so
NLP::init never made <analyzer>/logs there. make_ana.log, cgerr.log and
file.log all failed to open without a word, and an analyzer that did not
build left no diagnostics at all on the platform that serves clients.
init now makes logs/ with std::filesystem, as the compile branch already
does for run/ (NLP-ENGINE-527). dir_exists()/make_dir() are left alone.
readKBB, readDict and findDictConcept read lines with a bare getline().
A .kbb or .dict checked out on Windows has CRLF line ends, and read on
Linux or macOS every line kept its '\r': the concepts loaded as
"verbs\r" and findconcept("verbs") came back null, with no error. They
now drop a trailing '\r', as readFullLine() already did for the lazy
*full files. (Windows reads these in text mode and was not affected;
.kb command files already handled '\r'.)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
logs/ on Linux and macOS
dir_exists()andmake_dir()inlite/mach.cppare no-ops off Windows, soNLP::initnever made<analyzer>/logsthere.make_ana.log,cgerr.logandfile.logall failed to open without a word, and an analyzer that did not build left no diagnostics at all on Linux.initnow makeslogs/withstd::filesystem, as the compile branch already does forrun/(NLP-ENGINE-527).dir_exists()/make_dir()are left alone, because the macOS parse-en-us test depends on them.CRLF .kbb / .dict
readKBB,readDictandfindDictConceptread lines with a baregetline(). A.kbbor.dictchecked out on Windows has CRLF line ends. Read on Linux or macOS, every line kept its\r: the concepts loaded as"verbs\r", andfindconcept("verbs")came back null with no error. They now drop a trailing\r, asreadFullLine()already did for the lazy*fullfiles.Windows reads these files in text mode and was not affected.
.kbcommand files already handled\r.Testing
Built the NLPPlus wheel against this change on Windows and on Linux (WSL, Ubuntu 24.04). The py-package test suite passed: 28/28 on Windows; on Linux 26 passed and 2 Windows-only tests were skipped. That includes new tests for
logs/make_ana.logand a CRLF.kbb. Both of those fail on Linux with 4.2.51.The companion py-package PR raises
AnalyzerErrorwith themake_ana.logdiagnostics, which this change makes available on Linux.🤖 Generated with Claude Code