From 8c83df7219e207a63858c2b199cae5e4e835bd2d Mon Sep 17 00:00:00 2001 From: Dale Wahl Date: Tue, 29 Aug 2023 09:53:34 +0200 Subject: [PATCH] add to lowercase to user_hashtag_network processor fixes https://github.com/digitalmethodsinitiative/4cat/issues/347 --- processors/networks/user_hashtag_network.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/processors/networks/user_hashtag_network.py b/processors/networks/user_hashtag_network.py index c438c38b2..318571d91 100644 --- a/processors/networks/user_hashtag_network.py +++ b/processors/networks/user_hashtag_network.py @@ -2,6 +2,8 @@ Generate bipartite user-hashtag graph of posts """ from backend.lib.preset import ProcessorPreset +from common.lib.user_input import UserInput + __author__ = "Stijn Peeters" __credits__ = ["Stijn Peeters"] @@ -19,6 +21,17 @@ class HashtagUserBipartiteGrapherPreset(ProcessorPreset): description = "Produces a bipartite graph based on co-occurence of (hash)tags and people. If someone wrote a post with a certain tag, there will be a link between that person and the tag. The more often they appear together, the stronger the link. Tag nodes are weighed on how often they occur. User nodes are weighed on how many posts they've made." # description displayed in UI extension = "gexf" # extension of result file, used internally and in UI + @classmethod + def get_options(cls, parent_dataset=None, user=None): + return { + "to-lowercase": { + "type": UserInput.OPTION_TOGGLE, + "default": False, + "help": "Convert values to lowercase", + "tooltip": "Merges values with varying cases" + } + } + @classmethod def is_compatible_with(cls, module=None, user=None): """ @@ -58,7 +71,8 @@ def get_processor_pipeline(self): "directed": False, "split-comma": True, "categorise": True, - "allow-loops": False + "allow-loops": False, + "to-lowercase": self.parameters.get("to-lowercase", False), } } ]