ARFF Extractor - #498
Open
andrewdalpino wants to merge 13 commits into
Open
ARFF Extractor#498andrewdalpino wants to merge 13 commits into
andrewdalpino wants to merge 13 commits into
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved moderate ARFF parsing and type-handling issues remain, along with documentation corrections.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Adds a streaming ARFF extractor with typed values, missing-value handling, tests, and documentation.
Changes:
- Implements ARFF parsing for numeric, integer, string, nominal, and date attributes.
- Adds fixtures and PHPUnit coverage.
- Adds documentation, navigation, and contributor guidance.
File summaries
| File | Changes and final findings |
|---|---|
tests/test.arff |
ARFF test fixture. No review findings. |
tests/Extractors/ARFFTest.php |
Extractor test coverage. No review findings. |
src/Extractors/ARFF.php |
Seven moderate findings: comment handling before balance (3 votes, L170); backslash-escaped quotes (2 votes, L397); unterminated buffers at EOF (3 votes, L265); strict integer validation (3 votes, L231); preserving quoted missing markers (2 votes, L195); honoring or rejecting date formats (2 votes, L329); and double-quoted names/values (1 vote, L352). |
mkdocs.yml |
Adds documentation navigation. No review findings. |
docs/extractors/arff.md |
Two nit findings: clarify the placeholder type/description (1 vote, L8) and document the string|int union (3 votes, L17). |
AGENTS.md |
Updates repository guidance. No review findings. |
Review details
Suppressed comments (2)
docs/extractors/arff.md:8
- The note says missing integer/date/categorical values use a placeholder string, but the constructor accepts an integer placeholder and returns it unchanged. For example,
new ARFF($path, 0)produces an integer here, so describe this as the categorical placeholder rather than a string.
Missing values, denoted by a question mark (`?`), are imported as `NAN` for numeric and real attributes and as the categorical placeholder string for integer, date, and categorical attributes. The placeholder defaults to `?`. Integer attributes are imported as PHP integers.
src/Extractors/ARFF.php:353
- Only single quotes are recognized:
token(),balanced(),stripComment(), andstr_getcsv()all ignore double-quoted ARFF names and values. A declaration such as@attribute "class label" stringis tokenized incorrectly, so support both ARFF quote styles or explicitly reject the unsupported form.
if (isset($string[0]) and $string[0] === "'") {
$token = '';
- Files reviewed: 6/6 changed files
- Comments generated: 7
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.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.
Extracts ARFF files. Streaming and strict types. A nice addition. Not an Exporter though. Not that it can't be.