haiku 1.0.6

  • README.md
  • Installing
  • Versions
  • 45

Haiku

Detect and create Haikus

Examples

Detecting a haiku

final poem = '''
   This is my long poem. It is too long for haiku, because it's tail is quite large.
''';

final haikuPoem = '''
    An old silent pond... A frog jumps into the pond, splash! Silence again.
''';

HaikuComposer composer = new HaikuComposer();
print(composer.isHaiku(poem)); // False; 19 syllables
print(composer.isHaiku(haikuPoem)); // True

Creating a Haiku

final haiku = composer.create(haikuPoem);
print(haiku.firstLine); // ['An', 'old', 'silent', 'pond...'];
print(haiku.secondLine); // ['A', 'frog', 'jumps', 'into', 'the', 'pond'];
print(haiku.thirdLine); // ['splash!', 'Silence', 'again.'];

Printing a Haiku

print(const HaikuFormatter().format(haiku));

//  An old silent pond...
//  A frog jumps into the pond,
//  splash! Silence again.

1. Depend on it

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


dependencies:
  haiku: "^1.0.6"

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter packages get

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

3. Import it

Now in your Dart code, you can use:


import 'package:haiku/haiku.dart';
        
Version Uploaded Documentation Archive
1.0.6 Oct 6, 2017 Go to the documentation of haiku 1.0.6 Download haiku 1.0.6 archive
1.0.5 Oct 6, 2017 Go to the documentation of haiku 1.0.5 Download haiku 1.0.5 archive
1.0.4 Oct 6, 2017 Go to the documentation of haiku 1.0.4 Download haiku 1.0.4 archive
1.0.3 Oct 6, 2017 Go to the documentation of haiku 1.0.3 Download haiku 1.0.3 archive
1.0.2 Oct 6, 2017 Go to the documentation of haiku 1.0.2 Download haiku 1.0.2 archive
1.0.1 Oct 5, 2017 Go to the documentation of haiku 1.0.1 Download haiku 1.0.1 archive
1.0.0 Oct 4, 2017 Go to the documentation of haiku 1.0.0 Download haiku 1.0.0 archive

Analysis

We analyzed this package on Apr 23, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0-dev.49.0
  • pana: 0.10.6

Scores

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

Platforms

Detected platforms: Flutter, web, other

No platform restriction found in primary library package:haiku/haiku.dart.

Suggestions

  • Maintain CHANGELOG.md.

    Changelog entries help clients to follow the progress in your code.

  • Use constrained dependencies.

    The pubspec.yaml contains 3 dependencies without version constraints. Specify version ranges for the following dependencies: meta, packages, syllables.

  • The description is too short.

    Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

  • Maintain an example.

    Create a short demo in the example/ directory to show how to use this package. Common file name patterns include: main.dart, example.dart or you could also use haiku.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
meta 1.1.2
packages 0.3.3
syllables 0.0.4
Transitive dependencies
ansicolor 0.0.9 0.1.0
args 0.13.7 1.4.2
browser 0.10.0+3
console_log_handler 0.5.7
intl 0.15.6
logging 0.11.3+1
optional 1.2.3+1
path 1.5.1
supports_color 0.1.1
Dev dependencies
test