fix noca (2)

This commit is contained in:
Tove 2025-06-28 21:12:05 +02:00
parent b4610e4f50
commit 46a9c4ac53
4 changed files with 15 additions and 2 deletions

2
Cargo.lock generated
View file

@ -4,4 +4,4 @@ version = 4
[[package]]
name = "polyparse"
version = "0.4.1"
version = "0.4.2"

View file

@ -2,7 +2,7 @@
name = "polyparse"
description = "polyphasic schedule parser"
license = "AGPL-3.0"
version = "0.4.1"
version = "0.4.2"
edition = "2021"
[dependencies]

11
examples/get_long.rs Normal file
View file

@ -0,0 +1,11 @@
use polyparse::naming::*;
use polyparse::Schedule;
use std::env::args;
fn main() {
let Some(s) = args().skip(1).next() else {
panic!("no schedule given. give an argument!");
};
let sched = Schedule::from_ident(&s).map(|x| x.long_id(&Polyinfo));
println!("{}", sched.unwrap_or("Invalid".to_owned()));
}

View file

@ -97,6 +97,8 @@ impl ScheduleKind {
|| s.starts_with("NO")
|| s.starts_with("NAPONLY"))
&& !s.starts_with("UN")
&& !s.starts_with("NOCA")
&& !s.starts_with("NCA")
{
return Some(Coreless(
Self::detect_naps(&s_orig).unwrap_or(N(if s.starts_with("TES") { 4 } else { 6 })),