#economics #economic-indicator

economic_indicator_finder

A finder for extracting economic indicators from paragraphs

1 unstable release

0.1.1 Oct 31, 2023
0.1.0 Oct 30, 2023

#1729 in Text processing

MIT license

36KB
140 lines

🔎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

Dependencies

~2.9–5MB
~90K SLoC