示例#1
0
        /**
         * This method creates a Ranker Options object,and sets the options of the Ranker, and returns
         * the created object.
         * It gets the options from the data base.
         * note:In case the returned values from the data base are nulls or
         *      the operation mode of the crawler is manual this
         *      method will set defualt numbers.
         */
        private static void getRankerOptions()
        {
            if (WorkDetails.getOperationMode() == operationMode_t.Auto)
            {
                String alpha = StorageSystem.StorageSystem.getInstance().getProperty(WorkDetails.getTaskId(),
                                                                                     TaskProperty.RAN_ALPHA.ToString());
                String betta = StorageSystem.StorageSystem.getInstance().getProperty(WorkDetails.getTaskId(),
                                                                                     TaskProperty.RAN_BETA.ToString());
                String gamma = StorageSystem.StorageSystem.getInstance().getProperty(WorkDetails.getTaskId(),
                                                                                     TaskProperty.RAN_GAMMA.ToString());
                String delta = StorageSystem.StorageSystem.getInstance().getProperty(WorkDetails.getTaskId(),
                                                                                     TaskProperty.RAN_DELTA.ToString());

                if (isRealNum(alpha))
                {
                    RankerOptions.ALPHA = Convert.ToDouble(alpha);
                }
                if (isRealNum(betta))
                {
                    RankerOptions.BETTA = Convert.ToDouble(betta);
                }
                if (isRealNum(gamma))
                {
                    RankerOptions.GAMMA = Convert.ToDouble(gamma);
                }
                if ((delta != null) && (delta != "") && (!Convert.IsDBNull(delta)) && ((Convert.ToInt16(delta)) >= 0))
                {
                    RankerOptions.ConfidenceLevelOfAnchor = Convert.ToInt16(delta);
                }
            }
        }
示例#2
0
        /**
         * This method creates Categorizer Options and returns it.
         * The values of the variables of the new object are brought from the data base.
         * Note : In case the operation mode is manual the variables will be default ones,
         *        such is the case when the returns values from the data base are nulls.
         */
        private CategorizerOptions getCategorizerOptions()
        {
            CategorizerOptions options = new CategorizerOptions();

            if (WorkDetails.getOperationMode() == operationMode_t.Auto)
            {
                options.ALPHA            = RankerOptions.CAT_ALPHA;
                options.BETA             = RankerOptions.CAT_BETA;
                options.GAMMA            = RankerOptions.CAT_GAMMA;
                options.MIN_WORDS_LIMIT  = RankerOptions.CAT_MIN;
                options.MIN_WORDS_PENLTY = RankerOptions.CAT_PENLTY;
            }
            return(options);
        }
示例#3
0
        /**
         * This method creates Categorizer Options and returns it.
         * The values of the variables of the new object are brought from the data base.
         * Note : In case the operation mode is manual the variables will be default ones,
         *        such is the case when the returns values from the data base are nulls.
         */
        private CategorizerOptions getOptions(String optionsType)
        {
            CategorizerOptions options = new CategorizerOptions();

            if (WorkDetails.getOperationMode() == operationMode_t.Auto)
            {
                switch (optionsType)
                {
                case "anchor":
                    options.ALPHA              = RankerOptions.ANC_ALPHA;
                    options.BETA               = RankerOptions.ANC_BETA;
                    options.GAMMA              = RankerOptions.ANC_GAMMA;
                    options.MIN_WORDS_LIMIT    = RankerOptions.ANC_MIN;
                    options.MIN_WORDS_PENLTY   = RankerOptions.ANC_PENLTY;
                    options.isRank             = true;
                    options.NONZERO_MAX_EFFECT = 0;
                    break;

                case "wholeContent":
                    options.ALPHA            = RankerOptions.CAT_ALPHA;
                    options.BETA             = RankerOptions.CAT_BETA;
                    options.GAMMA            = RankerOptions.CAT_GAMMA;
                    options.MIN_WORDS_LIMIT  = RankerOptions.CAT_MIN;
                    options.MIN_WORDS_PENLTY = RankerOptions.CAT_PENLTY;
                    options.isRank           = true;
                    break;

                case "nearby":
                    options.ALPHA              = RankerOptions.NER_ALPHA;
                    options.BETA               = RankerOptions.NER_BETA;
                    options.GAMMA              = RankerOptions.NER_GAMMA;
                    options.MIN_WORDS_LIMIT    = RankerOptions.NER_MIN;
                    options.MIN_WORDS_PENLTY   = RankerOptions.NER_PENLTY;
                    options.NONZERO_MAX_EFFECT = 40;
                    options.isRank             = true;
                    break;

                default:
                    goto case "wholeContent";
                }
            }

            return(options);
        }
示例#4
0
        /**
         * This method creates Categorizer Options and returns it.
         * The values of the variables of the new object are brought from the data base.
         * Note : In case the operation mode is manual the variables will be default ones,
         *        such is the case when the returns values from the data base are nulls.
         */
        private static CategorizerOptions getOptions(String optionsType)
        {
            CategorizerOptions options = new CategorizerOptions();

            if (WorkDetails.getOperationMode() == operationMode_t.Auto)
            {
                String alphaSearch = null, bettaSearch = null, gammaSearch = null, minSearch = null, penaltySearch = null;
                switch (optionsType)
                {
                case "anchor":
                    alphaSearch   = TaskProperty.ANC_ALPHA.ToString();
                    bettaSearch   = TaskProperty.ANC_BETA.ToString();
                    gammaSearch   = TaskProperty.ANC_GAMMA.ToString();
                    minSearch     = TaskProperty.ANC_MIN.ToString();
                    penaltySearch = TaskProperty.ANC_PENLTY.ToString();
                    break;

                case "Category":
                    alphaSearch   = TaskProperty.CAT_ALPHA.ToString();
                    bettaSearch   = TaskProperty.CAT_BETA.ToString();
                    gammaSearch   = TaskProperty.CAT_GAMMA.ToString();
                    minSearch     = TaskProperty.CAT_MIN.ToString();
                    penaltySearch = TaskProperty.CAT_PENLTY.ToString();
                    break;

                case "nearby":
                    alphaSearch   = TaskProperty.NER_ALPHA.ToString();
                    bettaSearch   = TaskProperty.NER_BETA.ToString();
                    gammaSearch   = TaskProperty.NER_GAMMA.ToString();
                    minSearch     = TaskProperty.NER_MIN.ToString();
                    penaltySearch = TaskProperty.NER_PENLTY.ToString();
                    break;

                default:
                    goto case "Category";
                }

                String alpha   = StorageSystem.StorageSystem.getInstance().getProperty(WorkDetails.getTaskId(), alphaSearch);
                String betta   = StorageSystem.StorageSystem.getInstance().getProperty(WorkDetails.getTaskId(), bettaSearch);
                String gamma   = StorageSystem.StorageSystem.getInstance().getProperty(WorkDetails.getTaskId(), gammaSearch);
                String min     = StorageSystem.StorageSystem.getInstance().getProperty(WorkDetails.getTaskId(), minSearch);
                String penalty = StorageSystem.StorageSystem.getInstance().getProperty(WorkDetails.getTaskId(), penaltySearch);

                if (isRealNum(alpha))
                {
                    options.ALPHA = Convert.ToDouble(alpha);
                }
                if (isRealNum(betta))
                {
                    options.BETA = Convert.ToDouble(betta);
                }
                if (isRealNum(gamma))
                {
                    options.GAMMA = Convert.ToDouble(gamma);
                }
                if (isRealNum(min))
                {
                    options.MIN_WORDS_LIMIT = Convert.ToDouble(min);
                }
                if (isRealNum(penalty))
                {
                    options.MIN_WORDS_PENLTY = Convert.ToDouble(penalty);
                }
            }

            return(options);
        }