economic_indicator_finder

Crates.ioeconomic_indicator_finder
lib.rseconomic_indicator_finder
version0.1.1
sourcesrc
created_at2023-10-30 16:34:20.084952
updated_at2023-10-31 17:08:31.638512
description A finder for extracting economic indicators from paragraphs
homepage
repositoryhttps://github.com/seongs1024/economic_indicator_finder
max_upload_size
id1018760
size114,387
Seongsu Park (seongs1024)

documentation

https://docs.rs/economic_indicator_finder

README

🔎economic indicator finder

A finder for extracting economic indicators from paragraphs

Usage

use economic_indicator_finder::prelude::*;
use anyhow::Result;
use std::fs::read_to_string;

fn main() -> Result<()> {
    let speechs = Speech::from_json_file("speech/speech.json")?;
    let finder = Finder::new(Indicator::from_json_file("asset/indicators.json")?)?;

    for speech in speechs {
        let speaker = &speech.speaker;
        let speech = read_to_string(speech.file)?;
        let matches: Vec<_> = finder.matches(speech);
        println!("From the speech of {}: {:#?}", speaker, matches);
    }
    Ok(())
}

Indicators

References

Commit count: 14

cargo fmt