<commit_before>{-# LANGUAGE FlexibleInstances #-}
{- | This module provides implementations of different kinds of syntax trees
-}
module Muste.Tree.Internal where
       -- (MetaTTree(..),TTree(..),LTree(..),Path,Pos,TreeC(..),Cost(..),getTreeCat,prune,generate,match,ttreeToGFAbsTree,gfAbsTreeToTTree,ttreeToLTree,makeMeta,replaceNodeByMeta,typecheck,getChildCats) where
--module Tree (MetaTTree(..),TTree(..),LTree(..),Path,Pos,TreeC(..),getTreeCat,prune,generate,ttreeToGFAbsTree,gfAbsTreeToTTree,ttreeToLTree,makeMeta) where
import PGF hiding (showType)
import PGF.Internal hiding (showType)
import Data.Maybe
import Data.List
import Data.Set (Set,toList,fromList,empty)
import qualified Data.Set as Set
import Data.Ord
import Muste.Grammar
import Debug.Trace

-- | Generic class for trees
class TreeC t where
  showTree :: t -> String
  selectNode :: t -> Path -> Maybe t
  selectBranch :: t -> Int -> Maybe t

-- | Cost for matching two meta trees
type Cost = Int

-- | Position in a path
type Pos = Int

-- | Path in a tree
type Path = [Pos]<commit_msg>some fixes in the header<commit_after>{-# LANGUAGE FlexibleInstances #-}
{- | This module provides implementations of different kinds of syntax trees
-}
module Muste.Tree.Internal where
import PGF hiding (showType,checkType)
import PGF.Internal hiding (showType)
import Data.Maybe
import Data.List
import Data.Set (Set,toList,fromList,empty)
import qualified Data.Set as Set
import Data.Ord
import Muste.Grammar
import Debug.Trace

-- | Generic class for trees
class TreeC t where
  showTree :: t -> String
  selectNode :: t -> Path -> Maybe t
  selectBranch :: t -> Int -> Maybe t

-- | Cost for matching two meta trees
type Cost = Int

-- | Position in a path
type Pos = Int

-- | Path in a tree
type Path = [Pos]
{'fraction_non_alphanumeric': 0.11605633802816902, 'fraction_numerical': 0.0, 'mean_word_length': 4.365558912386707, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7519748', 'n_tokens_mistral': 570, 'n_tokens_neox': 562, 'n_words': 181}