This time I will share jQuery Plugin and tutorial about jQuery Plugin To Generate Tags From A Given Text – tag-extract, hope it will help you in programming stack.
File Size: | 20.5 KB |
---|---|
Views Total: | 627 |
Last Update: | |
Publish Date: | |
Official Website: | Go to website |
License: | MIT |
tag-extract is a tag generation plugin used to extract, generate and stylize tags (keywords) that occur more frequently in a text content you specify. Ideal for automatically generates tags for your article and blog posts.
How to use it:
1. Make sure to load the jQuery tag-extract plugin’s script after jQuery JavaScript library:
1 |
< script src = "//code.jquery.com/jquery.min.js" ></ script > |
2 |
< script src = "tag-extract.js" ></ script > |
2. Initialize the plugin on your text container and done.
1 |
$( 'article' ).tagExtract(); |
3. Set the min/max number of tags you want to generate from your text.
1 |
$( 'article' ).tagExtract({ |
2 |
max: 'auto' , |
3 |
min: 3 |
4 |
}); |
4. Define an array of words you want to ignore.
1 |
$( 'article' ).tagExtract({ |
2 |
ignored: [ 'the' , 'be' , 'to' , 'of' , 'and' , 'a' , 'in' , 'that' , 'have' , 'I' , 'it' , 'for' , 'not' , 'on' , 'with' , 'he' , 'as' , 'you' , 'do' , 'at' , 'this' , 'but' , 'his' , 'by' , 'from' , 'they' , 'we' , 'say' , 'her' , 'she' , 'or' , 'an' , 'will' , 'my' , 'one' , 'all' , 'would' , 'there' , 'their' , 'what' , 'so' , 'up' , 'out' , 'if' , 'about' , 'who' , 'get' , 'which' , 'go' , 'me' , 'when' , 'make' , 'can' , 'like' , 'time' , 'no' , 'just' , 'him' , 'know' , 'take' , 'person' , 'into' , 'year' , 'your' , 'good' , 'some' , 'could' , 'them' , 'see' , 'other' , 'than' , 'then' , 'now' , 'look' , 'only' , 'come' , 'its' , 'over' , 'think' , 'also' , 'back' , 'after' , 'use' , 'two' , 'how' , 'our' , 'work' , 'first' , 'well' , 'way' , 'even' , 'new' , 'want' , 'because' , 'any' , 'these' , 'give' , 'day' , 'most' , 'us' , 'were' , 'was' , 'has' , 'less' , 'more' , 'is' , 's' , 'said' , 'between' , 'without' , 'are' , 'been' , 'such' , 'did' , 'both' , 'had' , 'still' , 'within' ] |
3 |
}); |
5. Apply certain CSS classes to the generated tags.
1 |
$( 'article' ).tagExtract({ |
2 |
clusters: [ 'label-primary' , 'label-info' , 'label-warning' , 'label-danger' ] |
3 |
}); |
6. Specify the target container in which you want to display the generated tags.
1 |
$( 'article' ).tagExtract({ |
2 |
target: 'tags-container' |
3 |
}); |
This awesome jQuery plugin is developed by gsideris. For more Advanced Usages, please check the demo page or visit the official website.
source : jqueryscript.net