Skip to content

Commit

Permalink
add custom min_confidence
Browse files Browse the repository at this point in the history
  • Loading branch information
nostalgiaz committed Feb 7, 2014
1 parent a197de4 commit b04ca56
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
6 changes: 5 additions & 1 deletion inc/class.admin.suggest.php
Original file line number Diff line number Diff line change
Expand Up @@ -310,11 +310,15 @@ public static function ajax_datatxt() {
exit();
}

$confidence = 0.6;
if(SimpleTags_Plugin::get_option_value('datatxt_min_confidence') != "")
$confidence = SimpleTags_Plugin::get_option_value('datatxt_min_confidence');

// Build params
$response = wp_remote_post( 'https://api.dandelion.eu/datatxt/nex/v1', array('body' => array(
'$app_key' => SimpleTags_Plugin::get_option_value('datatxt_key'),
'$app_id' => SimpleTags_Plugin::get_option_value('datatxt_id'),
'min_confidence' => 0.6,
'min_confidence' => $confidence,
'text' => $content
)));

Expand Down
4 changes: 3 additions & 1 deletion inc/helper.options.admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@
array('datatxt_id', __('dataTXT API ID', 'simpletags'), 'text', 'regular-text',
__('You can create an API ID from <a href="https://dandelion.eu/">service website</a>', 'simpletags')),
array('datatxt_key', __('dataTXT API Key', 'simpletags'), 'text', 'regular-text',
__('You can create an API key from <a href="https://dandelion.eu/">service website</a>', 'simpletags'))
__('You can create an API key from <a href="https://dandelion.eu/">service website</a>', 'simpletags')),
array('datatxt_min_confidence', __('dataTXT API min_confidence (default: 0.6)', 'simpletags'), 'text', 'regular-text',
__('You can create an API ID from <a href="https://dandelion.eu/">service website</a>', 'simpletags'))
),
'auto-links' => array(
array('auto_link_min', __('Min usage for auto link tags:', 'simpletags'), 'number', 'small-text',
Expand Down
1 change: 1 addition & 0 deletions inc/helper.options.default.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
'opencalais_key' => '',
'datatxt_key' => '',
'datatxt_id' => '',
'datatxt_min_confidence' => '',
'alchemy_api' => '',
'zemanta_key' => '',
'autocomplete_type' => 'input',
Expand Down

0 comments on commit b04ca56

Please sign in to comment.