-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(airport, aircraft): split core and search
- more idiomatic custom aircraft and search - cross-column suggestions for airport and aircraft - add tests - generalise queue suggestions to utils
- Loading branch information
1 parent
49a663f
commit 46a2b64
Showing
14 changed files
with
1,071 additions
and
569 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
use am4::aircraft::search::Aircrafts; | ||
// use am4::airport::Airports; | ||
// use std::rc::Rc; | ||
// use am4::airport::search::Airports; | ||
|
||
// NOTE: directory is CWD, not the location of the executable. | ||
fn main() { | ||
// NOTE: directory is CWD, not the location of the executable. | ||
// let airports = Airports::from_csv("am4/data/airports.csv").unwrap(); | ||
// println!("{:#?}", airports); | ||
// let index = airports.indexed(); | ||
|
||
// let a1 = airports.search("iata:hkgA"); | ||
// let suggestions = airports.suggest("iata:hkgA"); | ||
// println!("{:#?}", index.search("iata:hkg")); | ||
// println!("{:#?}", index.suggest("vhhx")); | ||
|
||
// println!("{:#?}", suggestions) | ||
// let maxln = airports.data.iter().max_by_key(|a| a.name.0.len()).unwrap(); | ||
// println!("{:#?}", maxln.name.0.len()); | ||
|
||
let binding = Aircrafts::from_csv("am4/data/aircrafts.csv").unwrap(); | ||
let aircrafts = binding.indexed(); | ||
println!("{:#?}", aircrafts.search("a388[s]")); | ||
println!("{:#?}", aircrafts.search("a388")); | ||
let aircrafts = Aircrafts::from_csv("am4/data/aircrafts.csv").unwrap(); | ||
let index = aircrafts.indexed(); | ||
// println!("{:#?}", index.search("name:B747-4000")); | ||
println!("{:#?}", index.suggest("shortname:b7440")); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.