Skip to content

ARFF Extractor - #498

Open
andrewdalpino wants to merge 13 commits into
3.1from
arff-and-row-filter
Open

andrewdalpino wants to merge 13 commits into
3.1from
arff-and-row-filter

Conversation

@andrewdalpino

@andrewdalpino andrewdalpino commented Sep 14, 2026

Copy link
Copy Markdown
Member

Extracts ARFF files. Streaming and strict types. A nice addition. Not an Exporter though. Not that it can't be.

@andrewdalpino
andrewdalpino requested review from a team and a lite review from Copilot September 14, 2026 18:39

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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(), and str_getcsv() all ignore double-quoted ARFF names and values. A declaration such as @attribute "class label" string is 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.

Comment thread src/Extractors/ARFF.php Outdated
Comment thread src/Extractors/ARFF.php
Comment thread src/Extractors/ARFF.php Outdated
Comment thread src/Extractors/ARFF.php
Comment thread src/Extractors/ARFF.php
Comment thread src/Extractors/ARFF.php
Comment thread docs/extractors/arff.md Outdated
andrewdalpino and others added 9 commits September 14, 2026 14:05
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants