mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 19:58:00 +00:00
Adding Pauper in the stop-words list
All supported format names in stopwords have been grouped into a constant for easy update and re-use.
This commit is contained in:
@@ -38,6 +38,7 @@ import static forge.lda.lda.inference.InferenceMethod.CGS;
|
||||
*/
|
||||
public final class LDAModelGenetrator {
|
||||
|
||||
public static final String SUPPORTED_LDA_FORMATS = "Historic|Modern|Pioneer|Standard|Legacy|Vintage|Pauper";
|
||||
public static Map<String, Map<String,List<List<Pair<String, Double>>>>> ldaPools = new HashMap<>();
|
||||
public static Map<String, List<Archetype>> ldaArchetypes = new HashMap<>();
|
||||
|
||||
@@ -167,7 +168,6 @@ public final class LDAModelGenetrator {
|
||||
|
||||
public static List<Archetype> initializeFormat(GameFormat format) throws Exception{
|
||||
Dataset dataset = new Dataset(format);
|
||||
|
||||
//estimate number of topics to attempt to find using power law
|
||||
final int numTopics = Float.valueOf(347f*dataset.getNumDocs()/(2892f + dataset.getNumDocs())).intValue();
|
||||
System.out.println("Num Topics = " + numTopics);
|
||||
@@ -223,8 +223,8 @@ public final class LDAModelGenetrator {
|
||||
}
|
||||
LinkedHashMap<String, Integer> wordCounts = new LinkedHashMap<>();
|
||||
for( Deck deck: decks){
|
||||
String name = deck.getName().replaceAll(".* Version - ","").replaceAll(" \\((Historic|Modern|Pioneer|Standard|Legacy|Vintage), #[0-9]+\\)","");
|
||||
name = name.replaceAll("\\(Historic|Modern|Pioneer|Standard|Legacy|Vintage|Fuck|Shit|Cunt\\)","");
|
||||
String name = deck.getName().replaceAll(".* Version - ","").replaceAll(" \\((" + SUPPORTED_LDA_FORMATS + "), #[0-9]+\\)","");
|
||||
name = name.replaceAll("\\(" + SUPPORTED_LDA_FORMATS + "|Fuck|Shit|Cunt|Ass|Arse|Dick|Pussy\\)","");
|
||||
String[] tokens = name.split(" ");
|
||||
for(String rawtoken: tokens){
|
||||
String token = rawtoken.toLowerCase();
|
||||
@@ -376,7 +376,7 @@ public final class LDAModelGenetrator {
|
||||
int old = matrix[legendIntegerMap.get(legend.getName())][cardIntegerMap.get(pairCard.getName())];
|
||||
matrix[legendIntegerMap.get(legend.getName())][cardIntegerMap.get(pairCard.getName())] = old + 1;
|
||||
}catch (NullPointerException ne){
|
||||
//Todo: Not sure what was failing here
|
||||
//TODO: Not sure what was failing here
|
||||
ne.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user