< 返回版块

长琴 发表于 2024-01-21 22:22

Tags:rust,日报,pcodec,postagger,ballast,ecosystem-simulation

[new lib] pcodec

使用分位数的数值数据的无损压缩和解压缩工具。用法示例:

use pco::standalone::{auto_compress, auto_decompress};
use pco::DEFAULT_COMPRESSION_LEVEL;

fn main() {
  // your data
  let mut my_ints = Vec::new();
  for i in 0..100000 {
    my_ints.push(i as i64);
  }

  // Here we let the library choose a configuration with default compression
  // level. If you know about the data you're compressing, you can compress
  // faster by creating a `CompressorConfig`.
  let compressed: Vec<u8> = auto_compress(&my_ints, DEFAULT_COMPRESSION_LEVEL);
  println!("compressed down to {} bytes", compressed.len());

  // decompress
  let recovered = auto_decompress::<i64>(&compressed).expect("failed to decompress");
  println!("got back {} ints from {} to {}", recovered.len(), recovered[0], recovered.last().unwrap());
}

GitHub: https://github.com/mwlon/pcodec

[new lib] postagger

词性标注工具。使用示例:

use postagger::PerceptronTagger;

fn main() {
    let tagger = PerceptronTagger::new( "tagger/weights.json" , "tagger/classes.txt" , "tagger/tags.json" )  ; 
    let tags = tagger.tag( "the quick brown fox jumps over the lazy dog" ) ;
    for tag in &tags {
        println!( "{} {} {}" , tag.word , tag.tag , tag.conf ) ; 
    }
}

GitHub: https://github.com/shubham0204/postagger.rs

[new lib] ballast

一个简单的 API 负载测试工具,可用于比较 API 的性能。

298307846-498c9ada-4d55-4074-8f82-d6c32c6f558b

GitHub: https://github.com/synoet/ballast

[new lib] rust-ecosystem-simulation

一个简单的生态系统模拟器。

视频: https://www.youtube.com/watch?v=lCUovKa68jQ

GitHub: https://github.com/bones-ai/rust-ecosystem-simulation


From 日报小组 长琴

社区学习交流平台订阅:

评论区

写评论
liming01 2024-01-22 10:57

直接改为IP访问:

20.248.137.48 github.com 20.175.192.147 github.com

gorust21 2024-01-22 10:05

github还能上吗

1 共 2 条评论, 1 页