Implement the normal extraction we have been using

Assignment Help Computer Engineering
Reference no: EM133369810

PART 1: IN JAVA:

Provide 2 plugins for extracting words: one should implement the "normal" extraction we have been using so far; the second one should extract only non-stop words with z.

Provide 2 plugins for counting words: one should implement the "normal" counting we have been using so far; the second one should count words based on their first letters, so words starting with 'a', words starting with 'b', etc.

(FOUR TOTAL PLUGINS, BUT ONE JAVA FILE PLEASE)

*NOTE: Ensure the output is the TOP 25 words as is done in the python example and ensure it properly removes stop words when I test the code.*

Constraints:

The problem is decomposed using some form of abstraction (procedures, functions, objects, etc.)

All or some of those abstractions are physically encapsulated into their own, usually pre-compiled, packages. Main program and each of the packages are compiled independently. These packages are loaded dynamically by the main program, usually in the beginning (but not necessarily).

Main program uses functions/objects from the dynamically-loaded packages, without knowing which exact implementations will be used. New implementations can be used without having to adapt or recompile the main program.

External specification of which packages to load. This can be done by a configuration file, path conventions, user input or other mechanisms for external specification of code to be linked at run time.

CODE:

import sys, configparser, importlib.machinery

def load_plugins():

config = configparser.ConfigParser()

config.read("config.ini")

words_plugin = config.get("Plugins", "words")

frequencies_plugi n = config.get("Plugins", "frequencies")

global tfwords, tffreqs

tfwords = importlib.machinery.SourcelessFileLoader('tfwords', words_plugin).load_module()

tffreqs = importlib.machinery.SourcelessFileLoader('tffreqs', frequencies_plugin).load_module()

load_plugins()

word_freqs = tffreqs.top25(tfwords.extract_words(sys.argv[1]))

 

for (w, c) in word_freqs:

print(w, '-', c)

Reference no: EM133369810

Questions Cloud

What is value of the joinery investment in boylan company : Prepare the journal entries to record the three entries on The Joinery Company's books. What is the value of The Joinery's investment in Boylan Company
Define legal concepts by incorporating the legal terminology : Use and define legal concepts by incorporating the legal terminology from your textbook where appropriate and relevant.
Psychology perspective does soccer team : In a psychology perspective Does a soccer team have a specific goal or purpose? what is the purpose?
Procedures followed to carry out demolition procedures : Procedures followed to carry out demolition procedures in accordance with safe and effective processes of deconstructing or demolishing a minor building
Implement the normal extraction we have been using : Implement the normal extraction we have been using so far; the second one should extract only non-stop words with z
Sociological and anthropological perspectives : How can you describe a soccer team in the form of storytelling that include psychological, sociological, and anthropological perspectives ?
Show the calculations to add dave vader to the partnership : Show the calculations to add Dave Vader to the partnership and the journal entry to record the transaction. Theresa Trueheart and Ethel Hardachre wish to add
Implementing content-based recommendation engine : What kind of information would businesses need to collect about their products before implementing a content-based recommendation engine?
Discuss the ucc vis-a-vis common law of contracts : Discuss the key differences/similarities in the approach taken by the UCC vis-a-vis the common law of contracts toward the contracts formation process.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd