repo
stringlengths
6
65
file_url
stringlengths
81
311
file_path
stringlengths
6
227
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 15:31:58
2026-01-04 20:25:31
truncated
bool
2 classes
facebook/ocamlrep
https://github.com/facebook/ocamlrep/blob/3ed6e41c17c6d05e19121b59beb8efbb1a7ce3b6/ocamlrep_ocamlpool/build.rs
ocamlrep_ocamlpool/build.rs
// Copyright (c) Meta Platforms, Inc. and affiliates. // Assume an opam environment (`eval "$(opam env --switch=default // --set-switch)"`) then to find the prevailing standard library caml // headers, `OCAMLLIB=$(ocamlopt.opt -config | grep standard_library: // | awk '{ print $2 }')`. fn ocamllib_dir() -> std::path::...
rust
MIT
3ed6e41c17c6d05e19121b59beb8efbb1a7ce3b6
2026-01-04T20:16:50.959951Z
false
facebook/ocamlrep
https://github.com/facebook/ocamlrep/blob/3ed6e41c17c6d05e19121b59beb8efbb1a7ce3b6/ocamlrep_ocamlpool/test/ocamlpool_test.rs
ocamlrep_ocamlpool/test/ocamlpool_test.rs
// Copyright (c) Meta Platforms, Inc. and affiliates. // // This source code is licensed under the MIT license found in the // LICENSE file in the root directory of this source tree. #![allow(unused_crate_dependencies)] #![feature(exit_status_error)] use ocamlrep_ocamlpool::FromOcamlRep; use ocamlrep_ocamlpool::ocaml...
rust
MIT
3ed6e41c17c6d05e19121b59beb8efbb1a7ce3b6
2026-01-04T20:16:50.959951Z
false
facebook/ocamlrep
https://github.com/facebook/ocamlrep/blob/3ed6e41c17c6d05e19121b59beb8efbb1a7ce3b6/signed_source/signed_source.rs
signed_source/signed_source.rs
// Copyright (c) Meta Platforms, Inc. and affiliates. // // This source code is licensed under the MIT license found in the // LICENSE file in the root directory of this source tree. use bstr::ByteSlice; use once_cell::sync::Lazy; use regex::bytes::Regex; /// This crate is a port of hphp/hack/src/utils/signed_source....
rust
MIT
3ed6e41c17c6d05e19121b59beb8efbb1a7ce3b6
2026-01-04T20:16:50.959951Z
false
kurtbuilds/checkexec
https://github.com/kurtbuilds/checkexec/blob/55cb83eb0a724581fc715e5b6763be4fc85e570a/src/main.rs
src/main.rs
use std::borrow::Cow; use std::fmt::{Display}; use std::path::{Path}; use std::process::{exit, Command}; use clap::{App, AppSettings, Arg}; use std::fs; use shell_escape::escape; const VERSION: &str = env!("CARGO_PKG_VERSION"); struct Error { message: String, } impl std::fmt::Debug for Error { fn fmt(&self...
rust
MIT
55cb83eb0a724581fc715e5b6763be4fc85e570a
2026-01-04T20:17:04.062470Z
false
zhengkyl/fuqr
https://github.com/zhengkyl/fuqr/blob/34df61784a809b2de44b21803501a841d8135dfc/src/error_correction.rs
src/error_correction.rs
use crate::{ constants::{GEN_POLYNOMIALS, NUM_BLOCKS, NUM_DATA_MODULES, NUM_EC_CODEWORDS}, data::Data, math::{EXP_TABLE, LOG_TABLE}, }; pub fn ecc_and_sequence(mut data: Data) -> Vec<u8> { let modules = NUM_DATA_MODULES[data.version.0] as usize; let codewords = modules / 8; let remainder_bits =...
rust
MIT
34df61784a809b2de44b21803501a841d8135dfc
2026-01-04T20:16:52.445539Z
false
zhengkyl/fuqr
https://github.com/zhengkyl/fuqr/blob/34df61784a809b2de44b21803501a841d8135dfc/src/lib.rs
src/lib.rs
pub mod constants; pub mod math; pub mod data; pub mod encoding; pub mod error_correction; pub mod mask; pub mod matrix; pub mod qr_code; pub mod bit_info; pub mod qart; pub mod render; #[cfg(feature = "wasm")] mod wasm; use crate::data::Data; use crate::qr_code::{Mask, Mode, Version, ECL}; use encoding::encoding...
rust
MIT
34df61784a809b2de44b21803501a841d8135dfc
2026-01-04T20:16:52.445539Z
false
zhengkyl/fuqr
https://github.com/zhengkyl/fuqr/blob/34df61784a809b2de44b21803501a841d8135dfc/src/math.rs
src/math.rs
// note: a 256 * 256 mult table is a possible alternative pub const EXP_TABLE: [u8; 255] = exp_table(); pub const LOG_TABLE: [u8; 256] = log_table(); /// 2 ^ x for 0 to 254 const fn exp_table() -> [u8; 255] { let mut array = [0; 255]; array[0] = 1; let mut i = 1; while i < 255 { array[i] = arra...
rust
MIT
34df61784a809b2de44b21803501a841d8135dfc
2026-01-04T20:16:52.445539Z
false
zhengkyl/fuqr
https://github.com/zhengkyl/fuqr/blob/34df61784a809b2de44b21803501a841d8135dfc/src/bit_info.rs
src/bit_info.rs
use std::ops::BitOrAssign; use crate::{ constants::{NUM_BLOCKS, NUM_DATA_MODULES, NUM_EC_CODEWORDS}, matrix::{Matrix, Module}, qr_code::{Mask, Mode, Version, ECL}, }; #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub struct Info { /// Module except meaning changes when DATA set pub module: Module, ...
rust
MIT
34df61784a809b2de44b21803501a841d8135dfc
2026-01-04T20:16:52.445539Z
false
zhengkyl/fuqr
https://github.com/zhengkyl/fuqr/blob/34df61784a809b2de44b21803501a841d8135dfc/src/mask.rs
src/mask.rs
use crate::matrix::{Matrix, Module}; // todo UNTESTED CODE: HERE BE DRAGONS // if score is wrong for all masks, then this still works pub fn score(matrix: &Matrix<Module>) -> u32 { // todo what are perf implications of scoring all masks // 8 masks * 5 iterations (blocks + rows are non sequential access) f...
rust
MIT
34df61784a809b2de44b21803501a841d8135dfc
2026-01-04T20:16:52.445539Z
false
zhengkyl/fuqr
https://github.com/zhengkyl/fuqr/blob/34df61784a809b2de44b21803501a841d8135dfc/src/render.rs
src/render.rs
#[cfg(feature = "svg")] pub mod svg; #[cfg(feature = "text")] pub mod text; #[cfg(feature = "svg")] use crate::qr_code::QrCode; #[cfg(feature = "svg")] pub struct RenderData<'m> { qr_code: &'m QrCode, foreground: String, background: String, unit: usize, margin: usize, toggle_options: u8, } #[...
rust
MIT
34df61784a809b2de44b21803501a841d8135dfc
2026-01-04T20:16:52.445539Z
false
zhengkyl/fuqr
https://github.com/zhengkyl/fuqr/blob/34df61784a809b2de44b21803501a841d8135dfc/src/qr_code.rs
src/qr_code.rs
use crate::{ data::Data, error_correction::ecc_and_sequence, mask::score, matrix::{Matrix, Module}, }; #[cfg(feature = "wasm")] use wasm_bindgen::prelude::*; #[cfg_attr(feature = "wasm", wasm_bindgen)] #[derive(Clone, Copy, PartialEq, Eq, Debug)] pub enum Mode { Numeric, Alphanumeric, Byte...
rust
MIT
34df61784a809b2de44b21803501a841d8135dfc
2026-01-04T20:16:52.445539Z
false
zhengkyl/fuqr
https://github.com/zhengkyl/fuqr/blob/34df61784a809b2de44b21803501a841d8135dfc/src/qart.rs
src/qart.rs
use crate::{ bit_info::{BitInfo, Info}, constants::{GEN_POLYNOMIALS, NUM_BLOCKS, NUM_DATA_MODULES, NUM_EC_CODEWORDS}, data::{BitVec, Data}, error_correction::remainder, matrix::{Matrix, Module}, qr_code::{mask_fn, Mask, QrCode}, }; #[derive(Debug, Clone, Copy)] pub struct WeightPixel(pub u8); ...
rust
MIT
34df61784a809b2de44b21803501a841d8135dfc
2026-01-04T20:16:52.445539Z
false
zhengkyl/fuqr
https://github.com/zhengkyl/fuqr/blob/34df61784a809b2de44b21803501a841d8135dfc/src/wasm.rs
src/wasm.rs
use crate::{ bit_info::BitInfo, qr_code::{Mask, Mode, QrCode, Version, ECL}, QartError, QrError, QrOptions, }; use wasm_bindgen::prelude::*; #[global_allocator] static ALLOC: wee_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT; #[wasm_bindgen] pub fn generate(input: &str, qr_options: &QrOptions) -> Result<JsV...
rust
MIT
34df61784a809b2de44b21803501a841d8135dfc
2026-01-04T20:16:52.445539Z
false
zhengkyl/fuqr
https://github.com/zhengkyl/fuqr/blob/34df61784a809b2de44b21803501a841d8135dfc/src/constants.rs
src/constants.rs
use crate::{ math::{EXP_TABLE, LOG_TABLE}, qr_code::ECL, }; pub const NUM_DATA_MODULES: [u16; 41] = num_data_modules(); pub const NUM_EC_CODEWORDS: [[u16; 4]; 41] = num_ec_codewords(); pub const NUM_BLOCKS: [[u8; 4]; 41] = num_blocks(); /// All generator polynomials for up to 30 error correction codewords. //...
rust
MIT
34df61784a809b2de44b21803501a841d8135dfc
2026-01-04T20:16:52.445539Z
false
zhengkyl/fuqr
https://github.com/zhengkyl/fuqr/blob/34df61784a809b2de44b21803501a841d8135dfc/src/data.rs
src/data.rs
use crate::{ constants::{NUM_DATA_MODULES, NUM_EC_CODEWORDS}, encoding::{encode_alphanumeric, encode_byte, encode_numeric, num_cci_bits}, qr_code::{Mode, Version, ECL}, }; #[derive(Debug)] pub struct Data { pub bits: BitVec, pub mode: Mode, pub version: Version, pub ecl: ECL, } impl Data {...
rust
MIT
34df61784a809b2de44b21803501a841d8135dfc
2026-01-04T20:16:52.445539Z
false
zhengkyl/fuqr
https://github.com/zhengkyl/fuqr/blob/34df61784a809b2de44b21803501a841d8135dfc/src/encoding.rs
src/encoding.rs
use crate::{ data::Data, qr_code::{Mode, Version}, }; pub fn encoding_mode(input: &str) -> Mode { let mut mode = Mode::Numeric; for b in input.bytes() { if b >= b'0' && b <= b'9' { continue; } if byte_to_b45(b) < 45 { mode = Mode::Alphanumeric; } ...
rust
MIT
34df61784a809b2de44b21803501a841d8135dfc
2026-01-04T20:16:52.445539Z
false
zhengkyl/fuqr
https://github.com/zhengkyl/fuqr/blob/34df61784a809b2de44b21803501a841d8135dfc/src/matrix.rs
src/matrix.rs
use std::ops::{BitAnd, BitAndAssign, BitOr, BitOrAssign, BitXor, BitXorAssign}; use crate::{ constants::{FORMAT_INFO, VERSION_INFO}, qr_code::{Mask, Version, ECL}, }; #[derive(Debug)] pub struct Matrix<T: Copy + From<Module> + Into<Module> + BitOrAssign<Module>> { pub value: Vec<T>, pub width: usize, ...
rust
MIT
34df61784a809b2de44b21803501a841d8135dfc
2026-01-04T20:16:52.445539Z
false
zhengkyl/fuqr
https://github.com/zhengkyl/fuqr/blob/34df61784a809b2de44b21803501a841d8135dfc/src/render/svg.rs
src/render/svg.rs
use crate::matrix::Module; use super::{RenderData, Toggle}; pub fn render_svg(render: &RenderData) -> String { let mut output = String::with_capacity(40 * (render.width() * render.width()) / 2); output.push_str(&format!( r#"<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 {} {}">"#, render...
rust
MIT
34df61784a809b2de44b21803501a841d8135dfc
2026-01-04T20:16:52.445539Z
false
zhengkyl/fuqr
https://github.com/zhengkyl/fuqr/blob/34df61784a809b2de44b21803501a841d8135dfc/src/render/text.rs
src/render/text.rs
use crate::matrix::Module; use super::RenderData; pub fn render_utf8(render: &RenderData) -> String { // row length +1 for \n and take ceil of rows / 2 if odd let mut result = String::with_capacity((render.width() + 1) * (render.width() + 1) / 2); let start = render.margin; let end = render.qr_code.m...
rust
MIT
34df61784a809b2de44b21803501a841d8135dfc
2026-01-04T20:16:52.445539Z
false
zhengkyl/fuqr
https://github.com/zhengkyl/fuqr/blob/34df61784a809b2de44b21803501a841d8135dfc/benches/qr.rs
benches/qr.rs
// copied from https://github.com/erwanvivien/fast_qr/blob/master/benches/qr.rs use criterion::{criterion_group, criterion_main, Criterion, Throughput}; use fuqr::QrOptions; use std::hint::black_box; use std::time::Duration; fn bench_fastqr_qrcode(c: &mut Criterion) { let bytes: &[u8] = b"https://example.com/"; ...
rust
MIT
34df61784a809b2de44b21803501a841d8135dfc
2026-01-04T20:16:52.445539Z
false
zhengkyl/fuqr
https://github.com/zhengkyl/fuqr/blob/34df61784a809b2de44b21803501a841d8135dfc/examples/bad_apple.rs
examples/bad_apple.rs
use fuqr::{ generate_qart, matrix::Module, qart::WeightPixel, qr_code::{Mode, Version}, QrOptions, }; use image::{ImageBuffer, Rgb}; use ffmpeg::software::scaling::{context::Context, flag::Flags}; use ffmpeg_next as ffmpeg; const USE_PATTERN: bool = true; const QR_VERSION: usize = 13; const X_ASPE...
rust
MIT
34df61784a809b2de44b21803501a841d8135dfc
2026-01-04T20:16:52.445539Z
false
zhengkyl/fuqr
https://github.com/zhengkyl/fuqr/blob/34df61784a809b2de44b21803501a841d8135dfc/examples/layers.rs
examples/layers.rs
use std::{fs::File, io::BufReader}; use fuqr::{ generate, matrix::{Matrix, Module}, QrOptions, }; use image::{ codecs::gif::{GifDecoder, GifEncoder}, imageops::{self, FilterType}, AnimationDecoder, Delay, DynamicImage, Frame, GenericImage, GenericImageView, ImageBuffer, ImageError, Rgba, };...
rust
MIT
34df61784a809b2de44b21803501a841d8135dfc
2026-01-04T20:16:52.445539Z
false
zhengkyl/fuqr
https://github.com/zhengkyl/fuqr/blob/34df61784a809b2de44b21803501a841d8135dfc/examples/weave.rs
examples/weave.rs
use fuqr::{ generate, matrix::{Matrix, Module}, QrOptions, }; use image::ImageError; fn weave( matrix: &Matrix<Module>, gap: u32, flip: bool, ) -> image::ImageBuffer<image::Rgb<u8>, Vec<u8>> { let density: u32 = 11; let margin = 2; let size = matrix.width + margin + margin; let ...
rust
MIT
34df61784a809b2de44b21803501a841d8135dfc
2026-01-04T20:16:52.445539Z
false
zhengkyl/fuqr
https://github.com/zhengkyl/fuqr/blob/34df61784a809b2de44b21803501a841d8135dfc/examples/nested.rs
examples/nested.rs
use fuqr::{ generate, generate_qart, matrix::Module, qart::WeightPixel, qr_code::Version, QrOptions, }; use image::{ImageBuffer, Rgb}; fn main() { doll(); donut(); } fn doll() { let margin = 2; let version = 1; let mut prev_width = version * 4 + 17; let mut prev_full_width = prev_width + ...
rust
MIT
34df61784a809b2de44b21803501a841d8135dfc
2026-01-04T20:16:52.445539Z
false
zhengkyl/fuqr
https://github.com/zhengkyl/fuqr/blob/34df61784a809b2de44b21803501a841d8135dfc/examples/scale.rs
examples/scale.rs
use std::fs::File; use fuqr::{ generate, matrix::{Matrix, Module}, QrOptions, }; use image::{codecs::gif::GifEncoder, Delay, Frame, ImageError, Rgb, Rgba}; fn circle(matrix: &Matrix<Module>) -> Result<(), ImageError> { let center = matrix.width / 2; let margin = 2; let unit = 10; let max_...
rust
MIT
34df61784a809b2de44b21803501a841d8135dfc
2026-01-04T20:16:52.445539Z
false
akaza-im/akaza
https://github.com/akaza-im/akaza/blob/b7dace72e7ce2054a9daf6ba0e6aca008bb8926f/ibus-sys/src/attribute.rs
ibus-sys/src/attribute.rs
use crate::glib::guint; pub const IBusAttrType_IBUS_ATTR_TYPE_UNDERLINE: IBusAttrType = 1; pub const IBusAttrType_IBUS_ATTR_TYPE_FOREGROUND: IBusAttrType = 2; pub const IBusAttrType_IBUS_ATTR_TYPE_BACKGROUND: IBusAttrType = 3; #[doc = " IBusAttrType:\n @IBUS_ATTR_TYPE_UNDERLINE: Decorate with underline.\n @IBUS_ATTR_...
rust
MIT
b7dace72e7ce2054a9daf6ba0e6aca008bb8926f
2026-01-04T19:35:02.740723Z
false
akaza-im/akaza
https://github.com/akaza-im/akaza/blob/b7dace72e7ce2054a9daf6ba0e6aca008bb8926f/ibus-sys/src/engine.rs
ibus-sys/src/engine.rs
use crate::glib::{gboolean, guint}; use crate::lookup_table::IBusLookupTable; use crate::prop_list::IBusPropList; use crate::property::IBusProperty; use crate::text::IBusText; extern "C" { // engine pub fn ibus_engine_commit_text(engine: *mut IBusEngine, text: *mut IBusText); pub fn ibus_engine_hide_lookup...
rust
MIT
b7dace72e7ce2054a9daf6ba0e6aca008bb8926f
2026-01-04T19:35:02.740723Z
false
akaza-im/akaza
https://github.com/akaza-im/akaza/blob/b7dace72e7ce2054a9daf6ba0e6aca008bb8926f/ibus-sys/src/lib.rs
ibus-sys/src/lib.rs
#![allow(non_camel_case_types)] #![allow(non_upper_case_globals)] pub mod attr_list; pub mod attribute; pub mod core; pub mod engine; pub mod glib; pub mod ibus_key; pub mod keys; pub mod lookup_table; pub mod prop_list; pub mod property; pub mod text;
rust
MIT
b7dace72e7ce2054a9daf6ba0e6aca008bb8926f
2026-01-04T19:35:02.740723Z
false
akaza-im/akaza
https://github.com/akaza-im/akaza/blob/b7dace72e7ce2054a9daf6ba0e6aca008bb8926f/ibus-sys/src/lookup_table.rs
ibus-sys/src/lookup_table.rs
use crate::core::IBusSerializable; use crate::glib::{g_object_ref_sink, gboolean, gint, gpointer, guint, GArray}; use crate::text::IBusText; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct IBusLookupTable { pub parent: IBusSerializable, pub page_size: guint, pub cursor_pos: guint, pub cursor_visibl...
rust
MIT
b7dace72e7ce2054a9daf6ba0e6aca008bb8926f
2026-01-04T19:35:02.740723Z
false
akaza-im/akaza
https://github.com/akaza-im/akaza/blob/b7dace72e7ce2054a9daf6ba0e6aca008bb8926f/ibus-sys/src/ibus_key.rs
ibus-sys/src/ibus_key.rs
#![allow(non_camel_case_types)] #![allow(non_upper_case_globals)] #![allow(dead_code)] pub const IBUS_KEY_VoidSymbol: u32 = 16777215; pub const IBUS_KEY_BackSpace: u32 = 65288; pub const IBUS_KEY_Tab: u32 = 65289; pub const IBUS_KEY_Linefeed: u32 = 65290; pub const IBUS_KEY_Clear: u32 = 65291; pub const IBUS_KEY_Retur...
rust
MIT
b7dace72e7ce2054a9daf6ba0e6aca008bb8926f
2026-01-04T19:35:02.740723Z
true
akaza-im/akaza
https://github.com/akaza-im/akaza/blob/b7dace72e7ce2054a9daf6ba0e6aca008bb8926f/ibus-sys/src/attr_list.rs
ibus-sys/src/attr_list.rs
use crate::attribute::IBusAttribute; extern "C" { #[doc = " ibus_attr_list_new:\n\n Creates an new #IBusAttrList.\n\n Returns: A newly allocated #IBusAttrList."] pub fn ibus_attr_list_new() -> *mut IBusAttrList; #[doc = " ibus_attr_list_append:\n @attr_list: An IBusAttrList instance.\n @attr: The IBusAttri...
rust
MIT
b7dace72e7ce2054a9daf6ba0e6aca008bb8926f
2026-01-04T19:35:02.740723Z
false
akaza-im/akaza
https://github.com/akaza-im/akaza/blob/b7dace72e7ce2054a9daf6ba0e6aca008bb8926f/ibus-sys/src/glib.rs
ibus-sys/src/glib.rs
extern "C" { // This method retain the object's reference count.n pub fn g_object_ref_sink(object: gpointer) -> gpointer; } pub type gchar = ::std::os::raw::c_char; pub type guint = ::std::os::raw::c_uint; pub type gboolean = ::std::os::raw::c_int; pub type gsize = ::std::os::raw::c_ulong; pub type gssize = ::...
rust
MIT
b7dace72e7ce2054a9daf6ba0e6aca008bb8926f
2026-01-04T19:35:02.740723Z
false
akaza-im/akaza
https://github.com/akaza-im/akaza/blob/b7dace72e7ce2054a9daf6ba0e6aca008bb8926f/ibus-sys/src/core.rs
ibus-sys/src/core.rs
#![allow(dead_code)] // See bindgen.sh's output to improvement this file. // TODO: maybe i can update this file as more rust native interface... // ibus wrapper functions. use crate::glib::gboolean; pub type IBusSerializable = [u64; 6usize]; pub const IBusModifierType_IBUS_SHIFT_MASK: IBusModifierType = 1; pub con...
rust
MIT
b7dace72e7ce2054a9daf6ba0e6aca008bb8926f
2026-01-04T19:35:02.740723Z
false
akaza-im/akaza
https://github.com/akaza-im/akaza/blob/b7dace72e7ce2054a9daf6ba0e6aca008bb8926f/ibus-sys/src/text.rs
ibus-sys/src/text.rs
use std::ffi::CString; use crate::attr_list::IBusAttrList; use crate::glib::gchar; extern "C" { pub fn ibus_text_new_from_string(str_: *const gchar) -> *mut IBusText; #[doc = " ibus_text_set_attributes:\n @text: An IBusText.\n @attrs: An IBusAttrList"] pub fn ibus_text_set_attributes(text: *mut IBusText, ...
rust
MIT
b7dace72e7ce2054a9daf6ba0e6aca008bb8926f
2026-01-04T19:35:02.740723Z
false
akaza-im/akaza
https://github.com/akaza-im/akaza/blob/b7dace72e7ce2054a9daf6ba0e6aca008bb8926f/ibus-sys/src/prop_list.rs
ibus-sys/src/prop_list.rs
use crate::core::IBusSerializable; use crate::glib::GArray; use crate::property::IBusProperty; extern "C" { pub fn ibus_prop_list_new() -> *mut IBusPropList; pub fn ibus_prop_list_append(prop_list: *mut IBusPropList, prop: *mut IBusProperty); } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct IBusPropList ...
rust
MIT
b7dace72e7ce2054a9daf6ba0e6aca008bb8926f
2026-01-04T19:35:02.740723Z
false
akaza-im/akaza
https://github.com/akaza-im/akaza/blob/b7dace72e7ce2054a9daf6ba0e6aca008bb8926f/ibus-sys/src/property.rs
ibus-sys/src/property.rs
use crate::core::IBusSerializable; use crate::glib::{gboolean, gchar, gpointer}; use crate::prop_list::IBusPropList; use crate::text::IBusText; pub const IBusPropState_PROP_STATE_UNCHECKED: IBusPropState = 0; pub const IBusPropState_PROP_STATE_CHECKED: IBusPropState = 1; pub const IBusPropState_PROP_STATE_INCONSISTENT...
rust
MIT
b7dace72e7ce2054a9daf6ba0e6aca008bb8926f
2026-01-04T19:35:02.740723Z
false
akaza-im/akaza
https://github.com/akaza-im/akaza/blob/b7dace72e7ce2054a9daf6ba0e6aca008bb8926f/ibus-sys/src/keys.rs
ibus-sys/src/keys.rs
use crate::glib::{gchar, guint}; extern "C" { pub fn ibus_keyval_name(keyval: guint) -> *const gchar; pub fn ibus_keyval_from_name(keyval_name: *const gchar) -> guint; }
rust
MIT
b7dace72e7ce2054a9daf6ba0e6aca008bb8926f
2026-01-04T19:35:02.740723Z
false
akaza-im/akaza
https://github.com/akaza-im/akaza/blob/b7dace72e7ce2054a9daf6ba0e6aca008bb8926f/akaza-conf/src/lib.rs
akaza-conf/src/lib.rs
pub mod conf; mod pane;
rust
MIT
b7dace72e7ce2054a9daf6ba0e6aca008bb8926f
2026-01-04T19:35:02.740723Z
false
akaza-im/akaza
https://github.com/akaza-im/akaza/blob/b7dace72e7ce2054a9daf6ba0e6aca008bb8926f/akaza-conf/src/conf.rs
akaza-conf/src/conf.rs
use std::process::Command; use std::sync::{Arc, Mutex}; use anyhow::Result; use gtk::glib::signal::Inhibit; use gtk::prelude::*; use gtk::{Application, ApplicationWindow, Button, Label, Notebook}; use gtk4 as gtk; use gtk4::gio::ApplicationFlags; use gtk4::Grid; use log::{error, info}; use libakaza::config::{Config, ...
rust
MIT
b7dace72e7ce2054a9daf6ba0e6aca008bb8926f
2026-01-04T19:35:02.740723Z
false
akaza-im/akaza
https://github.com/akaza-im/akaza/blob/b7dace72e7ce2054a9daf6ba0e6aca008bb8926f/akaza-conf/src/pane/dict_pane.rs
akaza-conf/src/pane/dict_pane.rs
use std::path::PathBuf; use std::sync::{Arc, Mutex}; use gtk4::builders::MessageDialogBuilder; use gtk4::prelude::ButtonExt; use gtk4::prelude::ComboBoxExt; use gtk4::prelude::DialogExt; use gtk4::prelude::EntryBufferExt; use gtk4::prelude::EntryBufferExtManual; use gtk4::prelude::FileChooserExt; use gtk4::prelude::Fi...
rust
MIT
b7dace72e7ce2054a9daf6ba0e6aca008bb8926f
2026-01-04T19:35:02.740723Z
false
akaza-im/akaza
https://github.com/akaza-im/akaza/blob/b7dace72e7ce2054a9daf6ba0e6aca008bb8926f/akaza-conf/src/pane/core_pane.rs
akaza-conf/src/pane/core_pane.rs
use gtk4::prelude::{CheckButtonExt, ComboBoxExt, GridExt}; use gtk4::{CheckButton, ComboBoxText, Grid, Label}; use libakaza::config::Config; use log::info; use std::path::PathBuf; use std::sync::{Arc, Mutex}; pub fn build_core_pane(config: Arc<Mutex<Config>>) -> anyhow::Result<Grid> { // キーマップとローマ字テーブル、モデルの設定ができるよ...
rust
MIT
b7dace72e7ce2054a9daf6ba0e6aca008bb8926f
2026-01-04T19:35:02.740723Z
false
akaza-im/akaza
https://github.com/akaza-im/akaza/blob/b7dace72e7ce2054a9daf6ba0e6aca008bb8926f/akaza-conf/src/pane/mod.rs
akaza-conf/src/pane/mod.rs
pub mod about_pane; pub mod core_pane; pub mod dict_pane;
rust
MIT
b7dace72e7ce2054a9daf6ba0e6aca008bb8926f
2026-01-04T19:35:02.740723Z
false
akaza-im/akaza
https://github.com/akaza-im/akaza/blob/b7dace72e7ce2054a9daf6ba0e6aca008bb8926f/akaza-conf/src/pane/about_pane.rs
akaza-conf/src/pane/about_pane.rs
use gtk4::Label; pub fn build_about_pane() -> Label { Label::new(Some( format!("Akaza version {}", env!("CARGO_PKG_VERSION")).as_str(), )) }
rust
MIT
b7dace72e7ce2054a9daf6ba0e6aca008bb8926f
2026-01-04T19:35:02.740723Z
false
akaza-im/akaza
https://github.com/akaza-im/akaza/blob/b7dace72e7ce2054a9daf6ba0e6aca008bb8926f/akaza-conf/src/bin/akaza-conf.rs
akaza-conf/src/bin/akaza-conf.rs
use akaza_conf::conf::open_configuration_window; use anyhow::Result; use log::LevelFilter; /// デバッグ用 fn main() -> Result<()> { let _ = env_logger::builder() .filter_level(LevelFilter::Info) .try_init(); open_configuration_window()?; Ok(()) }
rust
MIT
b7dace72e7ce2054a9daf6ba0e6aca008bb8926f
2026-01-04T19:35:02.740723Z
false
akaza-im/akaza
https://github.com/akaza-im/akaza/blob/b7dace72e7ce2054a9daf6ba0e6aca008bb8926f/marisa-sys/build.rs
marisa-sys/build.rs
extern crate cc; fn main() { cc::Build::new() .cpp(true) .file("wrapper.cc") .include("wrapper") .compile("wrapper"); println!("cargo:rustc-link-lib=marisa"); }
rust
MIT
b7dace72e7ce2054a9daf6ba0e6aca008bb8926f
2026-01-04T19:35:02.740723Z
false
akaza-im/akaza
https://github.com/akaza-im/akaza/blob/b7dace72e7ce2054a9daf6ba0e6aca008bb8926f/marisa-sys/src/bindings.rs
marisa-sys/src/bindings.rs
// --------------------------------------------------- // low level C wrappers // --------------------------------------------------- use std::ffi::{c_char, CString}; use std::os::raw::c_void; use anyhow::{anyhow, Result}; #[repr(C)] #[derive(Debug, Copy, Clone)] struct marisa_obj { trie: *mut c_void, } // ↓↓ I...
rust
MIT
b7dace72e7ce2054a9daf6ba0e6aca008bb8926f
2026-01-04T19:35:02.740723Z
false
akaza-im/akaza
https://github.com/akaza-im/akaza/blob/b7dace72e7ce2054a9daf6ba0e6aca008bb8926f/marisa-sys/src/lib.rs
marisa-sys/src/lib.rs
#![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] #![allow(non_snake_case)] #![allow(dead_code)] extern crate alloc; include!("bindings.rs");
rust
MIT
b7dace72e7ce2054a9daf6ba0e6aca008bb8926f
2026-01-04T19:35:02.740723Z
false
akaza-im/akaza
https://github.com/akaza-im/akaza/blob/b7dace72e7ce2054a9daf6ba0e6aca008bb8926f/ibus-akaza/build.rs
ibus-akaza/build.rs
extern crate cc; use std::io::Read; use std::process::{Command, Stdio}; fn pkgconfig(module: &str, flag: &str) -> Vec<String> { let child = Command::new("pkg-config") .arg(module) .arg(flag) .stdout(Stdio::piped()) .spawn() .expect("Failed to spawn child process"); let ...
rust
MIT
b7dace72e7ce2054a9daf6ba0e6aca008bb8926f
2026-01-04T19:35:02.740723Z
false
akaza-im/akaza
https://github.com/akaza-im/akaza/blob/b7dace72e7ce2054a9daf6ba0e6aca008bb8926f/ibus-akaza/src/commands.rs
ibus-akaza/src/commands.rs
use std::collections::HashMap; use ibus_sys::engine::IBusEngine; use crate::input_mode::{ INPUT_MODE_ALNUM, INPUT_MODE_FULLWIDTH_ALNUM, INPUT_MODE_HALFWIDTH_KATAKANA, INPUT_MODE_HIRAGANA, INPUT_MODE_KATAKANA, }; use crate::AkazaContext; /** * shortcut key を設定可能な機能。 */ pub type IbusAkazaCommand = fn(&mut Ak...
rust
MIT
b7dace72e7ce2054a9daf6ba0e6aca008bb8926f
2026-01-04T19:35:02.740723Z
false
akaza-im/akaza
https://github.com/akaza-im/akaza/blob/b7dace72e7ce2054a9daf6ba0e6aca008bb8926f/ibus-akaza/src/wrapper_bindings.rs
ibus-akaza/src/wrapper_bindings.rs
#![allow(non_camel_case_types)] #![allow(non_upper_case_globals)] #![allow(dead_code)] use std::ffi::c_void; use ibus_sys::engine::IBusEngine; use ibus_sys::glib::{gchar, guint}; // FFI for the wrapper.c pub(crate) type ibus_akaza_callback_key_event = unsafe extern "C" fn( context: *mut c_void, engine: *mut ...
rust
MIT
b7dace72e7ce2054a9daf6ba0e6aca008bb8926f
2026-01-04T19:35:02.740723Z
false
akaza-im/akaza
https://github.com/akaza-im/akaza/blob/b7dace72e7ce2054a9daf6ba0e6aca008bb8926f/ibus-akaza/src/keymap.rs
ibus-akaza/src/keymap.rs
use alloc::ffi::CString; use std::collections::HashMap; use log::{error, trace}; use ibus_sys::core::{IBusModifierType_IBUS_CONTROL_MASK, IBusModifierType_IBUS_SHIFT_MASK}; use ibus_sys::glib::guint; use ibus_sys::ibus_key::IBUS_KEY_VoidSymbol; use ibus_sys::keys::ibus_keyval_from_name; use libakaza::keymap::{KeyPatt...
rust
MIT
b7dace72e7ce2054a9daf6ba0e6aca008bb8926f
2026-01-04T19:35:02.740723Z
false
akaza-im/akaza
https://github.com/akaza-im/akaza/blob/b7dace72e7ce2054a9daf6ba0e6aca008bb8926f/ibus-akaza/src/main.rs
ibus-akaza/src/main.rs
#![allow(non_upper_case_globals)] extern crate alloc; use std::ffi::{c_char, c_void, CStr}; use std::sync::{Arc, Mutex}; use std::time::SystemTime; use std::{thread, time}; use anyhow::Result; use clap::Parser; use log::{error, info, warn}; use ibus_sys::core::ibus_main; use ibus_sys::engine::IBusEngine; use ibus_s...
rust
MIT
b7dace72e7ce2054a9daf6ba0e6aca008bb8926f
2026-01-04T19:35:02.740723Z
false
akaza-im/akaza
https://github.com/akaza-im/akaza/blob/b7dace72e7ce2054a9daf6ba0e6aca008bb8926f/ibus-akaza/src/input_mode.rs
ibus-akaza/src/input_mode.rs
use anyhow::bail; #[derive(Copy, Clone, Debug)] pub struct InputMode { pub prop_name: &'static str, pub mode_code: i32, pub symbol: &'static str, pub label: &'static str, } impl PartialEq for InputMode { fn eq(&self, other: &Self) -> bool { self.mode_code == other.mode_code } } impl I...
rust
MIT
b7dace72e7ce2054a9daf6ba0e6aca008bb8926f
2026-01-04T19:35:02.740723Z
false
akaza-im/akaza
https://github.com/akaza-im/akaza/blob/b7dace72e7ce2054a9daf6ba0e6aca008bb8926f/ibus-akaza/src/context.rs
ibus-akaza/src/context.rs
use std::collections::HashMap; use anyhow::Result; use kelp::{h2z, hira2kata, z2h, ConvOption}; use log::{error, info, trace, warn}; use akaza_conf::conf::open_configuration_window; use akaza_dict::conf::open_userdict_window; use ibus_sys::core::{ IBusModifierType_IBUS_CONTROL_MASK, IBusModifierType_IBUS_HYPER_MA...
rust
MIT
b7dace72e7ce2054a9daf6ba0e6aca008bb8926f
2026-01-04T19:35:02.740723Z
false
akaza-im/akaza
https://github.com/akaza-im/akaza/blob/b7dace72e7ce2054a9daf6ba0e6aca008bb8926f/ibus-akaza/src/current_state.rs
ibus-akaza/src/current_state.rs
use std::collections::HashMap; use std::ops::Range; use kelp::{hira2kata, z2h, ConvOption}; use log::info; use ibus_sys::attr_list::{ibus_attr_list_append, ibus_attr_list_new}; use ibus_sys::attribute::{ ibus_attribute_new, IBusAttrType_IBUS_ATTR_TYPE_BACKGROUND, IBusAttrType_IBUS_ATTR_TYPE_UNDERLINE, IBusAtt...
rust
MIT
b7dace72e7ce2054a9daf6ba0e6aca008bb8926f
2026-01-04T19:35:02.740723Z
false
akaza-im/akaza
https://github.com/akaza-im/akaza/blob/b7dace72e7ce2054a9daf6ba0e6aca008bb8926f/ibus-akaza/src/ui/prop_controller.rs
ibus-akaza/src/ui/prop_controller.rs
use std::collections::HashMap; use std::path::Path; use anyhow::Result; use ibus_sys::core::to_gboolean; use ibus_sys::engine::{ibus_engine_register_properties, ibus_engine_update_property, IBusEngine}; use ibus_sys::glib::{g_object_ref_sink, gchar, gpointer}; use ibus_sys::prop_list::{ibus_prop_list_append, ibus_pro...
rust
MIT
b7dace72e7ce2054a9daf6ba0e6aca008bb8926f
2026-01-04T19:35:02.740723Z
false
akaza-im/akaza
https://github.com/akaza-im/akaza/blob/b7dace72e7ce2054a9daf6ba0e6aca008bb8926f/ibus-akaza/src/ui/mod.rs
ibus-akaza/src/ui/mod.rs
pub mod prop_controller;
rust
MIT
b7dace72e7ce2054a9daf6ba0e6aca008bb8926f
2026-01-04T19:35:02.740723Z
false
akaza-im/akaza
https://github.com/akaza-im/akaza/blob/b7dace72e7ce2054a9daf6ba0e6aca008bb8926f/akaza-data/src/utils.rs
akaza-data/src/utils.rs
use chrono::Local; use std::fs; use std::path::{Path, PathBuf}; use walkdir::WalkDir; pub fn get_file_list(src_dir: &Path) -> anyhow::Result<Vec<PathBuf>> { let mut result: Vec<PathBuf> = Vec::new(); for src_file in WalkDir::new(src_dir) .into_iter() .filter_map(|file| file.ok()) .filt...
rust
MIT
b7dace72e7ce2054a9daf6ba0e6aca008bb8926f
2026-01-04T19:35:02.740723Z
false
akaza-im/akaza
https://github.com/akaza-im/akaza/blob/b7dace72e7ce2054a9daf6ba0e6aca008bb8926f/akaza-data/src/main.rs
akaza-data/src/main.rs
extern crate core; use std::io::Write; use clap::{Parser, Subcommand}; use crate::subcmd::check::check; use crate::subcmd::dump_bigram_dict::dump_bigram_dict; use crate::subcmd::dump_unigram_dict::dump_unigram_dict; use crate::subcmd::evaluate::evaluate; use crate::subcmd::learn_corpus::learn_corpus; use crate::subc...
rust
MIT
b7dace72e7ce2054a9daf6ba0e6aca008bb8926f
2026-01-04T19:35:02.740723Z
false
akaza-im/akaza
https://github.com/akaza-im/akaza/blob/b7dace72e7ce2054a9daf6ba0e6aca008bb8926f/akaza-data/src/wordcnt/wordcnt_bigram.rs
akaza-data/src/wordcnt/wordcnt_bigram.rs
use std::collections::HashMap; use anyhow::Result; use log::info; use libakaza::cost::calc_cost; use libakaza::lm::base::SystemBigramLM; use libakaza::search_result::SearchResult; use marisa_sys::{Keyset, Marisa}; /** * bigram 言語モデル。 * unigram の生成のときに得られた単語IDを利用することで、圧縮している。 */ #[derive(Default)] pub struct Wordc...
rust
MIT
b7dace72e7ce2054a9daf6ba0e6aca008bb8926f
2026-01-04T19:35:02.740723Z
false
akaza-im/akaza
https://github.com/akaza-im/akaza/blob/b7dace72e7ce2054a9daf6ba0e6aca008bb8926f/akaza-data/src/wordcnt/wordcnt_unigram.rs
akaza-data/src/wordcnt/wordcnt_unigram.rs
use std::collections::HashMap; use anyhow::Result; use log::info; use libakaza::cost::calc_cost; use libakaza::lm::base::SystemUnigramLM; use marisa_sys::{Keyset, Marisa}; /** * unigram 言語モデル。 * 「漢字/かな」に対して、発生確率スコアを保持している。 */ #[derive(Default)] pub struct WordcntUnigramBuilder { data: Vec<(String, u32)>, } i...
rust
MIT
b7dace72e7ce2054a9daf6ba0e6aca008bb8926f
2026-01-04T19:35:02.740723Z
false
akaza-im/akaza
https://github.com/akaza-im/akaza/blob/b7dace72e7ce2054a9daf6ba0e6aca008bb8926f/akaza-data/src/wordcnt/mod.rs
akaza-data/src/wordcnt/mod.rs
pub mod wordcnt_bigram; pub mod wordcnt_unigram;
rust
MIT
b7dace72e7ce2054a9daf6ba0e6aca008bb8926f
2026-01-04T19:35:02.740723Z
false
akaza-im/akaza
https://github.com/akaza-im/akaza/blob/b7dace72e7ce2054a9daf6ba0e6aca008bb8926f/akaza-data/src/subcmd/learn_corpus.rs
akaza-data/src/subcmd/learn_corpus.rs
use std::cell::RefCell; use std::collections::HashMap; use std::path::Path; use std::rc::Rc; use std::sync::{Arc, Mutex}; use encoding_rs::UTF_8; use log::{debug, info}; use crate::wordcnt::wordcnt_bigram::WordcntBigram; use crate::wordcnt::wordcnt_unigram::WordcntUnigram; use libakaza::corpus::{read_corpus_file, Ful...
rust
MIT
b7dace72e7ce2054a9daf6ba0e6aca008bb8926f
2026-01-04T19:35:02.740723Z
false
akaza-im/akaza
https://github.com/akaza-im/akaza/blob/b7dace72e7ce2054a9daf6ba0e6aca008bb8926f/akaza-data/src/subcmd/make_stats_system_bigram_lm.rs
akaza-data/src/subcmd/make_stats_system_bigram_lm.rs
use std::collections::HashMap; use std::fs::File; use std::io::{prelude::*, BufReader}; use std::path::{Path, PathBuf}; use anyhow::anyhow; use anyhow::Context; use anyhow::Result; use chrono::Local; use log::info; use rayon::prelude::*; use libakaza::lm::base::{SystemBigramLM, SystemUnigramLM}; use crate::utils::ge...
rust
MIT
b7dace72e7ce2054a9daf6ba0e6aca008bb8926f
2026-01-04T19:35:02.740723Z
false
akaza-im/akaza
https://github.com/akaza-im/akaza/blob/b7dace72e7ce2054a9daf6ba0e6aca008bb8926f/akaza-data/src/subcmd/make_dict.rs
akaza-data/src/subcmd/make_dict.rs
use std::collections::HashMap; use std::fs::File; use std::io::prelude::*; use std::path::Path; use anyhow::{bail, Result}; use encoding_rs::UTF_8; use log::info; use crate::utils::copy_snapshot; /// テキスト形式での辞書を作成する。 pub fn make_system_dict( txt_file: &str, vocab_file_path: Option<&str>, corpus_files: Ve...
rust
MIT
b7dace72e7ce2054a9daf6ba0e6aca008bb8926f
2026-01-04T19:35:02.740723Z
false
akaza-im/akaza
https://github.com/akaza-im/akaza/blob/b7dace72e7ce2054a9daf6ba0e6aca008bb8926f/akaza-data/src/subcmd/evaluate.rs
akaza-data/src/subcmd/evaluate.rs
use std::fs::File; use std::io::{BufRead, BufReader}; use std::time::SystemTime; use anyhow::Context; use log::info; use libakaza::config::{DictConfig, DictEncoding, DictType, DictUsage, EngineConfig}; use libakaza::engine::base::HenkanEngine; use libakaza::engine::bigram_word_viterbi_engine::BigramWordViterbiEngineB...
rust
MIT
b7dace72e7ce2054a9daf6ba0e6aca008bb8926f
2026-01-04T19:35:02.740723Z
false
akaza-im/akaza
https://github.com/akaza-im/akaza/blob/b7dace72e7ce2054a9daf6ba0e6aca008bb8926f/akaza-data/src/subcmd/check.rs
akaza-data/src/subcmd/check.rs
use std::fs::File; use std::io::Write; use std::sync::{Arc, Mutex}; use log::info; use libakaza::config::{DictConfig, DictEncoding, DictType, DictUsage, EngineConfig}; use libakaza::engine::bigram_word_viterbi_engine::BigramWordViterbiEngineBuilder; use libakaza::user_side_data::user_data::UserData; pub fn check( ...
rust
MIT
b7dace72e7ce2054a9daf6ba0e6aca008bb8926f
2026-01-04T19:35:02.740723Z
false
akaza-im/akaza
https://github.com/akaza-im/akaza/blob/b7dace72e7ce2054a9daf6ba0e6aca008bb8926f/akaza-data/src/subcmd/wfreq.rs
akaza-data/src/subcmd/wfreq.rs
use std::collections::{BTreeMap, HashMap}; use std::fs; use std::fs::File; use std::io::{BufRead, BufReader, Write}; use std::path::{Path, PathBuf}; use log::{info, trace, warn}; use rayon::prelude::*; use regex::Regex; use crate::utils::get_file_list; /// 単語の発生確率を数え上げる。 pub fn wfreq(src_dirs: &Vec<String>, dst_file...
rust
MIT
b7dace72e7ce2054a9daf6ba0e6aca008bb8926f
2026-01-04T19:35:02.740723Z
false
akaza-im/akaza
https://github.com/akaza-im/akaza/blob/b7dace72e7ce2054a9daf6ba0e6aca008bb8926f/akaza-data/src/subcmd/dump_bigram_dict.rs
akaza-data/src/subcmd/dump_bigram_dict.rs
use libakaza::lm::base::{SystemBigramLM, SystemUnigramLM}; use libakaza::lm::system_bigram::MarisaSystemBigramLM; use libakaza::lm::system_unigram_lm::MarisaSystemUnigramLM; use std::collections::HashMap; pub fn dump_bigram_dict(unigram_file: &str, bigram_file: &str) -> anyhow::Result<()> { let unigram = MarisaSys...
rust
MIT
b7dace72e7ce2054a9daf6ba0e6aca008bb8926f
2026-01-04T19:35:02.740723Z
false
akaza-im/akaza
https://github.com/akaza-im/akaza/blob/b7dace72e7ce2054a9daf6ba0e6aca008bb8926f/akaza-data/src/subcmd/dump_unigram_dict.rs
akaza-data/src/subcmd/dump_unigram_dict.rs
use libakaza::lm::base::SystemUnigramLM; use libakaza::lm::system_unigram_lm::MarisaSystemUnigramLM; pub fn dump_unigram_dict(filename: &str) -> anyhow::Result<()> { let dict = MarisaSystemUnigramLM::load(filename)?; let dict_map = dict.as_hash_map(); for yomi in dict_map.keys() { let (word_id, sco...
rust
MIT
b7dace72e7ce2054a9daf6ba0e6aca008bb8926f
2026-01-04T19:35:02.740723Z
false
akaza-im/akaza
https://github.com/akaza-im/akaza/blob/b7dace72e7ce2054a9daf6ba0e6aca008bb8926f/akaza-data/src/subcmd/make_stats_system_unigram_lm.rs
akaza-data/src/subcmd/make_stats_system_unigram_lm.rs
use std::cmp::max; use std::collections::HashMap; use std::fs::File; use std::io::{prelude::*, BufReader}; use crate::wordcnt::wordcnt_unigram::WordcntUnigramBuilder; /// 統計的かな漢字変換のためのユニグラムシステム言語モデルの作成 /// /// wfreq ファイルを開いてパースし、ユニグラム言語モデルファイルを作成して保存する。 pub fn make_stats_system_unigram_lm(srcpath: &str, dstpath: &str...
rust
MIT
b7dace72e7ce2054a9daf6ba0e6aca008bb8926f
2026-01-04T19:35:02.740723Z
false
akaza-im/akaza
https://github.com/akaza-im/akaza/blob/b7dace72e7ce2054a9daf6ba0e6aca008bb8926f/akaza-data/src/subcmd/mod.rs
akaza-data/src/subcmd/mod.rs
pub mod check; pub mod dump_bigram_dict; pub mod dump_unigram_dict; pub mod evaluate; pub mod learn_corpus; pub mod make_dict; pub mod make_stats_system_bigram_lm; pub mod make_stats_system_unigram_lm; pub mod tokenize; pub mod vocab; pub mod wfreq;
rust
MIT
b7dace72e7ce2054a9daf6ba0e6aca008bb8926f
2026-01-04T19:35:02.740723Z
false
akaza-im/akaza
https://github.com/akaza-im/akaza/blob/b7dace72e7ce2054a9daf6ba0e6aca008bb8926f/akaza-data/src/subcmd/tokenize.rs
akaza-data/src/subcmd/tokenize.rs
use std::fs; use std::path::Path; use anyhow::bail; use log::info; use rayon::prelude::*; use walkdir::WalkDir; use crate::corpus_reader::aozora_bunko::AozoraBunkoProcessor; use crate::corpus_reader::base::{write_success_file, CorpusReader}; use crate::corpus_reader::wikipedia_extracted::ExtractedWikipediaProcessor; ...
rust
MIT
b7dace72e7ce2054a9daf6ba0e6aca008bb8926f
2026-01-04T19:35:02.740723Z
false
akaza-im/akaza
https://github.com/akaza-im/akaza/blob/b7dace72e7ce2054a9daf6ba0e6aca008bb8926f/akaza-data/src/subcmd/vocab.rs
akaza-data/src/subcmd/vocab.rs
use std::fs; use std::fs::File; use std::io::{BufRead, BufReader, Write}; use log::{info, warn}; /// wfreq (単語の発生頻度表)から vocab (語彙ファイル)を作成する。 pub fn vocab(src_file: &str, dst_file: &str, threshold: u32) -> anyhow::Result<()> { info!( "vocab: {} => {}, threshold={}", src_file, dst_file, threshold ...
rust
MIT
b7dace72e7ce2054a9daf6ba0e6aca008bb8926f
2026-01-04T19:35:02.740723Z
false
akaza-im/akaza
https://github.com/akaza-im/akaza/blob/b7dace72e7ce2054a9daf6ba0e6aca008bb8926f/akaza-data/src/tokenizer/base.rs
akaza-data/src/tokenizer/base.rs
pub trait AkazaTokenizer { fn tokenize(&self, src: &str, kana_preferred: bool) -> anyhow::Result<String>; } /// マージ処理に利用する為の中間表現 #[derive(Debug)] pub(crate) struct IntermediateToken { surface: String, yomi: String, hinshi: String, subhinshi: String, subsubhinshi: String, } impl IntermediateTok...
rust
MIT
b7dace72e7ce2054a9daf6ba0e6aca008bb8926f
2026-01-04T19:35:02.740723Z
false
akaza-im/akaza
https://github.com/akaza-im/akaza/blob/b7dace72e7ce2054a9daf6ba0e6aca008bb8926f/akaza-data/src/tokenizer/vibrato.rs
akaza-data/src/tokenizer/vibrato.rs
use std::fs::File; use std::time::SystemTime; use anyhow::Context; use kelp::{kata2hira, ConvOption}; use log::info; use vibrato::{Dictionary, Tokenizer}; use crate::tokenizer::base::{merge_terms_ipadic, AkazaTokenizer, IntermediateToken}; pub struct VibratoTokenizer { tokenizer: Tokenizer, } impl VibratoTokeni...
rust
MIT
b7dace72e7ce2054a9daf6ba0e6aca008bb8926f
2026-01-04T19:35:02.740723Z
false
akaza-im/akaza
https://github.com/akaza-im/akaza/blob/b7dace72e7ce2054a9daf6ba0e6aca008bb8926f/akaza-data/src/tokenizer/mod.rs
akaza-data/src/tokenizer/mod.rs
#![allow(dead_code)] pub mod base; pub mod vibrato;
rust
MIT
b7dace72e7ce2054a9daf6ba0e6aca008bb8926f
2026-01-04T19:35:02.740723Z
false
akaza-im/akaza
https://github.com/akaza-im/akaza/blob/b7dace72e7ce2054a9daf6ba0e6aca008bb8926f/akaza-data/src/corpus_reader/wikipedia_extracted.rs
akaza-data/src/corpus_reader/wikipedia_extracted.rs
use std::fs::File; use std::io::{BufRead, BufReader, Write}; use std::path::Path; use anyhow::Context; use regex::Regex; use crate::corpus_reader::base::CorpusReader; /// wikiextractor で処理したデータを取り扱うための処理 pub struct ExtractedWikipediaProcessor { alnum_pattern: Regex, yomigana_pattern: Regex, } impl Extracted...
rust
MIT
b7dace72e7ce2054a9daf6ba0e6aca008bb8926f
2026-01-04T19:35:02.740723Z
false
akaza-im/akaza
https://github.com/akaza-im/akaza/blob/b7dace72e7ce2054a9daf6ba0e6aca008bb8926f/akaza-data/src/corpus_reader/base.rs
akaza-data/src/corpus_reader/base.rs
use std::fs::File; use std::io::Write; use std::path::Path; pub trait CorpusReader { fn process_file<F>(&self, ifname: &Path, ofname: &Path, annotate: &mut F) -> anyhow::Result<()> where F: FnMut(&str) -> anyhow::Result<String>; } /// _SUCCESS ファイルを書く pub fn write_success_file(dst_dir: &Path) -> anyho...
rust
MIT
b7dace72e7ce2054a9daf6ba0e6aca008bb8926f
2026-01-04T19:35:02.740723Z
false
akaza-im/akaza
https://github.com/akaza-im/akaza/blob/b7dace72e7ce2054a9daf6ba0e6aca008bb8926f/akaza-data/src/corpus_reader/aozora_bunko.rs
akaza-data/src/corpus_reader/aozora_bunko.rs
use std::fs::File; use std::io::{Read, Write}; use std::path::Path; use anyhow::Context; use encoding_rs::SHIFT_JIS; use log::info; use regex::{Regex, RegexBuilder}; use crate::corpus_reader::base::CorpusReader; /// wikiextractor で処理したデータを取り扱うための処理 pub struct AozoraBunkoProcessor { alnum_pattern: Regex, yomi...
rust
MIT
b7dace72e7ce2054a9daf6ba0e6aca008bb8926f
2026-01-04T19:35:02.740723Z
false
akaza-im/akaza
https://github.com/akaza-im/akaza/blob/b7dace72e7ce2054a9daf6ba0e6aca008bb8926f/akaza-data/src/corpus_reader/mod.rs
akaza-data/src/corpus_reader/mod.rs
pub mod aozora_bunko; pub mod base; pub mod wikipedia_extracted;
rust
MIT
b7dace72e7ce2054a9daf6ba0e6aca008bb8926f
2026-01-04T19:35:02.740723Z
false
akaza-im/akaza
https://github.com/akaza-im/akaza/blob/b7dace72e7ce2054a9daf6ba0e6aca008bb8926f/libakaza/src/config.rs
libakaza/src/config.rs
/* --- dicts: - path: /usr/share/skk/SKK-JISYO.okinawa encoding: euc-jp dict_type: skk */ use std::fmt::Display; use std::fmt::Formatter; use std::fs::File; use std::io::{BufReader, Write}; use std::path::PathBuf; use anyhow::{bail, Result}; use log::{info, warn}; use serde::{Deserialize, Serialize}; use D...
rust
MIT
b7dace72e7ce2054a9daf6ba0e6aca008bb8926f
2026-01-04T19:35:02.740723Z
false
akaza-im/akaza
https://github.com/akaza-im/akaza/blob/b7dace72e7ce2054a9daf6ba0e6aca008bb8926f/libakaza/src/resource.rs
libakaza/src/resource.rs
use std::env; use anyhow::{bail, Context}; pub fn detect_resource_path(base: &str, name: &str) -> anyhow::Result<String> { let pathstr: String = if cfg!(test) { format!("{}/../{}/{}", env!("CARGO_MANIFEST_DIR"), base, name) } else { let target_path = format!("{base}/{name}"); let based...
rust
MIT
b7dace72e7ce2054a9daf6ba0e6aca008bb8926f
2026-01-04T19:35:02.740723Z
false
akaza-im/akaza
https://github.com/akaza-im/akaza/blob/b7dace72e7ce2054a9daf6ba0e6aca008bb8926f/libakaza/src/kansuji.rs
libakaza/src/kansuji.rs
use std::cmp::min; const NUMS: [&str; 10] = ["", "一", "二", "三", "四", "五", "六", "七", "八", "九"]; const SUBS: [&str; 4] = ["", "十", "百", "千"]; const PARTS: [&str; 18] = [ "", "万", "億", "兆", "京", "垓", "𥝱", "穣", "溝", "澗", "正", "載", "極", "恒河沙", "阿僧祇", "那由他", ...
rust
MIT
b7dace72e7ce2054a9daf6ba0e6aca008bb8926f
2026-01-04T19:35:02.740723Z
false
akaza-im/akaza
https://github.com/akaza-im/akaza/blob/b7dace72e7ce2054a9daf6ba0e6aca008bb8926f/libakaza/src/lib.rs
libakaza/src/lib.rs
#![allow(dead_code)] extern crate core; pub mod config; pub mod consonant; pub mod corpus; pub mod cost; pub mod dict; pub mod engine; pub mod extend_clause; pub mod graph; pub mod kana_kanji; pub mod kana_trie; pub mod kansuji; pub mod keymap; pub mod lm; mod resource; pub mod romkan; pub mod search_result; pub mod ...
rust
MIT
b7dace72e7ce2054a9daf6ba0e6aca008bb8926f
2026-01-04T19:35:02.740723Z
false
akaza-im/akaza
https://github.com/akaza-im/akaza/blob/b7dace72e7ce2054a9daf6ba0e6aca008bb8926f/libakaza/src/romkan.rs
libakaza/src/romkan.rs
use std::collections::HashMap; use std::fs::File; use std::io::BufReader; use crate::resource::detect_resource_path; use anyhow::Context; use log::info; use regex::{Captures, Regex}; use serde::{Deserialize, Serialize}; #[derive(Serialize, Deserialize, PartialEq, Debug)] pub struct RomKanConfig { mapping: HashMap...
rust
MIT
b7dace72e7ce2054a9daf6ba0e6aca008bb8926f
2026-01-04T19:35:02.740723Z
false
akaza-im/akaza
https://github.com/akaza-im/akaza/blob/b7dace72e7ce2054a9daf6ba0e6aca008bb8926f/libakaza/src/consonant.rs
libakaza/src/consonant.rs
/// hogen と入力された場合、"ほげn" と表示する。 /// hogena となったら "ほげな" /// hogenn となったら "ほげん" と表示する必要があるため。 /// 「ん」と一旦表示された後に「な」に変化したりすると気持ち悪く感じる。 /// "meny" のときは "めny" と表示すべき。 use regex::Regex; #[derive(Debug)] pub struct ConsonantSuffixExtractor { pattern: Regex, } impl Default for ConsonantSuffixExtractor { fn default() -...
rust
MIT
b7dace72e7ce2054a9daf6ba0e6aca008bb8926f
2026-01-04T19:35:02.740723Z
false
akaza-im/akaza
https://github.com/akaza-im/akaza/blob/b7dace72e7ce2054a9daf6ba0e6aca008bb8926f/libakaza/src/search_result.rs
libakaza/src/search_result.rs
#[derive(Debug, Clone)] pub struct SearchResult { pub keyword: Vec<u8>, pub id: usize, }
rust
MIT
b7dace72e7ce2054a9daf6ba0e6aca008bb8926f
2026-01-04T19:35:02.740723Z
false
akaza-im/akaza
https://github.com/akaza-im/akaza/blob/b7dace72e7ce2054a9daf6ba0e6aca008bb8926f/libakaza/src/cost.rs
libakaza/src/cost.rs
// 加算スムージング用の定数。 const ALPHA: f32 = 0.00001; /// 単語/エッジのコストを計算する。 /// 加算スムージングしている。 /// /// - `count`: その単語の出現回数, n(w) /// - `total_words`: コーパス中の単語の総出現回数, `C` /// - `unique_words`: 語彙数, `V` pub fn calc_cost(count: u32, total_words: u32, unique_words: u32) -> f32 { -f32::log10( ((count as f32) + ALPHA) // ...
rust
MIT
b7dace72e7ce2054a9daf6ba0e6aca008bb8926f
2026-01-04T19:35:02.740723Z
false
akaza-im/akaza
https://github.com/akaza-im/akaza/blob/b7dace72e7ce2054a9daf6ba0e6aca008bb8926f/libakaza/src/keymap.rs
libakaza/src/keymap.rs
use std::collections::HashMap; use std::fs::File; use std::io::BufReader; use crate::resource::detect_resource_path; use anyhow::{bail, Context, Result}; use log::info; use serde::{Deserialize, Serialize}; #[derive(Serialize, Deserialize, Debug, PartialEq)] pub struct Keymap { pub extends: Option<String>, pub...
rust
MIT
b7dace72e7ce2054a9daf6ba0e6aca008bb8926f
2026-01-04T19:35:02.740723Z
false
akaza-im/akaza
https://github.com/akaza-im/akaza/blob/b7dace72e7ce2054a9daf6ba0e6aca008bb8926f/libakaza/src/extend_clause.rs
libakaza/src/extend_clause.rs
use log::info; use std::ops::Range; use crate::graph::candidate::Candidate; // 現状維持するための文節データを返します。 fn keep_current(clauses: &[Vec<Candidate>]) -> Vec<Range<usize>> { let mut force_selected_clause: Vec<Range<usize>> = Vec::new(); let mut offset = 0; for yomi_len in clauses.iter().map(|f| f[0].yomi.len()) ...
rust
MIT
b7dace72e7ce2054a9daf6ba0e6aca008bb8926f
2026-01-04T19:35:02.740723Z
false
akaza-im/akaza
https://github.com/akaza-im/akaza/blob/b7dace72e7ce2054a9daf6ba0e6aca008bb8926f/libakaza/src/corpus.rs
libakaza/src/corpus.rs
use std::collections::HashSet; use std::fs::File; use std::io::{BufRead, BufReader}; use std::path::Path; use anyhow::{bail, Result}; use log::info; use crate::graph::word_node::WordNode; /// フルアノテーションコーパス /// Kytea のフルアノテーションコーパスと同様の形式です。 /// /// コーパス/こーぱす の/の 文/ぶん で/で す/す 。/。 /// /// ↑のような形式です。 /// /// 品詞を取り扱うのは素人...
rust
MIT
b7dace72e7ce2054a9daf6ba0e6aca008bb8926f
2026-01-04T19:35:02.740723Z
false
akaza-im/akaza
https://github.com/akaza-im/akaza/blob/b7dace72e7ce2054a9daf6ba0e6aca008bb8926f/libakaza/src/dict/merge_dict.rs
libakaza/src/dict/merge_dict.rs
use std::collections::HashMap; pub fn merge_dict(dicts: Vec<HashMap<String, Vec<String>>>) -> HashMap<String, Vec<String>> { let mut result: HashMap<String, Vec<String>> = HashMap::new(); for dict in dicts { for (yomi, kanjis) in dict { let target = result.entry(yomi).or_default(); ...
rust
MIT
b7dace72e7ce2054a9daf6ba0e6aca008bb8926f
2026-01-04T19:35:02.740723Z
false
akaza-im/akaza
https://github.com/akaza-im/akaza/blob/b7dace72e7ce2054a9daf6ba0e6aca008bb8926f/libakaza/src/dict/mod.rs
libakaza/src/dict/mod.rs
pub mod loader; pub mod merge_dict; pub mod skk;
rust
MIT
b7dace72e7ce2054a9daf6ba0e6aca008bb8926f
2026-01-04T19:35:02.740723Z
false
akaza-im/akaza
https://github.com/akaza-im/akaza/blob/b7dace72e7ce2054a9daf6ba0e6aca008bb8926f/libakaza/src/dict/loader.rs
libakaza/src/dict/loader.rs
use std::collections::HashMap; use std::fs::File; use std::path::Path; use std::time::SystemTime; use anyhow::Context; use anyhow::Result; use encoding_rs::{EUC_JP, UTF_8}; use log::{error, info}; use crate::config::{DictConfig, DictEncoding, DictType}; use crate::dict::merge_dict::merge_dict; use crate::dict::skk::r...
rust
MIT
b7dace72e7ce2054a9daf6ba0e6aca008bb8926f
2026-01-04T19:35:02.740723Z
false
akaza-im/akaza
https://github.com/akaza-im/akaza/blob/b7dace72e7ce2054a9daf6ba0e6aca008bb8926f/libakaza/src/dict/skk/write.rs
libakaza/src/dict/skk/write.rs
use std::collections::HashMap; use std::fs::File; use std::io::Write; use log::info; use crate::dict::merge_dict::merge_dict; pub fn write_skk_dict( ofname: &str, dicts: Vec<HashMap<String, Vec<String>>>, ) -> anyhow::Result<()> { info!("Writing {}", ofname); let merged_dict = merge_dict(dicts); ...
rust
MIT
b7dace72e7ce2054a9daf6ba0e6aca008bb8926f
2026-01-04T19:35:02.740723Z
false
akaza-im/akaza
https://github.com/akaza-im/akaza/blob/b7dace72e7ce2054a9daf6ba0e6aca008bb8926f/libakaza/src/dict/skk/mod.rs
libakaza/src/dict/skk/mod.rs
pub mod ari2nasi; pub mod read; pub mod write;
rust
MIT
b7dace72e7ce2054a9daf6ba0e6aca008bb8926f
2026-01-04T19:35:02.740723Z
false
akaza-im/akaza
https://github.com/akaza-im/akaza/blob/b7dace72e7ce2054a9daf6ba0e6aca008bb8926f/libakaza/src/dict/skk/read.rs
libakaza/src/dict/skk/read.rs
use std::collections::HashMap; use std::fs::File; use std::io::{BufReader, Read}; use std::path::Path; use anyhow::{Context, Result}; use encoding_rs::Encoding; use log::info; use regex::Regex; use crate::dict::merge_dict::merge_dict; use crate::dict::skk::ari2nasi::Ari2Nasi; enum ParserState { OkuriAri, Oku...
rust
MIT
b7dace72e7ce2054a9daf6ba0e6aca008bb8926f
2026-01-04T19:35:02.740723Z
false
akaza-im/akaza
https://github.com/akaza-im/akaza/blob/b7dace72e7ce2054a9daf6ba0e6aca008bb8926f/libakaza/src/dict/skk/ari2nasi.rs
libakaza/src/dict/skk/ari2nasi.rs
use std::collections::HashMap; use anyhow::bail; pub struct Ari2Nasi { boin_map: HashMap<char, &'static str>, roman_map: HashMap<&'static str, &'static str>, } impl Default for Ari2Nasi { fn default() -> Ari2Nasi { let boin_map = HashMap::from([ ('a', "あ"), ('i', "い"), ...
rust
MIT
b7dace72e7ce2054a9daf6ba0e6aca008bb8926f
2026-01-04T19:35:02.740723Z
false
akaza-im/akaza
https://github.com/akaza-im/akaza/blob/b7dace72e7ce2054a9daf6ba0e6aca008bb8926f/libakaza/src/graph/segmenter.rs
libakaza/src/graph/segmenter.rs
use std::collections::btree_map::{BTreeMap, Iter}; use std::collections::HashSet; use std::ops::Range; use std::sync::{Arc, Mutex}; use log::{debug, info, trace}; use regex::Regex; use crate::kana_trie::base::KanaTrie; #[derive(PartialEq, Debug)] pub struct SegmentationResult { base: BTreeMap<usize, Vec<String>>...
rust
MIT
b7dace72e7ce2054a9daf6ba0e6aca008bb8926f
2026-01-04T19:35:02.740723Z
false