PageRenderTime 43ms CodeModel.GetById 17ms RepoModel.GetById 1ms app.codeStats 0ms

/src/org/bitbucket/artbugorski/postmedclaimfinder/experiment/ExperimentSettings.java

https://bitbucket.org/artbugorski/postmedclaimfinder
Java | 157 lines | 115 code | 30 blank | 12 comment | 0 complexity | cbafbf908d91bbd52466d63e4b5b6c20 MD5 | raw file
  1. package org.bitbucket.artbugorski.postmedclaimfinder.experiment;
  2. import java.util.Collection;
  3. import java.util.Collections;
  4. import java.util.HashMap;
  5. import org.bitbucket.artbugorski.postmedclaimfinder.scorer.FeatureValueCalculatorMethod;
  6. import org.bitbucket.artbugorski.postmedclaimfinder.model.DocumentInformation;
  7. import java.util.Map;
  8. import org.bitbucket.artbugorski.postmedclaimfinder.AppUtil.*;
  9. import org.bitbucket.artbugorski.postmedclaimfinder.reporter.Reporter;
  10. import org.bitbucket.artbugorski.postmedclaimfinder.filter.WordFilter;
  11. import org.bitbucket.artbugorski.postmedclaimfinder.matcher.SectionMatcher;
  12. import org.bitbucket.artbugorski.util.nlp.NGramTree;
  13. /**
  14. * The purpose of this class is to abstract away general settings into an object,
  15. * instead of using global variables. This is to facilitate the running of multiple
  16. * tests independently.
  17. *
  18. * @author Art
  19. */
  20. public class ExperimentSettings implements Cloneable {
  21. /**
  22. * Which set of document to use. The random set has been haphazardly
  23. * accumulated by historical accident whereas the focused one has be selected
  24. * from biology themed journals.
  25. */
  26. private boolean useFigLess;
  27. private Collection< Class<? extends SectionMatcher> > matchingHeuristics = Collections.emptyList();
  28. private FeatureValueCalculatorMethod<Double> scoringMethod;
  29. private WordFilter filter;
  30. private Reporter reporter;
  31. private int biGramCutOff;
  32. private int coreCount;
  33. private int fixedExpressionRequirement;
  34. private FeatureSet calcMode;
  35. private boolean filterFixedExpressions;
  36. private Map<DocumentInformation, NGramTree> fixedExpressions = new HashMap<>();
  37. private Corpus corpus;
  38. public boolean isUseFigLess(){
  39. return useFigLess;
  40. }
  41. public void setUseFigLess( boolean useFigLess ){
  42. this.useFigLess = useFigLess;
  43. }
  44. public Collection< Class<? extends SectionMatcher> > getMatchingHeuristics(){
  45. return matchingHeuristics;
  46. }
  47. public void setMatchingHeuristics( Collection< Class<? extends SectionMatcher> > matchingHeuristics ){
  48. this.matchingHeuristics = matchingHeuristics;
  49. }
  50. public FeatureValueCalculatorMethod<Double> getScoringMethod(){
  51. return scoringMethod;
  52. }
  53. public void setScoringMethod( FeatureValueCalculatorMethod<Double> scoringMethod ){
  54. this.scoringMethod = scoringMethod;
  55. }
  56. public WordFilter getFilter(){
  57. return filter;
  58. }
  59. public void setFilter( WordFilter filter ){
  60. this.filter = filter;
  61. }
  62. public Reporter getReporter(){
  63. return reporter;
  64. }
  65. public void setReporter( Reporter reporter ){
  66. this.reporter = reporter;
  67. }
  68. public int getBiGramCutOff(){
  69. return biGramCutOff;
  70. }
  71. public void setBiGramCutOff( int biGramCutOff ){
  72. this.biGramCutOff = biGramCutOff;
  73. }
  74. public int getCoreCount(){
  75. return coreCount;
  76. }
  77. public void setCoreCount( int coreCount ){
  78. this.coreCount = coreCount;
  79. }
  80. public int getFixedExpressionRequirement(){
  81. return fixedExpressionRequirement;
  82. }
  83. public void setFixedExpressionRequirement( int fixedExpressionRequirement ){
  84. this.fixedExpressionRequirement = fixedExpressionRequirement;
  85. }
  86. public FeatureSet getFeatureSet(){
  87. return calcMode;
  88. }
  89. public void setFeatureSet( FeatureSet calcMode ){
  90. this.calcMode = calcMode;
  91. }
  92. public boolean isFilterFixedExpressions(){
  93. return filterFixedExpressions;
  94. }
  95. public void setFilterFixedExpressions( boolean filterFixedExpressions ){
  96. this.filterFixedExpressions = filterFixedExpressions;
  97. }
  98. public Map<DocumentInformation, NGramTree> getFixedExpressions(){
  99. return fixedExpressions;
  100. }
  101. public void setFixedExpressions( Map<DocumentInformation, NGramTree> fixedExpressions ){
  102. this.fixedExpressions = fixedExpressions;
  103. }
  104. public Corpus getCorpus(){
  105. return corpus;
  106. }
  107. public void setCorpus( Corpus corpus ){
  108. this.corpus = corpus;
  109. }
  110. @Override
  111. public String toString() {
  112. return "ExperimentSettings{"
  113. + "useFigLess=" + useFigLess
  114. + ", matchingHeuristics=" + matchingHeuristics
  115. + ", scoringMethod=" + scoringMethod
  116. + ", filter=" + filter
  117. + ", reporter=" + reporter
  118. + ", biGramCutOff=" + biGramCutOff
  119. + ", coreCount=" + coreCount
  120. + ", fixedExpressionRequirement=" + fixedExpressionRequirement
  121. + ", calcMode=" + calcMode
  122. + ", filterFixedExpressions=" + filterFixedExpressions
  123. + ", fixedExpressions=" + fixedExpressions
  124. + ", corpus=" + corpus
  125. + '}';
  126. }
  127. }