Releases: fukuball/jieba-php
Releases · fukuball/jieba-php
jieba-php v0.42 - Enhanced TF-IDF and Memory Management
🚀 jieba-php v0.42 - Major Feature Release
This release introduces significant enhancements to jieba-php with new memory management capabilities, integrated TF-IDF scoring, and improved multi-language support.
✨ New Features
🧠 JiebaMemory Class - Unified Memory Management
- NEW:
JiebaMemoryclass for centralized memory management across all jieba-php classes - Memory Statistics: Comprehensive memory usage monitoring with
getMemoryStats()andgetAllCacheStats() - Batch Operations:
initAll(),destroyAll(), andclearAllCaches()for efficient resource management - Status Monitoring:
getInitializationStatus()andisAllInitialized()for system health checks
📊 Enhanced TF-IDF and POS Integration
- NEW:
Jieba::cut()now supportswith_posandwith_scoresoptions - NEW:
Posseg::cut()now supportswith_scoresoption for TF-IDF integration - Modular API: New
JiebaAnalyse::calculateTF()andcalculateTFIDF()methods - Backward Compatibility: All existing APIs remain unchanged
- Auto-initialization: JiebaAnalyse automatically initializes when scoring features are used
🌍 Improved Multi-language CJK Support
- Enhanced: Better handling of mixed Chinese/Japanese/Korean text
- Complex Scenarios: Improved processing of mixed-language documents
- Performance: Optimized CJK character recognition and segmentation
🛠️ Demo Scripts & Examples
- NEW:
demo_tf_idf_pos.php- TF-IDF and POS tagging integration examples - NEW:
demo_mixed_cjk.php- Multi-language CJK text processing examples
🧪 Enhanced Testing
- NEW:
TfIdfPosTest.php- Comprehensive TF-IDF integration testing - NEW:
MixedCJKTest.php- Multi-language text processing validation - Coverage: 70+ tests with 300+ assertions
- Backward Compatibility: Full validation of existing API compatibility
📚 Documentation Updates
- Comprehensive: Updated README.md and CLAUDE.md with all new features
- Best Practices: Memory management guidelines and performance optimization tips
- API Examples: Detailed usage examples for all new features
- Multi-language: Complete documentation in both Chinese and English
🔧 Technical Improvements
- Security: Enhanced input validation and injection prevention
- Performance: Optimized memory usage and cache management
- Reliability: Improved error handling and graceful degradation
- Compatibility: Maintained backward compatibility with all existing code
📦 Installation & Usage
composer require fukuball/jieba-php:^0.42use Fukuball\Jieba\JiebaMemory;
// Quick start with unified memory management
JiebaMemory::initAll();
// Enhanced segmentation with POS and TF-IDF
$result = Jieba::cut($text, false, array(
'with_pos' => true,
'with_scores' => true
));
// Memory monitoring
$stats = JiebaMemory::getMemoryStats();
echo "Memory usage: " . $stats['current_memory_usage_formatted'];🙏 Acknowledgments
Special thanks to all contributors and the community for their feedback and suggestions that made this release possible.
Full Changelog: 0.34...0.42
jieba-php 0.34
jieba-php 0.34 Supports PHP 8
jieba-php 0.33
jieba-php 0.33 翻譯自 jieba python 0.33 版
jieba-php 0.32
jieba-php 0.32 翻譯自 jieba python 0.32 版
jieba-php 0.31
jieba-php 0.31 翻譯自 jieba python 0.31 版
jieba-php 0.29
jieba-php 0.29 翻譯自 jieba python 0.29 版
jieba-php 0.28
jieba-php 0.28 翻譯自 jieba python 0.28 版
jieba-php 0.27
jieba-php 0.27 翻譯自 jieba python 0.27 版
jieba-php 0.26
可以使用英文詞典
jieba-php 0.25
jieba-php 0.25 翻譯自 jieba python 0.25 版,功能完全一致,後續將在繼續翻譯新版本往上升級。