ArticleslgStudy

computer science

Agrep

Agrep is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Agrep rather than just read about it. In short: agrep (approximate grep) is an open-source approximate string matching program, developed by Udi Manber and Sun Wu between 1988 and 1991, for use with the Unix operating system. It was ported to OS/2, MS-DOS, and Windows.

Key takeaways

  • Agrep belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Agrep to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Agrep from memory before moving on to harder problems.

Reference excerpt

agrep (approximate grep) is an open-source approximate string matching program, developed by Udi Manber and Sun Wu between 1988 and 1991, for use with the Unix operating system. It was ported to OS/2, MS-DOS, and Windows. It selects the best-suited algorithm for the current query from a multiple built-in string searching algorithms, including Manber and Wu's bitap algorithm based on Levenshtein distances. agrep is also the search engine in the indexer program GLIMPSE. agrep is under a free ISC License.

Alternative implementations A more recent agrep is the command-line tool provided with the TRE regular expression library. TRE agrep is more powerful than Wu-Manber agrep since it allows weights and total costs to be assigned separately to individual groups in the pattern. It can also handle Unicode. Unlike Wu-Manber agrep, TRE agrep is licensed under a 2-clause BSD-like license. FREJ (Fuzzy Regular Expressions for Java) open-source library provides command-line interface which could be used in the way similar to agrep. Unlike agrep or TRE it could be used for constructing complex substitutions for matched text. However its syntax and matching abilities differs significantly from ones of ordinary regular expressions.

See also Bitap algorithm TRE (computing)

References

External links Wu-Manber agrep AGREP home page For Unix (To compile under OSX 10.8, add -Wno-return-type to the CFLAGs = -O line in the Makefile) See also TRE regexp matching package cgrep a defunct command line approximate string matching tool nrgrep a command line approximate string matching tool agrep as implemented in R

Worked examples

Example 1 — a first encounter with Agrep

Start with the simplest possible case. Write down what Agrep claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Agrep before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Agrep ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Agrep

In research
Agrep appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Agrep in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Agrep is common in secondary-school and first-year university syllabi. It links to neighbouring topics Information retrieval systems, Software using the ISC license, Unix text processing utilities, so understanding it makes those chapters shorter.
In everyday life
Look for Agrep outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Agrep” →

How to study Agrep in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Agrep means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Agrep out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Agrep in simple terms?

agrep (approximate grep) is an open-source approximate string matching program, developed by Udi Manber and Sun Wu between 1988 and 1991, for use with the Unix operating system. It was ported to OS/2, MS-DOS, and Windows.

Why does Agrep matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Agrep?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Agrep.

Tags

  • Information retrieval systems
  • Software using the ISC license
  • Unix text processing utilities

Keep exploring