anagram 1.0.0

  • Readme
  • Changelog
  • Example
  • Installing
  • 59

anagram #

A simple anagram solving utility library for Dart based on the original anagram C program by Martin Guy.

Anagram is a standalone utility using its own inbuilt word list(from linux words) and as such does not depend on any web services.

It is intended for simple anagram finding for tasks such as crossword solving etc.

Please read the changelog for details related to specific versions and the example for usage details.

1.0.0 #

Initial release

example/anagram.dart

/*
 * Package : Anagram
 * Author : S. Hamblett <steve.hamblett@linux.com>
 * Date   : 01/04/2020
 * Copyright :  S.Hamblett
 */

import 'package:anagram/anagram.dart';

//
// The anagram package is split into the main command line anagram program and a
// supporting Anagram library.
//
// The command line program prints out its usage if you simply type 'anagram'
// or 'anagram --help'. The rest of this example shows how to use the main Anagram
// library with its options.
//

int main() {
  // Create and initialise the anagram library, note if you do not call initialise
  // the library will simply exit when the solve method is called.
  //
  final anagram = Anagram();
  anagram.initialise();

  // In the command line program the word to solve can be a single word or a space
  // separated sequence in which case the separate words are concatenated together
  // so for instance there is no difference between the word 'prelate' and 'pre late',
  // the solve method however expects one word with the components concatenated.
  //
  // Anagram will solve for the length of the input word and sub lengths specified by the
  // -m option. The default is 1 so a 7 letter word will return results only of 7 letters,
  // a value of 2 will return 6 and 7 letters etc. Note that no attempt is made to use the
  // left over letters, the are simply discarded, example, solve for the word 'prelate'
  var words = anagram.solve('prelate');
  print(words);
  words.clear();
  anagram.maxWords = 2;
  words = anagram.solve('prelate');
  print(words);

  // The other options, ignore all case, ignore punctuation and ignore first letter case
  // usage should be self explanatory.

  return 0;
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  anagram: ^1.0.0

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:anagram/anagram.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
19
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
59
Learn more about scoring.

We analyzed this package on Jul 11, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.4
  • pana: 0.13.14

Analysis suggestions

Package not compatible with runtime flutter-web on web

Because:

  • package:anagram/anagram.dart that imports:
  • dart:io

Package not compatible with runtime js

Because:

  • package:anagram/anagram.dart that imports:
  • dart:io

Health suggestions

Format bin/anagram.dart.

Run dartfmt to format bin/anagram.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev <3.0.0
args ^1.6.0 1.6.0
meta ^1.1.8 1.2.2 1.3.0-nullsafety
path ^1.6.4 1.7.0
Dev dependencies
pana ^0.13.5
pedantic ^1.9.0