Move FastCover parameter validation, corpus preparation, optimization, and dictionary training into Rust. Retain the C source as a static-linking ABI anchor and register the implementation with the compression dictionary-builder feature set. Test Plan: - rustfmt +nightly --check --edition 2021 rust/src/dict_builder_fastcover.rs rust/src/lib.rs - RUSTC_WRAPPER= CARGO_BUILD_RUSTC_WRAPPER= cargo clippy --manifest-path rust/Cargo.toml --all-targets --no-default-features --features compression,dict-builder -- -D warnings - FastCover focused Rust tests and deterministic C-reference harness - git diff --cached --check
22 lines
735 B
C
22 lines
735 B
C
/*
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under both the BSD-style license (found in the
|
|
* LICENSE file in the root directory of this source tree) and the GPLv2 (found
|
|
* in the COPYING file in the root directory of this source tree).
|
|
* You may select, at your option, one of the above-listed licenses.
|
|
*/
|
|
|
|
/*
|
|
* FastCOVER is implemented by rust/src/dict_builder_fastcover.rs. Keep this
|
|
* translation unit so existing C build descriptions continue to include the
|
|
* public static-only declarations while the Rust static library supplies the
|
|
* symbols.
|
|
*/
|
|
#ifndef ZDICT_STATIC_LINKING_ONLY
|
|
# define ZDICT_STATIC_LINKING_ONLY
|
|
#endif
|
|
|
|
#include "../zdict.h"
|