Skip to content

Commit

Permalink
More vote -> reaction
Browse files Browse the repository at this point in the history
  • Loading branch information
sofvanh committed Jan 14, 2025
1 parent f39f0ea commit 500ee6e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions backend/src/analysis/argumentPriorityHandler.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Score } from "../.shared/types";
import { analyzeVotes } from "./reactionAnalyzer";
import { analyzeReactions } from "./reactionAnalyzer";
import { getArgumentScores } from "./argumentScoreHandler";
import { ReactionForGraph, getReactionsForGraph } from "../db/operations/reactionOperations";
import { getArgumentIdsByGraphId } from "../db/operations/argumentOperations";
Expand All @@ -14,7 +14,7 @@ async function getUniquenessScores(userId: string, graphId: string): Promise<Map
userIndexMap,
argumentIndexMap,
uniquenessMatrix
} = await analyzeVotes(graphId);
} = await analyzeReactions(graphId);

const userIndex = userIndexMap.get(userId);
if (!userIndex) {
Expand Down
4 changes: 2 additions & 2 deletions backend/src/analysis/argumentScoreHandler.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Score } from "../.shared/types";
import { analyzeVotes } from "./reactionAnalyzer";
import { analyzeReactions } from "./reactionAnalyzer";

function getConsensusScore(argumentIndex: number,
votingMatrix: number[][],
Expand Down Expand Up @@ -131,7 +131,7 @@ export async function getArgumentScores(graphId: string): Promise<Map<string, Sc
sum_pos_neg,
sum_neg_pos,
sum_neg_neg,
} = await analyzeVotes(graphId);
} = await analyzeReactions(graphId);

// Calculate the argument scores for each argument
const argumentScores: Map<string, Score> = new Map();
Expand Down
4 changes: 2 additions & 2 deletions backend/src/analysis/reactionAnalyzer.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ReactionForGraph, getReactionsForGraph } from "../db/operations/reactionOperations";
import { cosineSimilarityMatrix, computeAllSums } from "../utils/math";

export interface VoteAnalysis {
export interface ReactionAnalysis {
userIndexMap: Map<string, number>;
argumentIndexMap: Map<string, number>;
votingMatrix: number[][];
Expand All @@ -26,7 +26,7 @@ function filterReactions(reactions: ReactionForGraph[]): ReactionForGraph[] {
);
}

export async function analyzeVotes(graphId: string): Promise<VoteAnalysis> {
export async function analyzeReactions(graphId: string): Promise<ReactionAnalysis> {
const reactionArray: ReactionForGraph[] = await getReactionsForGraph(graphId);
const filteredReactions = filterReactions(reactionArray);

Expand Down

0 comments on commit 500ee6e

Please sign in to comment.