- Introduced `getNounTypes`, `getVerbTypes`, `getNounTypeMap`, and `getVerbTypeMap` utilities for managing noun and verb types at runtime.
- Added comprehensive unit tests (`type-utils.test.ts`) to ensure correctness of type utility functions.
- Created new example files (`type-utils-example.js`, `type-utils-example.ts`) to demonstrate the use of type utilities in JavaScript and TypeScript environments.
- Updated `README.md` with detailed documentation and usage examples for the new type utilities.
- Enhanced `index.ts` to export the new utility functions, making them accessible throughout the library.
**Purpose**: Facilitate easy access, validation, and manipulation of noun and verb types in client applications, providing better runtime type management.
- Introduced `writeOnly` mode in `BrainyData` allowing optimized data ingestion by skipping index loading and disabling search operations.
- Enhanced `BrainyDataConfig` to include `writeOnly` support and validate compatibility with `readOnly` mode.
- Implemented error handling for search attempts during `writeOnly` mode.
- Updated the README with detailed usage examples for database modes, including `writeOnly` and `readOnly`.
- Added `examples/write-only-mode.js` to demonstrate practical applications of the `writeOnly` mode.
**Purpose**: Optimize memory usage and startup time for data ingestion scenarios by enabling write-only mode with comprehensive documentation and examples.
- **Examples**: Added a new `flush-statistics-example.js` script to demonstrate the usage of the `flushStatistics` method for ensuring updated statistics after data insertion.
- **Core**:
- Implemented `flushStatistics` in the `BrainyData` class to allow immediate flushing of statistics to storage.
- Updated `BaseStorageAdapter` with `flushStatisticsToStorage` to support flushing cached statistics.
- Modified the `shutDown` method to ensure statistics are flushed before database shutdown.
- **Documentation**: Added `statistics-flush-solution.md` to explain the batch update mechanism, the issue with delayed statistics updates, and how to manually flush statistics in storage.
**Purpose**: Provide users with the ability to manually flush statistics for real-time accuracy, particularly useful for systems relying on immediate updates. Improved documentation and examples to guide developers in implementing and using this functionality effectively.
- Removed extraneous semicolons across `cli-wrapper-example.js` for cleaner, consistent code style.
- Adjusted indentation and spacing for improved readability.
- Updated console statements to be consistent, ensuring uniform logging behavior across the example.
This change aligns the example file with the project's coding standards, improving code clarity and maintainability.
- Removed obsolete scripts: `test-all-environments.js`, `test-fallback-function.js`, `test-fallback-simple.js`, `test-fix.js`, `test-tensorflow-textencoder.js`, `test-unified-encoding.js`, and `test-worker-utils.js`.
- Introduced `scripts/comprehensive-test.js` as a unified testing script covering all environments: Browser, Node.js, and CLI.
- Added `examples/cli-wrapper-example.js` to demonstrate a proper CLI implementation with TensorFlow.js initialization.
This refactor simplifies the testing structure by consolidating redundant scripts into a single comprehensive script while ensuring robust cross-environment coverage.