Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/third_party/rust/mapped_hyph/src/   (Firefox Browser Version 136.0.1©)  Datei vom 10.2.2025 mit Größe 2 kB image not shown  

Quelle  main.rs

  Sprache: Rust
 

// Copyright 2019 Mozilla Foundation. See the COPYRIGHT
// file at the top-level directory of this distribution.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// https://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

extern crate mapped_hyph;

use mapped_hyph::Hyphenator;

fn main() {
    let dic_path = "hyph_en_US.hyf";

    let dic = match unsafe { mapped_hyph::load_file(dic_path) } {
        Some(dic) => dic,
        _ => panic!("failed to load dictionary {}", dic_path),
    };
    let hyph = Hyphenator::new(&*dic);

    println!("{}", hyph.hyphenate_word("haha"'-'));
    println!("{}", hyph.hyphenate_word("hahaha"'-'));
    println!("{}", hyph.hyphenate_word("photo"'-'));
    println!("{}", hyph.hyphenate_word("photograph"'-'));
    println!("{}", hyph.hyphenate_word("photographer"'-'));
    println!("{}", hyph.hyphenate_word("photographic"'-'));
    println!("{}", hyph.hyphenate_word("photographical"'-'));
    println!("{}", hyph.hyphenate_word("photographically"'-'));
    println!("{}", hyph.hyphenate_word("supercalifragilisticexpialidocious"'-'));
    println!("{}", hyph.hyphenate_word("o'dwyer"'='));
    println!("{}", hyph.hyphenate_word("o'callahan"'='));
    println!("{}", hyph.hyphenate_word("o’dwyer"'='));
    println!("{}", hyph.hyphenate_word("o’callahan"'='));
    println!("{}", hyph.hyphenate_word("petti-fogging"'='));
    println!("{}", hyph.hyphenate_word("e-mailing"'='));
    println!("{}", hyph.hyphenate_word("-x-mailing"'='));
    println!("{}", hyph.hyphenate_word("-strikeout-"'='));

    let dic2 = match unsafe { mapped_hyph::load_file("tests/compound.hyf") } {
        Some(dic) => dic,
        _ => panic!("failed to load dictionary {}""tests/compound.hyf"),
    };

    let h2 = Hyphenator::new(&*dic2);
    println!("{}", h2.hyphenate_word("motorcycle"'='));

    let dic3 = match unsafe { mapped_hyph::load_file("tests/rhmin.hyf") } {
        Some(dic) => dic,
        _ => panic!("failed to load dictionary {}", dic_path),
    };
    let h3 = Hyphenator::new(&*dic3);
    println!("{}", h3.hyphenate_word("övéit"'='));
    println!("{}", h3.hyphenate_word("అంగడిధర"'='));

    let dic4 = match unsafe { mapped_hyph::load_file("tests/num.hyf") } {
        Some(dic) => dic,
        _ => panic!("failed to load dictionary {}""tests/num.hyf"),
    };
    let h4 = Hyphenator::new(&*dic4);

    println!("{}", h4.hyphenate_word("123foobar123"'='));
    println!("{}", h4.hyphenate_word("123foobarfoobar"'='));
    println!("{}", h4.hyphenate_word("foobarfoobar123"'='));
    println!("{}", h4.hyphenate_word("123foobarfoobar123"'='));
}

Messung V0.5 in Prozent
C=82 H=100 G=91

¤ Dauer der Verarbeitung: 0.11 Sekunden  (vorverarbeitet am  2026-06-18) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.