data CorpusParser =
- Wos {_wos_limit :: Int}
- | Csv {_csv_limit :: Int}
- | CsvWeighted {_csvw_limit :: Int}
+ Wos {_wos_limit :: Int}
+ | Csv {_csv_limit :: Int}
+ | Csv' {_csv'_limit :: Int}
deriving (Show,Generic,Eq)
data SeaElevation =
{ _year_period :: Int
, _year_step :: Int
, _year_matchingFrame :: Int }
+ | Month
+ { _month_period :: Int
+ , _month_step :: Int
+ , _month_matchingFrame :: Int }
+ | Week
+ { _week_period :: Int
+ , _week_step :: Int
+ , _week_matchingFrame :: Int }
+ | Day
+ { _day_period :: Int
+ , _day_step :: Int
+ , _day_matchingFrame :: Int }
deriving (Show,Generic,Eq)
data CliqueFilter = ByThreshold | ByNeighbours deriving (Show,Generic,Eq)
-- | Ngrams : a contiguous sequence of n terms
type Ngrams = Text
--- | Document : a piece of Text linked to a Date
+-- Document : a piece of Text linked to a Date
+-- date = computational date; date' = original string date yyyy-mm-dd
data Document = Document
- { date :: Date
- , text :: [Ngrams]
- , weight :: Maybe Double
+ { date :: Date
+ , date' :: Text
+ , text :: [Ngrams]
+ , weight :: Maybe Double
+ , sources :: [Text]
} deriving (Eq,Show,Generic,NFData)
} deriving (Generic, Show, Eq)
+data PhyloSources = PhyloSources
+ { _sources :: !(Vector Text) } deriving (Generic, Show, Eq)
+
+
---------------------------
-- | Coocurency Matrix | --
---------------------------
-- periods : the temporal steps of a phylomemy
data Phylo =
Phylo { _phylo_foundations :: PhyloFoundations
+ , _phylo_sources :: PhyloSources
, _phylo_timeCooc :: !(Map Date Cooc)
, _phylo_timeDocs :: !(Map Date Double)
, _phylo_termFreq :: !(Map Int Double)
-- id: tuple (start date, end date) of the temporal step of the phylomemy
-- levels: levels of granularity
data PhyloPeriod =
- PhyloPeriod { _phylo_periodPeriod :: (Date,Date)
- , _phylo_periodLevels :: Map PhyloLevelId PhyloLevel
+ PhyloPeriod { _phylo_periodPeriod :: (Date,Date)
+ , _phylo_periodPeriod' :: (Text,Text)
+ , _phylo_periodLevels :: Map PhyloLevelId PhyloLevel
} deriving (Generic, Show, Eq)
-- Level 1: First level of clustering (the Fis)
-- Level [2..N]: Nth level of synchronic clustering (cluster of Fis)
data PhyloLevel =
- PhyloLevel { _phylo_levelPeriod :: (Date,Date)
- , _phylo_levelLevel :: Level
- , _phylo_levelGroups :: Map PhyloGroupId PhyloGroup
+ PhyloLevel { _phylo_levelPeriod :: (Date,Date)
+ , _phylo_levelPeriod' :: (Text,Text)
+ , _phylo_levelLevel :: Level
+ , _phylo_levelGroups :: Map PhyloGroupId PhyloGroup
}
deriving (Generic, Show, Eq)
-- | PhyloGroup : group of ngrams at each level and period
data PhyloGroup =
PhyloGroup { _phylo_groupPeriod :: (Date,Date)
+ , _phylo_groupPeriod' :: (Text,Text)
, _phylo_groupLevel :: Level
- , _phylo_groupIndex :: Int
+ , _phylo_groupIndex :: Int
, _phylo_groupLabel :: Text
, _phylo_groupSupport :: Support
, _phylo_groupWeight :: Maybe Double
+ , _phylo_groupSources :: [Int]
, _phylo_groupNgrams :: [Int]
, _phylo_groupCooc :: !(Cooc)
, _phylo_groupBranchId :: PhyloBranchId
, _phyloClique_support :: Support
, _phyloClique_period :: (Date,Date)
, _phyloClique_weight :: Maybe Double
+ , _phyloClique_sources :: [Int]
} deriving (Generic,NFData,Show,Eq)
----------------
instance FromJSON Phylo
instance ToJSON Phylo
+instance FromJSON PhyloSources
+instance ToJSON PhyloSources
instance FromJSON PhyloParam
instance ToJSON PhyloParam
instance FromJSON PhyloPeriod