cardmagic / classifier

A general classifier module to allow Bayesian and LSI classifications.
Other
661 stars 122 forks source link

Fix many outstanding issues as well as cleanup code #36

Closed cardmagic closed 3 months ago

cardmagic commented 3 months ago

Changes Overview

This set of changes represents a significant modernization effort for the Ruby Classifier library. The main modifications include:

  1. Updating the CI/CD pipeline from Travis CI to GitHub Actions.
  2. Upgrading supported Ruby versions.
  3. Refactoring and optimizing various parts of the codebase.
  4. Improving code style and adhering to modern Ruby conventions.
  5. Updating dependencies and gemspec.

Reason for Changes

These changes are being made to:

  1. Modernize the project's infrastructure and tooling.
  2. Improve performance and maintainability of the codebase.
  3. Ensure compatibility with newer Ruby versions.
  4. Enhance code readability and adhere to current Ruby best practices.

Detailed Description

  1. CI/CD Update: Replaced .travis.yml with .github/workflows/ruby.yml to use GitHub Actions instead of Travis CI. This provides better integration with GitHub and more flexible CI/CD capabilities.

  2. Ruby Version Support: Updated the supported Ruby versions to include 2.7, 3.1, 3.2, and 3.3, dropping support for older versions. This ensures the library works with modern Ruby environments.

  3. Code Refactoring:

    • Optimized various algorithms, particularly in the Bayes and LSI classes.
    • Replaced deprecated mathn and cmath dependencies with matrix.
    • Improved memory efficiency in several operations.
  4. Code Style Improvements:

    • Updated syntax to use newer Ruby features (e.g., using &. safe navigation operator).
    • Improved naming conventions and variable clarity.
    • Enhanced readability with better formatting and more idiomatic Ruby code.
  5. Dependency Updates:

    • Updated gemspec to reflect new version and dependencies.
    • Added explicit fast-stemmer and matrix dependencies in the Gemfile.