Skip to main content

Mutatest

Mutamorphic-test is a python3 package that provides of a two different kinds of word mutators for sentences, meaning that the original sentence will be transformed by this mutators.

How to install it

In order to install the latest version use the python3 installer pip3.

pip3 install mutamorphic-test 

How to use it

In order to use the package we need to import the mutators first with the statement:

from mutatest.mutators import ReplacementMutator,DopoutMutator

Once we have them imported we can use them. We have to create an instance of the classes in order to use them.

We can specify how many words we want them to modify, how many variants of the sentence shall be created and, in the case of the replacement, which strategy shall be used to select the words to be changed.

For the two mutators we need the following parameters (we can also use the default values):

ReplacementMutator(num_replacements: int = 1, num_variants: int = 5, selection_strategy: str = "random")
DropoutMutator(num_dropouts: int = 1, num_variants: int = 1)

Once we have our mutator we can perform mutation on a sentence in the following way:

mutated_sentence=mutator.mutate(sentence,random_seed=42)

A full example of how this package can be used would be the following:

from mutatest.mutators import ReplacementMutator

mutator=ReplacementMutator()
sentence="This is an example sentence"

mutated_sentence=mutator.mutate(sentence,random_seed=42)

print(mutated_sentence)

Metadata

Release files for mutamorphic-test 1.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mutamorphic-test 1.2.1
File Size Uploaded
mutamorphic-test-1.2.1.tar.gz 8.2 kB Details

Release files / mutamorphic-test-1.2.1.tar.gz

Download URL mutamorphic-test-1.2.1.tar.gz
Size 8.2 kB
Tags Source
SHA-256 checksum
How to use checksums
67aed9e919c2924cc6fa12010329e7589e5b5a59510a908fd79ecf41acbcee7d
BLAKE2b-256 checksum
How to use checksums
ba90f7f32fdab3ea959b0b116f96aa9535eabccfb011f59ff61d419b4cc321d9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Release history Release notifications | RSS feed

This release

1.2.1 This release

1 release file

1.1.3

1 release file

1.0.1

1 release file

0.0.4

1 release file

0.0.3

1 release file

0.0.2

1 release file

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page