Skip to content

Commit

Permalink
Implement a simple graph
Browse files Browse the repository at this point in the history
using a vector and a map to keep the nodes and the edges
  • Loading branch information
egli committed Dec 23, 2024
1 parent 59dd59d commit 068167a
Show file tree
Hide file tree
Showing 2 changed files with 536 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/translator.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
use std::collections::{HashMap, HashSet};

use trie::Trie;
use graph::Graph;

use crate::parser::{dots_to_unicode, fallback, AnchoredRule, Attribute, Braille, Direction, Rule};

use self::trie::Boundary;
use self::graph::Boundary;

mod boundaries;
mod graph;
mod trie;

#[derive(thiserror::Error, Debug, PartialEq)]
Expand Down Expand Up @@ -158,7 +159,7 @@ pub struct TranslationTable {
undefined: Option<String>,
character_definitions: CharacterDefinition,
character_attributes: CharacterAttributes,
translations: Trie,
translations: Graph,
direction: Direction,
}

Expand All @@ -170,7 +171,7 @@ impl TranslationTable {
let mut undefined = None;
let mut character_definitions = CharacterDefinition::new();
let mut character_attributes = CharacterAttributes::new();
let mut translations = Trie::new();
let mut translations = Graph::new();

let rules: Vec<AnchoredRule> = rules
.into_iter()
Expand Down
Loading

0 comments on commit 068167a

Please sign in to comment.