| Crates.io | legalis-porting |
| lib.rs | legalis-porting |
| version | 0.1.3 |
| created_at | 2026-01-05 07:32:10.717842+00 |
| updated_at | 2026-01-21 04:01:38.156992+00 |
| description | Legal system porting - transfer laws between jurisdictions with cultural adaptation |
| homepage | https://github.com/cool-japan/legalis |
| repository | https://github.com/cool-japan/legalis |
| max_upload_size | |
| id | 2023305 |
| size | 1,025,265 |
Cross-jurisdiction statute porting for Legalis-RS.
legalis-porting enables translation and adaptation of legal statutes between different jurisdictions, handling cultural and legal system differences.
use legalis_porting::{PortingEngine, PortingOptions};
use legalis_i18n::{Jurisdiction, Locale, CulturalParams, LegalSystem};
use legalis_core::{Statute, Effect, EffectType};
// Create source and target jurisdictions
let us_jurisdiction = Jurisdiction::new("US", "United States", Locale::new("en").with_country("US"))
.with_legal_system(LegalSystem::CommonLaw)
.with_cultural_params(CulturalParams::for_country("US"));
let jp_jurisdiction = Jurisdiction::new("JP", "Japan", Locale::new("ja").with_country("JP"))
.with_legal_system(LegalSystem::CivilLaw)
.with_cultural_params(CulturalParams::japan());
// Create porting engine
let engine = PortingEngine::new(us_jurisdiction, jp_jurisdiction);
// Create a statute
let statute = Statute::new(
"adult-rights",
"Adult Rights Act",
Effect::new(EffectType::Grant, "Full legal capacity"),
);
// Configure porting options
let options = PortingOptions {
apply_cultural_params: true,
translate_terms: true,
generate_report: true,
..Default::default()
};
// Port the statute
let ported = engine.port_statute(&statute, &options)?;
// Review changes
for change in &ported.changes {
println!(" - {:?}: {}", change.change_type, change.description);
}
// Generate compatibility report
let report = engine.generate_report(&[statute]);
println!("Compatibility score: {:.1}%", report.compatibility_score * 100.0);
| Score | Level | Description |
|---|---|---|
| 90-100% | High | Direct port possible |
| 70-89% | Medium | Minor adaptations needed |
| 50-69% | Low | Significant changes required |
| <50% | Incompatible | Manual review required |
# Port statute to different jurisdiction
legalis port input.legalis --target JP
# Generate compatibility report
legalis port input.legalis --target JP --format report
MIT OR Apache-2.0