repo_id
stringlengths
18
103
file_path
stringlengths
30
136
content
stringlengths
2
3.36M
__index_level_0__
int64
0
0
coqui_public_repos/TTS/TTS/tts/layers
coqui_public_repos/TTS/TTS/tts/layers/generic/transformer.py
import torch import torch.nn.functional as F from torch import nn class FFTransformer(nn.Module): def __init__(self, in_out_channels, num_heads, hidden_channels_ffn=1024, kernel_size_fft=3, dropout_p=0.1): super().__init__() self.self_attn = nn.MultiheadAttention(in_out_channels, num_heads, dropout=dropout_p) padding = (kernel_size_fft - 1) // 2 self.conv1 = nn.Conv1d(in_out_channels, hidden_channels_ffn, kernel_size=kernel_size_fft, padding=padding) self.conv2 = nn.Conv1d(hidden_channels_ffn, in_out_channels, kernel_size=kernel_size_fft, padding=padding) self.norm1 = nn.LayerNorm(in_out_channels) self.norm2 = nn.LayerNorm(in_out_channels) self.dropout1 = nn.Dropout(dropout_p) self.dropout2 = nn.Dropout(dropout_p) def forward(self, src, src_mask=None, src_key_padding_mask=None): """😦 ugly looking with all the transposing""" src = src.permute(2, 0, 1) src2, enc_align = self.self_attn(src, src, src, attn_mask=src_mask, key_padding_mask=src_key_padding_mask) src = src + self.dropout1(src2) src = self.norm1(src + src2) # T x B x D -> B x D x T src = src.permute(1, 2, 0) src2 = self.conv2(F.relu(self.conv1(src))) src2 = self.dropout2(src2) src = src + src2 src = src.transpose(1, 2) src = self.norm2(src) src = src.transpose(1, 2) return src, enc_align class FFTransformerBlock(nn.Module): def __init__(self, in_out_channels, num_heads, hidden_channels_ffn, num_layers, dropout_p): super().__init__() self.fft_layers = nn.ModuleList( [ FFTransformer( in_out_channels=in_out_channels, num_heads=num_heads, hidden_channels_ffn=hidden_channels_ffn, dropout_p=dropout_p, ) for _ in range(num_layers) ] ) def forward(self, x, mask=None, g=None): # pylint: disable=unused-argument """ TODO: handle multi-speaker Shapes: - x: :math:`[B, C, T]` - mask: :math:`[B, 1, T] or [B, T]` """ if mask is not None and mask.ndim == 3: mask = mask.squeeze(1) # mask is negated, torch uses 1s and 0s reversely. mask = ~mask.bool() alignments = [] for layer in self.fft_layers: x, align = layer(x, src_key_padding_mask=mask) alignments.append(align.unsqueeze(1)) alignments = torch.cat(alignments, 1) return x class FFTDurationPredictor: def __init__( self, in_channels, hidden_channels, num_heads, num_layers, dropout_p=0.1, cond_channels=None ): # pylint: disable=unused-argument self.fft = FFTransformerBlock(in_channels, num_heads, hidden_channels, num_layers, dropout_p) self.proj = nn.Linear(in_channels, 1) def forward(self, x, mask=None, g=None): # pylint: disable=unused-argument """ Shapes: - x: :math:`[B, C, T]` - mask: :math:`[B, 1, T]` TODO: Handle the cond input """ x = self.fft(x, mask=mask) x = self.proj(x) return x
0
coqui_public_repos/inference-engine/third_party/openfst-1.6.7/src/include/fst
coqui_public_repos/inference-engine/third_party/openfst-1.6.7/src/include/fst/script/randgen.h
// See www.openfst.org for extensive documentation on this weighted // finite-state transducer library. #ifndef FST_SCRIPT_RANDGEN_H_ #define FST_SCRIPT_RANDGEN_H_ #include <ctime> #include <tuple> #include <fst/randgen.h> #include <fst/script/fst-class.h> #include <fst/script/script-impl.h> namespace fst { namespace script { using RandGenArgs = std::tuple<const FstClass &, MutableFstClass *, time_t, const RandGenOptions<RandArcSelection> &>; template <class Arc> void RandGen(RandGenArgs *args) { const Fst<Arc> &ifst = *(std::get<0>(*args).GetFst<Arc>()); MutableFst<Arc> *ofst = std::get<1>(*args)->GetMutableFst<Arc>(); const time_t seed = std::get<2>(*args); const auto &opts = std::get<3>(*args); switch (opts.selector) { case UNIFORM_ARC_SELECTOR: { const UniformArcSelector<Arc> selector(seed); const RandGenOptions<UniformArcSelector<Arc>> ropts( selector, opts.max_length, opts.npath, opts.weighted, opts.remove_total_weight); RandGen(ifst, ofst, ropts); return; } case FAST_LOG_PROB_ARC_SELECTOR: { const FastLogProbArcSelector<Arc> selector(seed); const RandGenOptions<FastLogProbArcSelector<Arc>> ropts( selector, opts.max_length, opts.npath, opts.weighted, opts.remove_total_weight); RandGen(ifst, ofst, ropts); return; } case LOG_PROB_ARC_SELECTOR: { const LogProbArcSelector<Arc> selector(seed); const RandGenOptions<LogProbArcSelector<Arc>> ropts( selector, opts.max_length, opts.npath, opts.weighted, opts.remove_total_weight); RandGen(ifst, ofst, ropts); return; } } } void RandGen(const FstClass &ifst, MutableFstClass *ofst, time_t seed = time(nullptr), const RandGenOptions<RandArcSelection> &opts = RandGenOptions<RandArcSelection>(UNIFORM_ARC_SELECTOR)); } // namespace script } // namespace fst #endif // FST_SCRIPT_RANDGEN_H_
0
coqui_public_repos/STT/training
coqui_public_repos/STT/training/coqui_stt_training/evaluate_flashlight.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function import json import sys from multiprocessing import cpu_count import progressbar import tensorflow.compat.v1 as tfv1 from coqui_stt_ctcdecoder import ( Scorer, flashlight_beam_search_decoder_batch, FlashlightDecoderState, ) from six.moves import zip import tensorflow as tf from .deepspeech_model import create_model, reset_default_graph from .util.augmentations import NormalizeSampleRate from .util.checkpoints import load_graph_for_evaluation from .util.config import ( Config, create_progressbar, initialize_globals_from_cli, log_error, log_progress, ) from .util.evaluate_tools import calculate_and_print_report, save_samples_json from .util.feeding import create_dataset from .util.helpers import check_ctcdecoder_version def sparse_tensor_value_to_texts(value, alphabet): r""" Given a :class:`tf.SparseTensor` ``value``, return an array of Python strings representing its values, converting tokens to strings using ``alphabet``. """ return sparse_tuple_to_texts( (value.indices, value.values, value.dense_shape), alphabet ) def sparse_tuple_to_texts(sp_tuple, alphabet): indices = sp_tuple[0] values = sp_tuple[1] results = [[] for _ in range(sp_tuple[2][0])] for i, index in enumerate(indices): results[index[0]].append(values[i]) # List of strings return [alphabet.Decode(res) for res in results] def evaluate(test_csvs, create_model): if Config.scorer_path: scorer = Scorer( Config.lm_alpha, Config.lm_beta, Config.scorer_path, Config.alphabet ) else: scorer = None test_sets = [ create_dataset( [csv], batch_size=Config.test_batch_size, train_phase=False, augmentations=[NormalizeSampleRate(Config.audio_sample_rate)], reverse=Config.reverse_test, limit=Config.limit_test, ) for csv in test_csvs ] iterator = tfv1.data.Iterator.from_structure( tfv1.data.get_output_types(test_sets[0]), tfv1.data.get_output_shapes(test_sets[0]), output_classes=tfv1.data.get_output_classes(test_sets[0]), ) test_init_ops = [iterator.make_initializer(test_set) for test_set in test_sets] batch_wav_filename, (batch_x, batch_x_len), batch_y = iterator.get_next() # One rate per layer no_dropout = [None] * 6 logits, _ = create_model( batch_x=batch_x, seq_length=batch_x_len, dropout=no_dropout ) # Transpose to batch major and apply softmax for decoder transposed = tf.nn.softmax(tf.transpose(a=logits, perm=[1, 0, 2])) loss = tfv1.nn.ctc_loss(labels=batch_y, inputs=logits, sequence_length=batch_x_len) tfv1.train.get_or_create_global_step() # Get number of accessible CPU cores for this process try: num_processes = cpu_count() except NotImplementedError: num_processes = 1 with open(Config.vocab_file) as fin: vocab = [l.strip().encode("utf-8") for l in fin] with tfv1.Session(config=Config.session_config) as session: load_graph_for_evaluation(session) def run_test(init_op, dataset): wav_filenames = [] losses = [] predictions = [] ground_truths = [] bar = create_progressbar( prefix="Test epoch | ", widgets=["Steps: ", progressbar.Counter(), " | ", progressbar.Timer()], ).start() log_progress("Test epoch...") step_count = 0 # Initialize iterator to the appropriate dataset session.run(init_op) # First pass, compute losses and transposed logits for decoding while True: try: ( batch_wav_filenames, batch_logits, batch_loss, batch_lengths, batch_transcripts, ) = session.run( [batch_wav_filename, transposed, loss, batch_x_len, batch_y] ) except tf.errors.OutOfRangeError: break decoded = flashlight_beam_search_decoder_batch( batch_logits, batch_lengths, Config.alphabet, beam_size=Config.export_beam_width, decoder_type=FlashlightDecoderState.DecoderType.LexiconBased, token_type=FlashlightDecoderState.TokenType.Aggregate, lm_tokens=vocab, num_processes=num_processes, scorer=scorer, cutoff_top_n=Config.cutoff_top_n, ) predictions.extend(" ".join(d[0].words) for d in decoded) ground_truths.extend( sparse_tensor_value_to_texts(batch_transcripts, Config.alphabet) ) wav_filenames.extend( wav_filename.decode("UTF-8") for wav_filename in batch_wav_filenames ) losses.extend(batch_loss) step_count += 1 bar.update(step_count) bar.finish() # Print test summary test_samples = calculate_and_print_report( wav_filenames, ground_truths, predictions, losses, dataset, "cer" if Config.bytes_output_mode else "wer", Config.report_count, ) return test_samples samples = [] for csv, init_op in zip(test_csvs, test_init_ops): print("Testing model on {}".format(csv)) samples.extend(run_test(init_op, dataset=csv)) return samples def test(): reset_default_graph() samples = evaluate(Config.test_files, create_model) if Config.test_output_file: save_samples_json(samples, Config.test_output_file) def main(): initialize_globals_from_cli() check_ctcdecoder_version() if not Config.test_files: raise RuntimeError( "You need to specify what files to use for evaluation via " "the --test_files flag." ) test() if __name__ == "__main__": main()
0
coqui_public_repos
coqui_public_repos/TTS/run_bash_tests.sh
set -e TF_CPP_MIN_LOG_LEVEL=3 # runtime bash based tests # TODO: move these to python ./tests/bash_tests/test_demo_server.sh && \ ./tests/bash_tests/test_compute_statistics.sh
0
coqui_public_repos/STT/doc
coqui_public_repos/STT/doc/playbook/ENVIRONMENT.md
[Home](README.md) | [Previous - Acoustic Model and Language Model](AM_vs_LM.md) | [Next - Training your model](TRAINING.md) # Setting up your environment for training using Coqui STT ## Contents - [Setting up your environment for training using Coqui STT](#setting-up-your-environment-for-training-using-coqui-stt) * [Contents](#contents) * [Installing dependencies for working with GPUs under Docker](#installing-dependencies-for-working-with-gpus-under-docker) + [GPU drivers](#gpu-drivers) * [What is Docker and why is it recommended for training a model with Coqui STT?](#what-is-docker-and-why-is-it-recommended-for-training-a-model-with-coqui-stt-) * [Install Docker](#install-docker) + [Ensure that you create a `docker` group and that you add yourself to this group](#ensure-that-you-create-a--docker--group-and-that-you-add-yourself-to-this-group) + [Install the `nvidia-container-toolkit`](#install-the--nvidia-container-toolkit-) * [Pulling down a pre-built Coqui STT Docker image](#pulling-down-a-pre-built-coqui-stt-docker-image) + [Testing the image by creating a container and running a script](#testing-the-image-by-creating-a-container-and-running-a-script) * [Setting up a bind mount to store persistent data](#setting-up-a-bind-mount-to-store-persistent-data) * [Extending the base `stt-train` Docker image for your needs](#extending-the-base--stt-train--docker-image-for-your-needs) This section of the Playbook assumes you are comfortable installing 🐸STT and using it with a pre-trained model, and that you are comfortable setting up a Python _virtual environment_. Here, we provide information on setting up a Docker environment for training your own speech recognition model using 🐸STT. We also cover dependencies Docker has for NVIDIA GPUs, so that you can use your GPU(s) for training a model. --- *** Do not train using only CPU(s) *** This Playbook assumes that you will be using NVIDIA GPU(s). Training a 🐸STT speech recognition model on CPU(s) only will take a _very, very, very_ long time. Do not train on your CPU(s). --- ## Installing dependencies for working with GPUs under Docker Before we install Docker, we are going to make sure that we have all the Ubuntu Linux dependencies required for working with NVIDIA GPUs and Docker. --- *** Non-NVIDIA GPUS *** Although non-NVIDIA GPUs exist, they are currently rare, and we do not aim to support them in this Playbook. --- ### GPU drivers By default, your machine should already have GPU drivers installed. A good way to check is with the `nvidia-smi` tool. If your drivers are installed correctly, `nvidia-smi` will report the driver version and CUDA version. ``` $ nvidia-smi Sat Jan 9 11:48:50 2021 +-----------------------------------------------------------------------------+ | NVIDIA-SMI 450.80.02 Driver Version: 450.80.02 CUDA Version: 11.0 | |-------------------------------+----------------------+----------------------+ | GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC | | Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. | | | | MIG M. | |===============================+======================+======================| | 0 GeForce GTX 1060 Off | 00000000:01:00.0 On | N/A | | N/A 70C P0 27W / N/A | 766MiB / 6069MiB | 2% Default | | | | N/A | +-------------------------------+----------------------+----------------------+ +-----------------------------------------------------------------------------+ | Processes: | | GPU GI CI PID Type Process name GPU Memory | | ID ID Usage | |=============================================================================| | | +-----------------------------------------------------------------------------+ ``` If your drivers are _not_ installed correctly, you will likely see this warning: ``` $ nvidia-smi Command 'nvidia-smi' not found, but can be installed with: sudo apt install nvidia-utils-440 # version 440.100-0ubuntu0.20.04.1, or sudo apt install nvidia-340 # version 340.108-0ubuntu2 sudo apt install nvidia-utils-435 # version 435.21-0ubuntu7 sudo apt install nvidia-utils-390 # version 390.141-0ubuntu0.20.04.1 sudo apt install nvidia-utils-450 # version 450.102.04-0ubuntu0.20.04.1 sudo apt install nvidia-utils-450-server # version 450.80.02-0ubuntu0.20.04.3 sudo apt install nvidia-utils-460 # version 460.32.03-0ubuntu0.20.04.1 sudo apt install nvidia-utils-418-server # version 418.152.00-0ubuntu0.20.04.1 sudo apt install nvidia-utils-440-server # version 440.95.01-0ubuntu0.20.04.1 ``` [Follow this guide](https://linuxconfig.org/how-to-install-the-nvidia-drivers-on-ubuntu-18-04-bionic-beaver-linux) to install your GPU drivers. Once you've installed your drivers, use `nvidia-smi` to prove that they are installed correctly. _Note that you may need to restart your host after installing the GPU drivers._ Ideally, you should not be running any other processes on your GPU(s) before you start training. Next, we will install the utility `nvtop` so that you can monitor the performance of your GPU(s). We will also use `nvtop` to prove that Docker is able to use your GPU(s) later in this document. ``` $ sudo apt install nvtop ``` _Note that you may need to restart your host after installing `nvtop`._ If you run `nvtop` you will see a graph similar to this: ![Screenshot of nvtop](images/nvtop.png "Screenshot of nvtop") You are now ready to install Docker. ## What is Docker and why is it recommended for training a model with Coqui STT? [Docker](https://www.docker.com/why-docker) is virtualization software that allows a consistent collection of software, dependencies and environments to be packaged into a _container_ which is then run on a host, or many hosts. It is one way to manage the many software dependencies which are required for training a model with 🐸STT, particularly if using an NVIDIA GPU. ## Install Docker First, you must install Docker on your host. Follow the [instructions on the Docker website](https://docs.docker.com/engine/install/ubuntu/). ### Ensure that you create a `docker` group and that you add yourself to this group Once you have installed Docker, be sure to follow the [post-installation](https://docs.docker.com/engine/install/linux-postinstall/) steps. These include setting up a `docker` group and adding your user account to this group. If you do not follow this step, you will need to use `sudo` with every Docker command, and this can have unexpected results. --- If you try to use `docker` commands and constantly receive permission warnings, it's likely that you have forgotten this step. --- ### Install the `nvidia-container-toolkit` Next, we need to install `nvidia-container-toolkit`. This is necessary to allow Docker to be able to access the GPU(s) on your machine for training. First, add the repository for your distribution, following the instructions on the [NVIDIA Docker GitHub page](https://nvidia.github.io/nvidia-docker/). For example: ``` curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | \ sudo apt-key add - distribution=$(. /etc/os-release;echo $ID$VERSION_ID) curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | \ sudo tee /etc/apt/sources.list.d/nvidia-docker.list sudo apt-get update ``` Next, install `nvidia-container-toolkit`: ``` $ sudo apt-get install -y nvidia-docker2 ``` ## Pulling down a pre-built Coqui STT Docker image Once you have installed Docker and the `nvidia-container-toolkit`, you are ready to build a Docker _image_. Although it's [possible to build your own Docker image from scratch](), we're going to use a pre-built 🐸STT training image which is hosted on Docker Hub. Once the image is pulled down, you can then create a Docker _container_ from the image to perform training. As you become more proficient with using 🐸STT, you can use the pre-built Docker image as the basis for your own images. **Running this command will download several gigabytes of data. Do not perform this command if you are on a limited or metered internet connection** ``` $ docker pull ghcr.io/coqui-ai/stt-train:latest latest: Pulling from coqui-ai/stt-train Digest: sha256:0f8ee9208874a925618e527f1d06ea9065dd09c700972cba740884e7e7e4cd17 Status: Image is up to date for ghcr.io/coqui-ai/stt-train:latest ghcr.io/coqui-ai/stt-train:latest ``` <!-- FIXME uncomment once we have CI publishing of these images: If you do not which to use the `v0.9.3` 🐸STT image, [a list of previous images is available](https://github.com/orgs/coqui-ai/packages/container/stt-train/versions). You will now see the `ghcr.io/coqui-ai/stt-train` image when you run the command `docker image ls`: ``` $ docker image ls REPOSITORY TAG IMAGE ID CREATED SIZE ghcr.io/coqui-ai/stt-train latest e1ab9313051d 37 minutes ago 5.12GB ``` --> ### Testing the image by creating a container and running a script Now that you have your Docker image pulled down, you can create a _container_ from the image. Here, we're going to create a container and run a simple test to make sure that the image is working correctly. _Note that you can refer to Docker images by `id` - such as `e1ab9313051d` in the example above, or by the image's name and `tag`. Here, we will be using the image name and `tag` - ie `ghcr.io/coqui-ai/stt-train:latest`._ ``` $ docker run -it --name stt-test --entrypoint /bin/bash ghcr.io/coqui-ai/stt-train:latest ``` The `entrypoint` instruction following `docker run` tells Docker to run the `/bin/bash` (ie shell) after creating the container. This command assumes that `/bin/bash` will be invoked as the `root` user. This is necessary, as the Docker container needs to make changes to the filesystem. If you use the `-u $(id -u):$(id -g)` switches, you will tell Docker to invoke `/bin/bash` as the current user of the host that is running the Docker container. You will likely encounter `permission denied` errors while running training. When you run the above command, you should see the following prompt: ``` ________ _______________ ___ __/__________________________________ ____/__ /________ __ __ / _ _ \_ __ \_ ___/ __ \_ ___/_ /_ __ /_ __ \_ | /| / / _ / / __/ / / /(__ )/ /_/ / / _ __/ _ / / /_/ /_ |/ |/ / /_/ \___//_/ /_//____/ \____//_/ /_/ /_/ \____/____/|__/ WARNING: You are running this container as root, which can cause new files in mounted volumes to be created as the root user on your host machine. To avoid this, run the container by specifying your user's userid: $ docker run -u $(id -u):$(id -g) args... root@d14b2d062526:/STT# ``` In a separate terminal, you can see that you now have a Docker image running: ``` $ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES d14b2d062526 7cdc0bb1fe2a "/bin/bash" About a minute ago Up About a minute compassionate_rhodes ``` 🐸STT includes a number of convenience scripts in the `bin` directory. They are named for the corpus they are configured for. To ensure that your Docker environment is functioning correctly, run one of these scripts (in the terminal session where your container is running). ``` root@d14b2d062526:/STT/bin# ./bin/run-ldc93s1.sh ``` This will train on a single audio file for 200 epochs. We've now proved that the image is working correctly. ## Setting up a bind mount to store persistent data Now that we have a Docker image pulled down, we can create a _container_ from the image, and do training from within the image. However, Docker containers are not _persistent_. This means that if the host on which the container is running reboots, or there is a fatal error within the container, all the results stored _within_ the container will be lost. We need to set up _persistent storage_ so that the checkpoints and exported model are stored _outside_ the container. To do this we create a [bind mount](https://docs.docker.com/storage/bind-mounts/) for Docker. A _bind mount_ allows Docker to store files externally to the container, on your local filesystem. First, stop and remove the container we created above. ``` $ docker rm -f stt-test ``` Next, we will create a new container, except this time we will also create a _bind mount_ so that it can store persistent data. First, we create a directory on our local system for the bind mount. ``` $ mkdir stt-data ``` Next, we create a container and instruct it to use a bind mount to the directory. ``` $ docker run -it \ --entrypoint /bin/bash \ --name stt-train \ --gpus all \ --mount type=bind,source="$(pwd)"/stt-data,target=/STT/stt-data \ 7cdc0bb1fe2a ``` We all pass the `--gpus all` parameter here to instruct Docker to use all available GPUs. If you need to restrict the use of GPUs, then please consult the [Docker documentation](https://docs.docker.com/config/containers/resource_constraints/). You can also restrict the amount of memory or CPU(s) that the Docker container consumes. This might be useful if you need to use the host that you're training on _at the same time_ as the training is occurring, or if you're on a shared host or cluster (for example at a university). From within the container, the `stt-data` directory will now be available: ``` root@e964b1e5a60c:/STT# ls | grep stt-data stt-data ``` You are now ready to begin [training](TRAINING.md) your model. ## Extending the base `stt-train` Docker image for your needs As you become more comfortable training speech recognition models with 🐸STT, you may wish to extend the base Docker image. You can do this using the `FROM` instruction in a `Dockerfile`, for example: ``` # Custom Dockerfile for training models using 🐸STT # Get the latest 🐸STT image FROM ghcr.io/coqui-ai/stt-train:latest # Install nano editor RUN apt-get -y update && apt-get install -y nano # Install sox for inference and for processing Common Voice data RUN apt-get -y update && apt-get install -y sox ``` You can then use `docker build` with this `Dockerfile` to build your own custom Docker image. --- [Home](README.md) | [Previous - Acoustic Model and Language Model](AM_vs_LM.md) | [Next - Training your model](TRAINING.md)
0
coqui_public_repos/STT/native_client/ctcdecode/third_party/openfst-1.6.9-win/src/include/fst/extensions
coqui_public_repos/STT/native_client/ctcdecode/third_party/openfst-1.6.9-win/src/include/fst/extensions/far/sttable.h
// See www.openfst.org for extensive documentation on this weighted // finite-state transducer library. // // A generic string-to-type table file format. // // This is not meant as a generalization of SSTable. This is more of a simple // replacement for SSTable in order to provide an open-source implementation // of the FAR format for the external version of the FST library. #ifndef FST_EXTENSIONS_FAR_STTABLE_H_ #define FST_EXTENSIONS_FAR_STTABLE_H_ #include <algorithm> #include <istream> #include <memory> #include <fstream> #include <fst/util.h> namespace fst { static constexpr int32_t kSTTableMagicNumber = 2125656924; static constexpr int32_t kSTTableFileVersion = 1; // String-type table writing class for an object of type T using a functor // Writer. The Writer functor must provide at least the following interface: // // struct Writer { // void operator()(std::ostream &, const T &) const; // }; template <class T, class Writer> class STTableWriter { public: explicit STTableWriter(const string &filename) : stream_(filename, std::ios_base::out | std::ios_base::binary), error_(false) { WriteType(stream_, kSTTableMagicNumber); WriteType(stream_, kSTTableFileVersion); if (stream_.fail()) { FSTERROR() << "STTableWriter::STTableWriter: Error writing to file: " << filename; error_ = true; } } static STTableWriter<T, Writer> *Create(const string &filename) { if (filename.empty()) { LOG(ERROR) << "STTableWriter: Writing to standard out unsupported."; return nullptr; } return new STTableWriter<T, Writer>(filename); } void Add(const string &key, const T &t) { if (key == "") { FSTERROR() << "STTableWriter::Add: Key empty: " << key; error_ = true; } else if (key < last_key_) { FSTERROR() << "STTableWriter::Add: Key out of order: " << key; error_ = true; } if (error_) return; last_key_ = key; positions_.push_back(stream_.tellp()); WriteType(stream_, key); entry_writer_(stream_, t); } bool Error() const { return error_; } ~STTableWriter() { WriteType(stream_, positions_); WriteType(stream_, static_cast<int64_t>(positions_.size())); } private: Writer entry_writer_; std::ofstream stream_; std::vector<int64_t> positions_; // Position in file of each key-entry pair. string last_key_; // Last key. bool error_; STTableWriter(const STTableWriter &) = delete; STTableWriter &operator=(const STTableWriter &) = delete; }; // String-type table reading class for object of type T using a functor Reader. // Reader must provide at least the following interface: // // struct Reader { // T *operator()(std::istream &) const; // }; // template <class T, class Reader> class STTableReader { public: explicit STTableReader(const std::vector<string> &filenames) : sources_(filenames), error_(false) { compare_.reset(new Compare(&keys_)); keys_.resize(filenames.size()); streams_.resize(filenames.size(), 0); positions_.resize(filenames.size()); for (size_t i = 0; i < filenames.size(); ++i) { streams_[i] = new std::ifstream( filenames[i], std::ios_base::in | std::ios_base::binary); int32_t magic_number = 0; ReadType(*streams_[i], &magic_number); int32_t file_version = 0; ReadType(*streams_[i], &file_version); if (magic_number != kSTTableMagicNumber) { FSTERROR() << "STTableReader::STTableReader: Wrong file type: " << filenames[i]; error_ = true; return; } if (file_version != kSTTableFileVersion) { FSTERROR() << "STTableReader::STTableReader: Wrong file version: " << filenames[i]; error_ = true; return; } int64_t num_entries; streams_[i]->seekg(-static_cast<int>(sizeof(int64_t)), std::ios_base::end); ReadType(*streams_[i], &num_entries); if (num_entries > 0) { streams_[i]->seekg(-static_cast<int>(sizeof(int64_t)) * (num_entries + 1), std::ios_base::end); positions_[i].resize(num_entries); for (size_t j = 0; (j < num_entries) && (!streams_[i]->fail()); ++j) { ReadType(*streams_[i], &(positions_[i][j])); } streams_[i]->seekg(positions_[i][0]); if (streams_[i]->fail()) { FSTERROR() << "STTableReader::STTableReader: Error reading file: " << filenames[i]; error_ = true; return; } } } MakeHeap(); } ~STTableReader() { for (auto &stream : streams_) delete stream; } static STTableReader<T, Reader> *Open(const string &filename) { if (filename.empty()) { LOG(ERROR) << "STTableReader: Operation not supported on standard input"; return nullptr; } std::vector<string> filenames; filenames.push_back(filename); return new STTableReader<T, Reader>(filenames); } static STTableReader<T, Reader> *Open(const std::vector<string> &filenames) { return new STTableReader<T, Reader>(filenames); } void Reset() { if (error_) return; for (size_t i = 0; i < streams_.size(); ++i) streams_[i]->seekg(positions_[i].front()); MakeHeap(); } bool Find(const string &key) { if (error_) return false; for (size_t i = 0; i < streams_.size(); ++i) LowerBound(i, key); MakeHeap(); if (heap_.empty()) return false; return keys_[current_] == key; } bool Done() const { return error_ || heap_.empty(); } void Next() { if (error_) return; if (streams_[current_]->tellg() <= positions_[current_].back()) { ReadType(*(streams_[current_]), &(keys_[current_])); if (streams_[current_]->fail()) { FSTERROR() << "STTableReader: Error reading file: " << sources_[current_]; error_ = true; return; } std::push_heap(heap_.begin(), heap_.end(), *compare_); } else { heap_.pop_back(); } if (!heap_.empty()) PopHeap(); } const string &GetKey() const { return keys_[current_]; } const T *GetEntry() const { return entry_.get(); } bool Error() const { return error_; } private: // Comparison functor used to compare stream IDs in the heap. struct Compare { explicit Compare(const std::vector<string> *keys) : keys(keys) {} bool operator()(size_t i, size_t j) const { return (*keys)[i] > (*keys)[j]; }; private: const std::vector<string> *keys; }; // Positions the stream at the position corresponding to the lower bound for // the specified key. void LowerBound(size_t id, const string &find_key) { auto *strm = streams_[id]; const auto &positions = positions_[id]; if (positions.empty()) return; size_t low = 0; size_t high = positions.size() - 1; while (low < high) { size_t mid = (low + high) / 2; strm->seekg(positions[mid]); string key; ReadType(*strm, &key); if (key > find_key) { high = mid; } else if (key < find_key) { low = mid + 1; } else { for (size_t i = mid; i > low; --i) { strm->seekg(positions[i - 1]); ReadType(*strm, &key); if (key != find_key) { strm->seekg(positions[i]); return; } } strm->seekg(positions[low]); return; } } strm->seekg(positions[low]); } // Adds all streams to the heap. void MakeHeap() { heap_.clear(); for (size_t i = 0; i < streams_.size(); ++i) { if (positions_[i].empty()) continue; ReadType(*streams_[i], &(keys_[i])); if (streams_[i]->fail()) { FSTERROR() << "STTableReader: Error reading file: " << sources_[i]; error_ = true; return; } heap_.push_back(i); } if (heap_.empty()) return; std::make_heap(heap_.begin(), heap_.end(), *compare_); PopHeap(); } // Positions the stream with the lowest key at the top of the heap, sets // current_ to the ID of that stream, and reads the current entry from that // stream. void PopHeap() { std::pop_heap(heap_.begin(), heap_.end(), *compare_); current_ = heap_.back(); entry_.reset(entry_reader_(*streams_[current_])); if (!entry_) error_ = true; if (streams_[current_]->fail()) { FSTERROR() << "STTableReader: Error reading entry for key: " << keys_[current_] << ", file: " << sources_[current_]; error_ = true; } } Reader entry_reader_; std::vector<std::istream *> streams_; // Input streams. std::vector<string> sources_; // Corresponding file names. std::vector<std::vector<int64_t>> positions_; // Index of positions. std::vector<string> keys_; // Lowest unread key for each stream. std::vector<int64_t> heap_; // Heap containing ID of streams with unread keys. int64_t current_; // ID of current stream to be read. std::unique_ptr<Compare> compare_; // Functor comparing stream IDs. mutable std::unique_ptr<T> entry_; // The currently read entry. bool error_; }; // String-type table header reading function template on the entry header type. // The Header type must provide at least the following interface: // // struct Header { // void Read(std::istream &istrm, const string &filename); // }; template <class Header> bool ReadSTTableHeader(const string &filename, Header *header) { if (filename.empty()) { LOG(ERROR) << "ReadSTTable: Can't read header from standard input"; return false; } std::ifstream strm(filename, std::ios_base::in | std::ios_base::binary); if (!strm) { LOG(ERROR) << "ReadSTTableHeader: Could not open file: " << filename; return false; } int32_t magic_number = 0; ReadType(strm, &magic_number); int32_t file_version = 0; ReadType(strm, &file_version); if (magic_number != kSTTableMagicNumber) { LOG(ERROR) << "ReadSTTableHeader: Wrong file type: " << filename; return false; } if (file_version != kSTTableFileVersion) { LOG(ERROR) << "ReadSTTableHeader: Wrong file version: " << filename; return false; } int64_t i = -1; strm.seekg(-static_cast<int>(sizeof(int64_t)), std::ios_base::end); ReadType(strm, &i); // Reads number of entries if (strm.fail()) { LOG(ERROR) << "ReadSTTableHeader: Error reading file: " << filename; return false; } if (i == 0) return true; // No entry header to read. strm.seekg(-2 * static_cast<int>(sizeof(int64_t)), std::ios_base::end); ReadType(strm, &i); // Reads position for last entry in file. strm.seekg(i); string key; ReadType(strm, &key); header->Read(strm, filename + ":" + key); if (strm.fail()) { LOG(ERROR) << "ReadSTTableHeader: Error reading file: " << filename; return false; } return true; } bool IsSTTable(const string &filename); } // namespace fst #endif // FST_EXTENSIONS_FAR_STTABLE_H_
0
coqui_public_repos/inference-engine/third_party/openfst-1.6.7/src
coqui_public_repos/inference-engine/third_party/openfst-1.6.7/src/script/intersect.cc
// See www.openfst.org for extensive documentation on this weighted // finite-state transducer library. #include <fst/script/fst-class.h> #include <fst/script/intersect.h> #include <fst/script/script-impl.h> namespace fst { namespace script { void Intersect(const FstClass &ifst1, const FstClass &ifst2, MutableFstClass *ofst, const ComposeOptions &opts) { if (!internal::ArcTypesMatch(ifst1, ifst2, "Intersect") || !internal::ArcTypesMatch(*ofst, ifst1, "Intersect")) { ofst->SetProperties(kError, kError); return; } IntersectArgs args(ifst1, ifst2, ofst, opts); Apply<Operation<IntersectArgs>>("Intersect", ifst1.ArcType(), &args); } REGISTER_FST_OPERATION(Intersect, StdArc, IntersectArgs); REGISTER_FST_OPERATION(Intersect, LogArc, IntersectArgs); REGISTER_FST_OPERATION(Intersect, Log64Arc, IntersectArgs); } // namespace script } // namespace fst
0
coqui_public_repos/STT/native_client/ctcdecode/third_party/openfst-1.6.7/src/include/fst
coqui_public_repos/STT/native_client/ctcdecode/third_party/openfst-1.6.7/src/include/fst/script/fst-class.h
// See www.openfst.org for extensive documentation on this weighted // finite-state transducer library. #ifndef FST_SCRIPT_FST_CLASS_H_ #define FST_SCRIPT_FST_CLASS_H_ #include <algorithm> #include <limits> #include <string> #include <type_traits> #include <fst/expanded-fst.h> #include <fst/fst.h> #include <fst/mutable-fst.h> #include <fst/vector-fst.h> #include <fst/script/arc-class.h> #include <fst/script/weight-class.h> // Classes to support "boxing" all existing types of FST arcs in a single // FstClass which hides the arc types. This allows clients to load // and work with FSTs without knowing the arc type. These classes are only // recommended for use in high-level scripting applications. Most users should // use the lower-level templated versions corresponding to these classes. namespace fst { namespace script { // Abstract base class defining the set of functionalities implemented in all // impls and passed through by all bases. Below FstClassBase the class // hierarchy bifurcates; FstClassImplBase serves as the base class for all // implementations (of which FstClassImpl is currently the only one) and // FstClass serves as the base class for all interfaces. class FstClassBase { public: virtual const string &ArcType() const = 0; virtual WeightClass Final(int64) const = 0; virtual const string &FstType() const = 0; virtual const SymbolTable *InputSymbols() const = 0; virtual size_t NumArcs(int64) const = 0; virtual size_t NumInputEpsilons(int64) const = 0; virtual size_t NumOutputEpsilons(int64) const = 0; virtual const SymbolTable *OutputSymbols() const = 0; virtual uint64 Properties(uint64, bool) const = 0; virtual int64 Start() const = 0; virtual const string &WeightType() const = 0; virtual bool ValidStateId(int64) const = 0; virtual bool Write(const string &) const = 0; virtual bool Write(std::ostream &, const string &) const = 0; virtual ~FstClassBase() {} }; // Adds all the MutableFst methods. class FstClassImplBase : public FstClassBase { public: virtual bool AddArc(int64, const ArcClass &) = 0; virtual int64 AddState() = 0; virtual FstClassImplBase *Copy() = 0; virtual bool DeleteArcs(int64, size_t) = 0; virtual bool DeleteArcs(int64) = 0; virtual bool DeleteStates(const std::vector<int64> &) = 0; virtual void DeleteStates() = 0; virtual SymbolTable *MutableInputSymbols() = 0; virtual SymbolTable *MutableOutputSymbols() = 0; virtual int64 NumStates() const = 0; virtual bool ReserveArcs(int64, size_t) = 0; virtual void ReserveStates(int64) = 0; virtual void SetInputSymbols(SymbolTable *) = 0; virtual bool SetFinal(int64, const WeightClass &) = 0; virtual void SetOutputSymbols(SymbolTable *) = 0; virtual void SetProperties(uint64, uint64) = 0; virtual bool SetStart(int64) = 0; ~FstClassImplBase() override {} }; // Containiner class wrapping an Fst<Arc>, hiding its arc type. Whether this // Fst<Arc> pointer refers to a special kind of FST (e.g. a MutableFst) is // known by the type of interface class that owns the pointer to this // container. template <class Arc> class FstClassImpl : public FstClassImplBase { public: explicit FstClassImpl(Fst<Arc> *impl, bool should_own = false) : impl_(should_own ? impl : impl->Copy()) {} explicit FstClassImpl(const Fst<Arc> &impl) : impl_(impl.Copy()) {} // Warning: calling this method casts the FST to a mutable FST. bool AddArc(int64 s, const ArcClass &ac) final { if (!ValidStateId(s)) return false; // Note that we do not check that the destination state is valid, so users // can add arcs before they add the corresponding states. Verify can be // used to determine whether any arc has a nonexisting destination. Arc arc(ac.ilabel, ac.olabel, *ac.weight.GetWeight<typename Arc::Weight>(), ac.nextstate); static_cast<MutableFst<Arc> *>(impl_.get())->AddArc(s, arc); return true; } // Warning: calling this method casts the FST to a mutable FST. int64 AddState() final { return static_cast<MutableFst<Arc> *>(impl_.get())->AddState(); } const string &ArcType() const final { return Arc::Type(); } FstClassImpl *Copy() final { return new FstClassImpl<Arc>(impl_.get()); } // Warning: calling this method casts the FST to a mutable FST. bool DeleteArcs(int64 s, size_t n) final { if (!ValidStateId(s)) return false; static_cast<MutableFst<Arc> *>(impl_.get())->DeleteArcs(s, n); return true; } // Warning: calling this method casts the FST to a mutable FST. bool DeleteArcs(int64 s) final { if (!ValidStateId(s)) return false; static_cast<MutableFst<Arc> *>(impl_.get())->DeleteArcs(s); return true; } // Warning: calling this method casts the FST to a mutable FST. bool DeleteStates(const std::vector<int64> &dstates) final { for (const auto &state : dstates) if (!ValidStateId(state)) return false; // Warning: calling this method with any integers beyond the precision of // the underlying FST will result in truncation. std::vector<typename Arc::StateId> typed_dstates(dstates.size()); std::copy(dstates.begin(), dstates.end(), typed_dstates.begin()); static_cast<MutableFst<Arc> *>(impl_.get())->DeleteStates(typed_dstates); return true; } // Warning: calling this method casts the FST to a mutable FST. void DeleteStates() final { static_cast<MutableFst<Arc> *>(impl_.get())->DeleteStates(); } WeightClass Final(int64 s) const final { if (!ValidStateId(s)) return WeightClass::NoWeight(WeightType()); WeightClass w(impl_->Final(s)); return w; } const string &FstType() const final { return impl_->Type(); } const SymbolTable *InputSymbols() const final { return impl_->InputSymbols(); } // Warning: calling this method casts the FST to a mutable FST. SymbolTable *MutableInputSymbols() final { return static_cast<MutableFst<Arc> *>(impl_.get())->MutableInputSymbols(); } // Warning: calling this method casts the FST to a mutable FST. SymbolTable *MutableOutputSymbols() final { return static_cast<MutableFst<Arc> *>(impl_.get())->MutableOutputSymbols(); } // Signals failure by returning size_t max. size_t NumArcs(int64 s) const final { return ValidStateId(s) ? impl_->NumArcs(s) : std::numeric_limits<size_t>::max(); } // Signals failure by returning size_t max. size_t NumInputEpsilons(int64 s) const final { return ValidStateId(s) ? impl_->NumInputEpsilons(s) : std::numeric_limits<size_t>::max(); } // Signals failure by returning size_t max. size_t NumOutputEpsilons(int64 s) const final { return ValidStateId(s) ? impl_->NumOutputEpsilons(s) : std::numeric_limits<size_t>::max(); } // Warning: calling this method casts the FST to a mutable FST. int64 NumStates() const final { return static_cast<MutableFst<Arc> *>(impl_.get())->NumStates(); } uint64 Properties(uint64 mask, bool test) const final { return impl_->Properties(mask, test); } // Warning: calling this method casts the FST to a mutable FST. bool ReserveArcs(int64 s, size_t n) final { if (!ValidStateId(s)) return false; static_cast<MutableFst<Arc> *>(impl_.get())->ReserveArcs(s, n); return true; } // Warning: calling this method casts the FST to a mutable FST. void ReserveStates(int64 s) final { static_cast<MutableFst<Arc> *>(impl_.get())->ReserveStates(s); } const SymbolTable *OutputSymbols() const final { return impl_->OutputSymbols(); } // Warning: calling this method casts the FST to a mutable FST. void SetInputSymbols(SymbolTable *isyms) final { static_cast<MutableFst<Arc> *>(impl_.get())->SetInputSymbols(isyms); } // Warning: calling this method casts the FST to a mutable FST. bool SetFinal(int64 s, const WeightClass &weight) final { if (!ValidStateId(s)) return false; static_cast<MutableFst<Arc> *>(impl_.get()) ->SetFinal(s, *weight.GetWeight<typename Arc::Weight>()); return true; } // Warning: calling this method casts the FST to a mutable FST. void SetOutputSymbols(SymbolTable *osyms) final { static_cast<MutableFst<Arc> *>(impl_.get())->SetOutputSymbols(osyms); } // Warning: calling this method casts the FST to a mutable FST. void SetProperties(uint64 props, uint64 mask) final { static_cast<MutableFst<Arc> *>(impl_.get())->SetProperties(props, mask); } // Warning: calling this method casts the FST to a mutable FST. bool SetStart(int64 s) final { if (!ValidStateId(s)) return false; static_cast<MutableFst<Arc> *>(impl_.get())->SetStart(s); return true; } int64 Start() const final { return impl_->Start(); } bool ValidStateId(int64 s) const final { // This cowardly refuses to count states if the FST is not yet expanded. if (!Properties(kExpanded, true)) { FSTERROR() << "Cannot get number of states for unexpanded FST"; return false; } // If the FST is already expanded, CountStates calls NumStates. if (s < 0 || s >= CountStates(*impl_)) { FSTERROR() << "State ID " << s << " not valid"; return false; } return true; } const string &WeightType() const final { return Arc::Weight::Type(); } bool Write(const string &fname) const final { return impl_->Write(fname); } bool Write(std::ostream &ostr, const string &fname) const final { const FstWriteOptions opts(fname); return impl_->Write(ostr, opts); } ~FstClassImpl() override {} Fst<Arc> *GetImpl() const { return impl_.get(); } private: std::unique_ptr<Fst<Arc>> impl_; }; // BASE CLASS DEFINITIONS class MutableFstClass; class FstClass : public FstClassBase { public: FstClass() : impl_(nullptr) {} template <class Arc> explicit FstClass(const Fst<Arc> &fst) : impl_(new FstClassImpl<Arc>(fst)) {} FstClass(const FstClass &other) : impl_(other.impl_ == nullptr ? nullptr : other.impl_->Copy()) {} FstClass &operator=(const FstClass &other) { impl_.reset(other.impl_ == nullptr ? nullptr : other.impl_->Copy()); return *this; } WeightClass Final(int64 s) const final { return impl_->Final(s); } const string &ArcType() const final { return impl_->ArcType(); } const string &FstType() const final { return impl_->FstType(); } const SymbolTable *InputSymbols() const final { return impl_->InputSymbols(); } size_t NumArcs(int64 s) const final { return impl_->NumArcs(s); } size_t NumInputEpsilons(int64 s) const final { return impl_->NumInputEpsilons(s); } size_t NumOutputEpsilons(int64 s) const final { return impl_->NumOutputEpsilons(s); } const SymbolTable *OutputSymbols() const final { return impl_->OutputSymbols(); } uint64 Properties(uint64 mask, bool test) const final { // Special handling for FSTs with a null impl. if (!impl_) return kError & mask; return impl_->Properties(mask, test); } static FstClass *Read(const string &fname); static FstClass *Read(std::istream &istrm, const string &source); int64 Start() const final { return impl_->Start(); } bool ValidStateId(int64 s) const final { return impl_->ValidStateId(s); } const string &WeightType() const final { return impl_->WeightType(); } // Helper that logs an ERROR if the weight type of an FST and a WeightClass // don't match. bool WeightTypesMatch(const WeightClass &weight, const string &op_name) const; bool Write(const string &fname) const final { return impl_->Write(fname); } bool Write(std::ostream &ostr, const string &fname) const final { return impl_->Write(ostr, fname); } ~FstClass() override {} // These methods are required by IO registration. template <class Arc> static FstClassImplBase *Convert(const FstClass &other) { FSTERROR() << "Doesn't make sense to convert any class to type FstClass"; return nullptr; } template <class Arc> static FstClassImplBase *Create() { FSTERROR() << "Doesn't make sense to create an FstClass with a " << "particular arc type"; return nullptr; } template <class Arc> const Fst<Arc> *GetFst() const { if (Arc::Type() != ArcType()) { return nullptr; } else { FstClassImpl<Arc> *typed_impl = static_cast<FstClassImpl<Arc> *>(impl_.get()); return typed_impl->GetImpl(); } } template <class Arc> static FstClass *Read(std::istream &stream, const FstReadOptions &opts) { if (!opts.header) { LOG(ERROR) << "FstClass::Read: Options header not specified"; return nullptr; } const FstHeader &hdr = *opts.header; if (hdr.Properties() & kMutable) { return ReadTypedFst<MutableFstClass, MutableFst<Arc>>(stream, opts); } else { return ReadTypedFst<FstClass, Fst<Arc>>(stream, opts); } } protected: explicit FstClass(FstClassImplBase *impl) : impl_(impl) {} const FstClassImplBase *GetImpl() const { return impl_.get(); } FstClassImplBase *GetImpl() { return impl_.get(); } // Generic template method for reading an arc-templated FST of type // UnderlyingT, and returning it wrapped as FstClassT, with appropriat // error checking. Called from arc-templated Read() static methods. template <class FstClassT, class UnderlyingT> static FstClassT *ReadTypedFst(std::istream &stream, const FstReadOptions &opts) { std::unique_ptr<UnderlyingT> u(UnderlyingT::Read(stream, opts)); return u ? new FstClassT(*u) : nullptr; } private: std::unique_ptr<FstClassImplBase> impl_; }; // Specific types of FstClass with special properties class MutableFstClass : public FstClass { public: bool AddArc(int64 s, const ArcClass &ac) { if (!WeightTypesMatch(ac.weight, "AddArc")) return false; return GetImpl()->AddArc(s, ac); } int64 AddState() { return GetImpl()->AddState(); } bool DeleteArcs(int64 s, size_t n) { return GetImpl()->DeleteArcs(s, n); } bool DeleteArcs(int64 s) { return GetImpl()->DeleteArcs(s); } bool DeleteStates(const std::vector<int64> &dstates) { return GetImpl()->DeleteStates(dstates); } void DeleteStates() { GetImpl()->DeleteStates(); } SymbolTable *MutableInputSymbols() { return GetImpl()->MutableInputSymbols(); } SymbolTable *MutableOutputSymbols() { return GetImpl()->MutableOutputSymbols(); } int64 NumStates() const { return GetImpl()->NumStates(); } bool ReserveArcs(int64 s, size_t n) { return GetImpl()->ReserveArcs(s, n); } void ReserveStates(int64 s) { GetImpl()->ReserveStates(s); } static MutableFstClass *Read(const string &fname, bool convert = false); void SetInputSymbols(SymbolTable *isyms) { GetImpl()->SetInputSymbols(isyms); } bool SetFinal(int64 s, const WeightClass &weight) { if (!WeightTypesMatch(weight, "SetFinal")) return false; return GetImpl()->SetFinal(s, weight); } void SetOutputSymbols(SymbolTable *osyms) { GetImpl()->SetOutputSymbols(osyms); } void SetProperties(uint64 props, uint64 mask) { GetImpl()->SetProperties(props, mask); } bool SetStart(int64 s) { return GetImpl()->SetStart(s); } template <class Arc> explicit MutableFstClass(const MutableFst<Arc> &fst) : FstClass(fst) {} // These methods are required by IO registration. template <class Arc> static FstClassImplBase *Convert(const FstClass &other) { FSTERROR() << "Doesn't make sense to convert any class to type " << "MutableFstClass"; return nullptr; } template <class Arc> static FstClassImplBase *Create() { FSTERROR() << "Doesn't make sense to create a MutableFstClass with a " << "particular arc type"; return nullptr; } template <class Arc> MutableFst<Arc> *GetMutableFst() { Fst<Arc> *fst = const_cast<Fst<Arc> *>(this->GetFst<Arc>()); MutableFst<Arc> *mfst = static_cast<MutableFst<Arc> *>(fst); return mfst; } template <class Arc> static MutableFstClass *Read(std::istream &stream, const FstReadOptions &opts) { std::unique_ptr<MutableFst<Arc>> mfst(MutableFst<Arc>::Read(stream, opts)); return mfst ? new MutableFstClass(*mfst) : nullptr; } protected: explicit MutableFstClass(FstClassImplBase *impl) : FstClass(impl) {} }; class VectorFstClass : public MutableFstClass { public: explicit VectorFstClass(FstClassImplBase *impl) : MutableFstClass(impl) {} explicit VectorFstClass(const FstClass &other); explicit VectorFstClass(const string &arc_type); static VectorFstClass *Read(const string &fname); template <class Arc> static VectorFstClass *Read(std::istream &stream, const FstReadOptions &opts) { std::unique_ptr<VectorFst<Arc>> mfst(VectorFst<Arc>::Read(stream, opts)); return mfst ? new VectorFstClass(*mfst) : nullptr; } template <class Arc> explicit VectorFstClass(const VectorFst<Arc> &fst) : MutableFstClass(fst) {} template <class Arc> static FstClassImplBase *Convert(const FstClass &other) { return new FstClassImpl<Arc>(new VectorFst<Arc>(*other.GetFst<Arc>()), true); } template <class Arc> static FstClassImplBase *Create() { return new FstClassImpl<Arc>(new VectorFst<Arc>(), true); } }; } // namespace script } // namespace fst #endif // FST_SCRIPT_FST_CLASS_H_
0
coqui_public_repos/inference-engine/third_party/openfst-1.6.7/src/include/fst/extensions
coqui_public_repos/inference-engine/third_party/openfst-1.6.7/src/include/fst/extensions/pdt/reverse.h
// See www.openfst.org for extensive documentation on this weighted // finite-state transducer library. // // Expands a PDT to an FST. #ifndef FST_EXTENSIONS_PDT_REVERSE_H_ #define FST_EXTENSIONS_PDT_REVERSE_H_ #include <vector> #include <fst/mutable-fst.h> #include <fst/relabel.h> #include <fst/reverse.h> namespace fst { // Reverses a pushdown transducer (PDT) encoded as an FST. template <class Arc, class RevArc> void Reverse(const Fst<Arc> &ifst, const std::vector< std::pair<typename Arc::Label, typename Arc::Label>> &parens, MutableFst<RevArc> *ofst) { using Label = typename Arc::Label; // Reverses FST component. Reverse(ifst, ofst); // Exchanges open and close parenthesis pairs. std::vector<std::pair<Label, Label>> relabel_pairs; relabel_pairs.reserve(2 * parens.size()); for (const auto &pair : parens) { relabel_pairs.emplace_back(pair.first, pair.second); relabel_pairs.emplace_back(pair.second, pair.first); } Relabel(ofst, relabel_pairs, relabel_pairs); } } // namespace fst #endif // FST_EXTENSIONS_PDT_REVERSE_H_
0
coqui_public_repos/inference-engine/third_party
coqui_public_repos/inference-engine/third_party/onnxruntime/VERSION_NUMBER
1.8.0
0
coqui_public_repos/inference-engine/third_party
coqui_public_repos/inference-engine/third_party/openfst-1.6.7/config.sub
#! /bin/sh # Configuration validation subroutine script. # Copyright 1992-2013 Free Software Foundation, Inc. timestamp='2013-08-10' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see <http://www.gnu.org/licenses/>. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # Please send patches with a ChangeLog entry to config-patches@gnu.org. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to <config-patches@gnu.org>." version="\ GNU config.sub ($timestamp) Copyright 1992-2013 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ knetbsd*-gnu* | netbsd*-gnu* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; android-linux) os=-linux-android basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray | -microblaze*) os= basic_machine=$1 ;; -bluegene*) os=-cnk ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*178) os=-lynxos178 ;; -lynx*5) os=-lynxos5 ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | aarch64 | aarch64_be \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arceb \ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ | avr | avr32 \ | be32 | be64 \ | bfin \ | c4x | c8051 | clipper \ | d10v | d30v | dlx | dsp16xx \ | epiphany \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ | mips64r5900 | mips64r5900el \ | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipsr5900 | mipsr5900el \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nds32 | nds32le | nds32be \ | nios | nios2 | nios2eb | nios2el \ | ns16k | ns32k \ | open8 \ | or1k | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ | rl78 | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu \ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | we32k \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; c54x) basic_machine=tic54x-unknown ;; c55x) basic_machine=tic55x-unknown ;; c6x) basic_machine=tic6x-unknown ;; m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip) basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; strongarm | thumb | xscale) basic_machine=arm-unknown ;; xgate) basic_machine=$basic_machine-unknown os=-none ;; xscaleeb) basic_machine=armeb-unknown ;; xscaleel) basic_machine=armel-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | c8051-* | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | hexagon-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ | microblaze-* | microblazeel-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ | mips64r5900-* | mips64r5900el-* \ | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipsr5900-* | mipsr5900el-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* | nios2eb-* | nios2el-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pyramid-* \ | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile*-* \ | tron-* \ | ubicom32-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) basic_machine=$basic_machine-unknown ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aros) basic_machine=i386-pc os=-aros ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; blackfin) basic_machine=bfin-unknown os=-linux ;; blackfin-*) basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; bluegene*) basic_machine=powerpc-ibm os=-cnk ;; c54x-*) basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c55x-*) basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c6x-*) basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c90) basic_machine=c90-cray os=-unicos ;; cegcc) basic_machine=arm-unknown os=-cegcc ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16 | cr16-*) basic_machine=cr16-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dicos) basic_machine=i686-pc os=-dicos ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; microblaze*) basic_machine=microblaze-xilinx ;; mingw64) basic_machine=x86_64-pc os=-mingw64 ;; mingw32) basic_machine=i686-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; msys) basic_machine=i686-pc os=-msys ;; mvs) basic_machine=i370-ibm os=-mvs ;; nacl) basic_machine=le32-unknown os=-nacl ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; neo-tandem) basic_machine=neo-tandem ;; nse-tandem) basic_machine=nse-tandem ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; parisc) basic_machine=hppa-unknown os=-linux ;; parisc-*) basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc | ppcbe) basic_machine=powerpc-unknown ;; ppc-* | ppcbe-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos | rdos64) basic_machine=x86_64-pc os=-rdos ;; rdos32) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh5el) basic_machine=sh5le-unknown ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; strongarm-* | thumb-*) basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tile*) basic_machine=$basic_machine-unknown os=-linux-gnu ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; xscale-* | xscalee[bl]-*) basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; z80-*-coff) basic_machine=z80-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -auroraux) os=-auroraux ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* | -plan9* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -bitrig* | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-musl* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -zvmoe) os=-zvmoe ;; -dicos*) os=-dicos ;; -nacl*) ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; c8051-*) os=-elf ;; hexagon-*) os=-elf ;; tic54x-*) os=-coff ;; tic55x-*) os=-coff ;; tic6x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or1k-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -cnk*|-aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End:
0
coqui_public_repos/TTS
coqui_public_repos/TTS/dockerfiles/Dockerfile.dev
ARG BASE=nvidia/cuda:11.8.0-base-ubuntu22.04 FROM ${BASE} # Install OS dependencies: RUN apt-get update && apt-get upgrade -y RUN apt-get install -y --no-install-recommends \ gcc g++ \ make \ python3 python3-dev python3-pip python3-venv python3-wheel \ espeak-ng libsndfile1-dev \ && rm -rf /var/lib/apt/lists/* # Install Major Python Dependencies: RUN pip3 install llvmlite --ignore-installed RUN pip3 install torch torchaudio --extra-index-url https://download.pytorch.org/whl/cu118 RUN rm -rf /root/.cache/pip WORKDIR /root # Copy Dependency Lock Files: COPY \ Makefile \ pyproject.toml \ setup.py \ requirements.dev.txt \ requirements.ja.txt \ requirements.notebooks.txt \ requirements.txt \ /root/ # Install Project Dependencies # Separate stage to limit re-downloading: RUN pip install \ -r requirements.txt \ -r requirements.dev.txt \ -r requirements.ja.txt \ -r requirements.notebooks.txt # Copy TTS repository contents: COPY . /root # Installing the TTS package itself: RUN make install
0
coqui_public_repos/STT/native_client/ctcdecode/third_party/openfst-1.6.7/src
coqui_public_repos/STT/native_client/ctcdecode/third_party/openfst-1.6.7/src/lib/flags.cc
// Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // Google-style flag handling definitions. #include <fst/compat.h> #include <fst/flags.h> static const char *private_tmpdir = getenv("TMPDIR"); DEFINE_int32(v, 0, "verbosity level"); DEFINE_bool(help, false, "show usage information"); DEFINE_bool(helpshort, false, "show brief usage information"); DEFINE_string(tmpdir, private_tmpdir ? private_tmpdir : "/tmp", "temporary directory"); using namespace std; static string flag_usage; static string prog_src; void SetFlags(const char *usage, int *argc, char ***argv, bool remove_flags, const char *src) { flag_usage = usage; prog_src = src; int index = 1; for (; index < *argc; ++index) { string argval = (*argv)[index]; if (argval[0] != '-' || argval == "-") break; while (argval[0] == '-') argval = argval.substr(1); // Removes initial '-'. string arg = argval; string val = ""; // Splits argval (arg=val) into arg and val. auto pos = argval.find("="); if (pos != string::npos) { arg = argval.substr(0, pos); val = argval.substr(pos + 1); } auto bool_register = FlagRegister<bool>::GetRegister(); if (bool_register->SetFlag(arg, val)) continue; auto string_register = FlagRegister<string>::GetRegister(); if (string_register->SetFlag(arg, val)) continue; auto int32_register = FlagRegister<int32>::GetRegister(); if (int32_register->SetFlag(arg, val)) continue; auto int64_register = FlagRegister<int64>::GetRegister(); if (int64_register->SetFlag(arg, val)) continue; auto double_register = FlagRegister<double>::GetRegister(); if (double_register->SetFlag(arg, val)) continue; LOG(FATAL) << "SetFlags: Bad option: " << (*argv)[index]; } if (remove_flags) { for (auto i = 0; i < *argc - index; ++i) { (*argv)[i + 1] = (*argv)[i + index]; } *argc -= index - 1; } if (FLAGS_help) { ShowUsage(true); exit(1); } if (FLAGS_helpshort) { ShowUsage(false); exit(1); } } // If flag is defined in file 'src' and 'in_src' true or is not // defined in file 'src' and 'in_src' is false, then print usage. static void ShowUsageRestrict(const std::set<pair<string, string>> &usage_set, const string &src, bool in_src, bool show_file) { string old_file; bool file_out = false; bool usage_out = false; for (const auto &pair : usage_set) { const auto &file = pair.first; const auto &usage = pair.second; bool match = file == src; if ((match && !in_src) || (!match && in_src)) continue; if (file != old_file) { if (show_file) { if (file_out) cout << "\n"; cout << "Flags from: " << file << "\n"; file_out = true; } old_file = file; } cout << usage << "\n"; usage_out = true; } if (usage_out) cout << "\n"; } void ShowUsage(bool long_usage) { std::set<pair<string, string>> usage_set; cout << flag_usage << "\n"; auto bool_register = FlagRegister<bool>::GetRegister(); bool_register->GetUsage(&usage_set); auto string_register = FlagRegister<string>::GetRegister(); string_register->GetUsage(&usage_set); auto int32_register = FlagRegister<int32>::GetRegister(); int32_register->GetUsage(&usage_set); auto int64_register = FlagRegister<int64>::GetRegister(); int64_register->GetUsage(&usage_set); auto double_register = FlagRegister<double>::GetRegister(); double_register->GetUsage(&usage_set); if (!prog_src.empty()) { cout << "PROGRAM FLAGS:\n\n"; ShowUsageRestrict(usage_set, prog_src, true, false); } if (!long_usage) return; if (!prog_src.empty()) cout << "LIBRARY FLAGS:\n\n"; ShowUsageRestrict(usage_set, prog_src, false, true); }
0
coqui_public_repos/STT-models/mixtec/jemeyer
coqui_public_repos/STT-models/mixtec/jemeyer/v1.0.0/LICENSE
https://creativecommons.org/licenses/by-nc-sa/3.0/
0
coqui_public_repos/STT/native_client/ctcdecode/third_party/openfst-1.6.9-win/src
coqui_public_repos/STT/native_client/ctcdecode/third_party/openfst-1.6.9-win/src/bin/fstcompile-main.cc
// See www.openfst.org for extensive documentation on this weighted // finite-state transducer library. // // Creates binary FSTs from simple text format used by AT&T. #include <cstring> #include <fstream> #include <istream> #include <memory> #include <string> #include <fst/flags.h> #include <fst/log.h> #include <fst/script/compile.h> DECLARE_bool(acceptor); DECLARE_string(arc_type); DECLARE_string(fst_type); DECLARE_string(isymbols); DECLARE_string(osymbols); DECLARE_string(ssymbols); DECLARE_bool(keep_isymbols); DECLARE_bool(keep_osymbols); DECLARE_bool(keep_state_numbering); DECLARE_bool(allow_negative_labels); int fstcompile_main(int argc, char **argv) { namespace s = fst::script; using fst::SymbolTable; using fst::SymbolTableTextOptions; string usage = "Creates binary FSTs from simple text format.\n\n Usage: "; usage += argv[0]; usage += " [text.fst [binary.fst]]\n"; std::set_new_handler(FailedNewHandler); SET_FLAGS(usage.c_str(), &argc, &argv, true); if (argc > 3) { ShowUsage(); return 1; } string source = "standard input"; std::ifstream fstrm; if (argc > 1 && strcmp(argv[1], "-") != 0) { fstrm.open(argv[1]); if (!fstrm) { LOG(ERROR) << argv[0] << ": Open failed, file = " << argv[1]; return 1; } source = argv[1]; } std::istream &istrm = fstrm.is_open() ? fstrm : std::cin; const SymbolTableTextOptions opts(FLAGS_allow_negative_labels); std::unique_ptr<const SymbolTable> isyms; if (!FLAGS_isymbols.empty()) { isyms.reset(SymbolTable::ReadText(FLAGS_isymbols, opts)); if (!isyms) return 1; } std::unique_ptr<const SymbolTable> osyms; if (!FLAGS_osymbols.empty()) { osyms.reset(SymbolTable::ReadText(FLAGS_osymbols, opts)); if (!osyms) return 1; } std::unique_ptr<const SymbolTable> ssyms; if (!FLAGS_ssymbols.empty()) { ssyms.reset(SymbolTable::ReadText(FLAGS_ssymbols)); if (!ssyms) return 1; } const string dest = argc > 2 ? argv[2] : ""; s::CompileFst(istrm, source, dest, FLAGS_fst_type, FLAGS_arc_type, isyms.get(), osyms.get(), ssyms.get(), FLAGS_acceptor, FLAGS_keep_isymbols, FLAGS_keep_osymbols, FLAGS_keep_state_numbering, FLAGS_allow_negative_labels); return 0; }
0
coqui_public_repos/inference-engine/third_party/cereal/include/cereal
coqui_public_repos/inference-engine/third_party/cereal/include/cereal/details/helpers.hpp
/*! \file helpers.hpp \brief Internal helper functionality \ingroup Internal */ /* Copyright (c) 2014, Randolph Voorhies, Shane Grant All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of cereal nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RANDOLPH VOORHIES OR SHANE GRANT BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef CEREAL_DETAILS_HELPERS_HPP_ #define CEREAL_DETAILS_HELPERS_HPP_ #include <type_traits> #include <cstdint> #include <utility> #include <memory> #include <unordered_map> #include <stdexcept> #include "cereal/macros.hpp" #include "cereal/details/static_object.hpp" namespace cereal { // ###################################################################### //! An exception class thrown when things go wrong at runtime /*! @ingroup Utility */ struct Exception : public std::runtime_error { explicit Exception( const std::string & what_ ) : std::runtime_error(what_) {} explicit Exception( const char * what_ ) : std::runtime_error(what_) {} }; // ###################################################################### //! The size type used by cereal /*! To ensure compatability between 32, 64, etc bit machines, we need to use a fixed size type instead of size_t, which may vary from machine to machine. The default value for CEREAL_SIZE_TYPE is specified in cereal/macros.hpp */ using size_type = CEREAL_SIZE_TYPE; // forward decls class BinaryOutputArchive; class BinaryInputArchive; // ###################################################################### namespace detail { struct NameValuePairCore {}; //!< Traits struct for NVPs struct DeferredDataCore {}; //!< Traits struct for DeferredData } // ###################################################################### //! For holding name value pairs /*! This pairs a name (some string) with some value such that an archive can potentially take advantage of the pairing. In serialization functions, NameValuePairs are usually created like so: @code{.cpp} struct MyStruct { int a, b, c, d, e; template<class Archive> void serialize(Archive & archive) { archive( CEREAL_NVP(a), CEREAL_NVP(b), CEREAL_NVP(c), CEREAL_NVP(d), CEREAL_NVP(e) ); } }; @endcode Alternatively, you can give you data members custom names like so: @code{.cpp} struct MyStruct { int a, b, my_embarrassing_variable_name, d, e; template<class Archive> void serialize(Archive & archive) { archive( CEREAL_NVP(a), CEREAL_NVP(b), cereal::make_nvp("var", my_embarrassing_variable_name) ); CEREAL_NVP(d), CEREAL_NVP(e) ); } }; @endcode There is a slight amount of overhead to creating NameValuePairs, so there is a third method which will elide the names when they are not used by the Archive: @code{.cpp} struct MyStruct { int a, b; template<class Archive> void serialize(Archive & archive) { archive( cereal::make_nvp<Archive>(a), cereal::make_nvp<Archive>(b) ); } }; @endcode This third method is generally only used when providing generic type support. Users writing their own serialize functions will normally explicitly control whether they want to use NVPs or not. @internal */ template <class T> class NameValuePair : detail::NameValuePairCore { private: // If we get passed an array, keep the type as is, otherwise store // a reference if we were passed an l value reference, else copy the value using Type = typename std::conditional<std::is_array<typename std::remove_reference<T>::type>::value, typename std::remove_cv<T>::type, typename std::conditional<std::is_lvalue_reference<T>::value, T, typename std::decay<T>::type>::type>::type; // prevent nested nvps static_assert( !std::is_base_of<detail::NameValuePairCore, T>::value, "Cannot pair a name to a NameValuePair" ); NameValuePair & operator=( NameValuePair const & ) = delete; public: //! Constructs a new NameValuePair /*! @param n The name of the pair @param v The value to pair. Ideally this should be an l-value reference so that the value can be both loaded and saved to. If you pass an r-value reference, the NameValuePair will store a copy of it instead of a reference. Thus you should only pass r-values in cases where this makes sense, such as the result of some size() call. @internal */ NameValuePair( char const * n, T && v ) : name(n), value(std::forward<T>(v)) {} char const * name; Type value; }; //! A specialization of make_nvp<> that simply forwards the value for binary archives /*! @relates NameValuePair @internal */ template<class Archive, class T> inline typename std::enable_if<std::is_same<Archive, ::cereal::BinaryInputArchive>::value || std::is_same<Archive, ::cereal::BinaryOutputArchive>::value, T && >::type make_nvp( const char *, T && value ) { return std::forward<T>(value); } //! A specialization of make_nvp<> that actually creates an nvp for non-binary archives /*! @relates NameValuePair @internal */ template<class Archive, class T> inline typename std::enable_if<!std::is_same<Archive, ::cereal::BinaryInputArchive>::value && !std::is_same<Archive, ::cereal::BinaryOutputArchive>::value, NameValuePair<T> >::type make_nvp( const char * name, T && value) { return {name, std::forward<T>(value)}; } //! Convenience for creating a templated NVP /*! For use in internal generic typing functions which have an Archive type declared @internal */ #define CEREAL_NVP_(name, value) ::cereal::make_nvp<Archive>(name, value) // ###################################################################### //! A wrapper around data that can be serialized in a binary fashion /*! This class is used to demarcate data that can safely be serialized as a binary chunk of data. Individual archives can then choose how best represent this during serialization. @internal */ template <class T> struct BinaryData { //! Internally store the pointer as a void *, keeping const if created with //! a const pointer using PT = typename std::conditional<std::is_const<typename std::remove_pointer<typename std::remove_reference<T>::type>::type>::value, const void *, void *>::type; BinaryData( T && d, uint64_t s ) : data(std::forward<T>(d)), size(s) {} PT data; //!< pointer to beginning of data uint64_t size; //!< size in bytes }; // ###################################################################### //! A wrapper around data that should be serialized after all non-deferred data /*! This class is used to demarcate data that can only be safely serialized after any data not wrapped in this class. @internal */ template <class T> class DeferredData : detail::DeferredDataCore { private: // If we get passed an array, keep the type as is, otherwise store // a reference if we were passed an l value reference, else copy the value using Type = typename std::conditional<std::is_array<typename std::remove_reference<T>::type>::value, typename std::remove_cv<T>::type, typename std::conditional<std::is_lvalue_reference<T>::value, T, typename std::decay<T>::type>::type>::type; // prevent nested nvps static_assert( !std::is_base_of<detail::DeferredDataCore, T>::value, "Cannot defer DeferredData" ); DeferredData & operator=( DeferredData const & ) = delete; public: //! Constructs a new NameValuePair /*! @param v The value to defer. Ideally this should be an l-value reference so that the value can be both loaded and saved to. If you pass an r-value reference, the DeferredData will store a copy of it instead of a reference. Thus you should only pass r-values in cases where this makes sense, such as the result of some size() call. @internal */ DeferredData( T && v ) : value(std::forward<T>(v)) {} Type value; }; // ###################################################################### namespace detail { // base classes for type checking /* The rtti virtual function only exists to enable an archive to be used in a polymorphic fashion, if necessary. See the archive adapters for an example of this */ class OutputArchiveBase { public: OutputArchiveBase() = default; OutputArchiveBase( OutputArchiveBase && ) CEREAL_NOEXCEPT {} OutputArchiveBase & operator=( OutputArchiveBase && ) CEREAL_NOEXCEPT { return *this; } virtual ~OutputArchiveBase() CEREAL_NOEXCEPT = default; private: virtual void rtti() {} }; class InputArchiveBase { public: InputArchiveBase() = default; InputArchiveBase( InputArchiveBase && ) CEREAL_NOEXCEPT {} InputArchiveBase & operator=( InputArchiveBase && ) CEREAL_NOEXCEPT { return *this; } virtual ~InputArchiveBase() CEREAL_NOEXCEPT = default; private: virtual void rtti() {} }; // forward decls for polymorphic support template <class Archive, class T> struct polymorphic_serialization_support; struct adl_tag; // used during saving pointers static const uint32_t msb_32bit = 0x80000000; static const int32_t msb2_32bit = 0x40000000; } // ###################################################################### //! A wrapper around size metadata /*! This class provides a way for archives to have more flexibility over how they choose to serialize size metadata for containers. For some archive types, the size may be implicitly encoded in the output (e.g. JSON) and not need an explicit entry. Specializing serialize or load/save for your archive and SizeTags allows you to choose what happens. @internal */ template <class T> class SizeTag { private: // Store a reference if passed an lvalue reference, otherwise // make a copy of the data using Type = typename std::conditional<std::is_lvalue_reference<T>::value, T, typename std::decay<T>::type>::type; SizeTag & operator=( SizeTag const & ) = delete; public: SizeTag( T && sz ) : size(std::forward<T>(sz)) {} Type size; }; // ###################################################################### //! A wrapper around a key and value for serializing data into maps. /*! This class just provides a grouping of keys and values into a struct for human readable archives. For example, XML archives will use this wrapper to write maps like so: @code{.xml} <mymap> <item0> <key>MyFirstKey</key> <value>MyFirstValue</value> </item0> <item1> <key>MySecondKey</key> <value>MySecondValue</value> </item1> </mymap> @endcode \sa make_map_item @internal */ template <class Key, class Value> struct MapItem { using KeyType = typename std::conditional< std::is_lvalue_reference<Key>::value, Key, typename std::decay<Key>::type>::type; using ValueType = typename std::conditional< std::is_lvalue_reference<Value>::value, Value, typename std::decay<Value>::type>::type; //! Construct a MapItem from a key and a value /*! @internal */ MapItem( Key && key_, Value && value_ ) : key(std::forward<Key>(key_)), value(std::forward<Value>(value_)) {} MapItem & operator=( MapItem const & ) = delete; KeyType key; ValueType value; //! Serialize the MapItem with the NVPs "key" and "value" template <class Archive> inline void CEREAL_SERIALIZE_FUNCTION_NAME(Archive & archive) { archive( make_nvp<Archive>("key", key), make_nvp<Archive>("value", value) ); } }; //! Create a MapItem so that human readable archives will group keys and values together /*! @internal @relates MapItem */ template <class KeyType, class ValueType> inline MapItem<KeyType, ValueType> make_map_item(KeyType && key, ValueType && value) { return {std::forward<KeyType>(key), std::forward<ValueType>(value)}; } namespace detail { //! Tag for Version, which due to its anonymous namespace, becomes a different //! type in each translation unit /*! This allows CEREAL_CLASS_VERSION to be safely called in a header file */ namespace{ struct version_binding_tag {}; } // ###################################################################### //! Version information class /*! This is the base case for classes that have not been explicitly registered */ template <class T, class BindingTag = version_binding_tag> struct Version { static const std::uint32_t version = 0; // we don't need to explicitly register these types since they // always get a version number of 0 }; //! Holds all registered version information struct Versions { std::unordered_map<std::size_t, std::uint32_t> mapping; std::uint32_t find( std::size_t hash, std::uint32_t version ) { const auto result = mapping.emplace( hash, version ); return result.first->second; } }; // struct Versions } // namespace detail } // namespace cereal #endif // CEREAL_DETAILS_HELPERS_HPP_
0
coqui_public_repos/TTS/TTS/tts/layers
coqui_public_repos/TTS/TTS/tts/layers/overflow/decoder.py
import torch from torch import nn from TTS.tts.layers.glow_tts.decoder import Decoder as GlowDecoder from TTS.tts.utils.helpers import sequence_mask class Decoder(nn.Module): """Uses glow decoder with some modifications. :: Squeeze -> ActNorm -> InvertibleConv1x1 -> AffineCoupling -> Unsqueeze Args: in_channels (int): channels of input tensor. hidden_channels (int): hidden decoder channels. kernel_size (int): Coupling block kernel size. (Wavenet filter kernel size.) dilation_rate (int): rate to increase dilation by each layer in a decoder block. num_flow_blocks (int): number of decoder blocks. num_coupling_layers (int): number coupling layers. (number of wavenet layers.) dropout_p (float): wavenet dropout rate. sigmoid_scale (bool): enable/disable sigmoid scaling in coupling layer. """ def __init__( self, in_channels, hidden_channels, kernel_size, dilation_rate, num_flow_blocks, num_coupling_layers, dropout_p=0.0, num_splits=4, num_squeeze=2, sigmoid_scale=False, c_in_channels=0, ): super().__init__() self.glow_decoder = GlowDecoder( in_channels, hidden_channels, kernel_size, dilation_rate, num_flow_blocks, num_coupling_layers, dropout_p, num_splits, num_squeeze, sigmoid_scale, c_in_channels, ) self.n_sqz = num_squeeze def forward(self, x, x_len, g=None, reverse=False): """ Input shapes: - x: :math:`[B, C, T]` - x_len :math:`[B]` - g: :math:`[B, C]` Output shapes: - x: :math:`[B, C, T]` - x_len :math:`[B]` - logget_tot :math:`[B]` """ x, x_len, x_max_len = self.preprocess(x, x_len, x_len.max()) x_mask = torch.unsqueeze(sequence_mask(x_len, x_max_len), 1).to(x.dtype) x, logdet_tot = self.glow_decoder(x, x_mask, g, reverse) return x, x_len, logdet_tot def preprocess(self, y, y_lengths, y_max_length): if y_max_length is not None: y_max_length = torch.div(y_max_length, self.n_sqz, rounding_mode="floor") * self.n_sqz y = y[:, :, :y_max_length] y_lengths = torch.div(y_lengths, self.n_sqz, rounding_mode="floor") * self.n_sqz return y, y_lengths, y_max_length def store_inverse(self): self.glow_decoder.store_inverse()
0
coqui_public_repos
coqui_public_repos/TTS/.dockerignore
.git/ Dockerfile build/ dist/ TTS.egg-info/ tests/outputs/* tests/train_outputs/* __pycache__/ *.pyc
0
coqui_public_repos/inference-engine/third_party/openfst-1.6.7/src/include/fst
coqui_public_repos/inference-engine/third_party/openfst-1.6.7/src/include/fst/script/encode.h
// See www.openfst.org for extensive documentation on this weighted // finite-state transducer library. #ifndef FST_SCRIPT_ENCODE_H_ #define FST_SCRIPT_ENCODE_H_ #include <memory> #include <string> #include <tuple> #include <utility> #include <fst/encode.h> #include <fst/script/encodemapper-class.h> #include <fst/script/fst-class.h> namespace fst { namespace script { using EncodeArgs1 = std::tuple<MutableFstClass *, uint32, bool, const string &>; template <class Arc> void Encode(EncodeArgs1 *args) { MutableFst<Arc> *fst = std::get<0>(*args)->GetMutableFst<Arc>(); const string &coder_fname = std::get<3>(*args); // If true, reuse encode from disk. If false, make a new encoder and just use // the filename argument as the destination state. std::unique_ptr<EncodeMapper<Arc>> encoder( std::get<2>(*args) ? EncodeMapper<Arc>::Read(coder_fname, ENCODE) : new EncodeMapper<Arc>(std::get<1>(*args), ENCODE)); Encode(fst, encoder.get()); if (!std::get<2>(*args)) encoder->Write(coder_fname); } using EncodeArgs2 = std::pair<MutableFstClass *, EncodeMapperClass *>; template <class Arc> void Encode(EncodeArgs2 *args) { MutableFst<Arc> *fst = std::get<0>(*args)->GetMutableFst<Arc>(); EncodeMapper<Arc> *encoder = std::get<1>(*args)->GetEncodeMapper<Arc>(); Encode(fst, encoder); } void Encode(MutableFstClass *fst, uint32 flags, bool reuse_encoder, const string &coder_fname); void Encode(MutableFstClass *fst, EncodeMapperClass *encoder); } // namespace script } // namespace fst #endif // FST_SCRIPT_ENCODE_H_
0
coqui_public_repos/inference-engine/third_party/openfst-1.6.9-win/src/include/fst/extensions
coqui_public_repos/inference-engine/third_party/openfst-1.6.9-win/src/include/fst/extensions/linear/trie.h
// See www.openfst.org for extensive documentation on this weighted // finite-state transducer library. #ifndef FST_EXTENSIONS_LINEAR_TRIE_H_ #define FST_EXTENSIONS_LINEAR_TRIE_H_ #include <unordered_map> #include <utility> #include <vector> #include <fst/compat.h> #include <fst/util.h> namespace fst { const int kNoTrieNodeId = -1; // Forward declarations of all available trie topologies. template <class L, class H> class NestedTrieTopology; template <class L, class H> class FlatTrieTopology; // A pair of parent node id and label, part of a trie edge template <class L> struct ParentLabel { int parent; L label; ParentLabel() {} ParentLabel(int p, L l) : parent(p), label(l) {} bool operator==(const ParentLabel &that) const { return parent == that.parent && label == that.label; } std::istream &Read(std::istream &strm) { // NOLINT ReadType(strm, &parent); ReadType(strm, &label); return strm; } std::ostream &Write(std::ostream &strm) const { // NOLINT WriteType(strm, parent); WriteType(strm, label); return strm; } }; template <class L, class H> struct ParentLabelHash { size_t operator()(const ParentLabel<L> &pl) const { return static_cast<size_t>(pl.parent * 7853 + H()(pl.label)); } }; // The trie topology in a nested tree of hash maps; allows efficient // iteration over children of a specific node. template <class L, class H> class NestedTrieTopology { public: typedef L Label; typedef H Hash; typedef std::unordered_map<L, int, H> NextMap; class const_iterator { public: typedef std::forward_iterator_tag iterator_category; typedef std::pair<ParentLabel<L>, int> value_type; typedef std::ptrdiff_t difference_type; typedef const value_type *pointer; typedef const value_type &reference; friend class NestedTrieTopology<L, H>; const_iterator() : ptr_(nullptr), cur_node_(kNoTrieNodeId), cur_edge_() {} reference operator*() { UpdateStub(); return stub_; } pointer operator->() { UpdateStub(); return &stub_; } const_iterator &operator++(); const_iterator &operator++(int); // NOLINT bool operator==(const const_iterator &that) const { return ptr_ == that.ptr_ && cur_node_ == that.cur_node_ && cur_edge_ == that.cur_edge_; } bool operator!=(const const_iterator &that) const { return !(*this == that); } private: const_iterator(const NestedTrieTopology *ptr, int cur_node) : ptr_(ptr), cur_node_(cur_node) { SetProperCurEdge(); } void SetProperCurEdge() { if (cur_node_ < ptr_->NumNodes()) cur_edge_ = ptr_->nodes_[cur_node_]->begin(); else cur_edge_ = ptr_->nodes_[0]->begin(); } void UpdateStub() { stub_.first = ParentLabel<L>(cur_node_, cur_edge_->first); stub_.second = cur_edge_->second; } const NestedTrieTopology *ptr_; int cur_node_; typename NextMap::const_iterator cur_edge_; value_type stub_; }; NestedTrieTopology(); NestedTrieTopology(const NestedTrieTopology &that); ~NestedTrieTopology(); void swap(NestedTrieTopology &that); NestedTrieTopology &operator=(const NestedTrieTopology &that); bool operator==(const NestedTrieTopology &that) const; bool operator!=(const NestedTrieTopology &that) const; int Root() const { return 0; } size_t NumNodes() const { return nodes_.size(); } int Insert(int parent, const L &label); int Find(int parent, const L &label) const; const NextMap &ChildrenOf(int parent) const { return *nodes_[parent]; } std::istream &Read(std::istream &strm); // NOLINT std::ostream &Write(std::ostream &strm) const; // NOLINT const_iterator begin() const { return const_iterator(this, 0); } const_iterator end() const { return const_iterator(this, NumNodes()); } private: std::vector<NextMap *> nodes_; // Use pointers to avoid copying the maps when the // vector grows }; template <class L, class H> NestedTrieTopology<L, H>::NestedTrieTopology() { nodes_.push_back(new NextMap); } template <class L, class H> NestedTrieTopology<L, H>::NestedTrieTopology(const NestedTrieTopology &that) { nodes_.reserve(that.nodes_.size()); for (size_t i = 0; i < that.nodes_.size(); ++i) { NextMap *node = that.nodes_[i]; nodes_.push_back(new NextMap(*node)); } } template <class L, class H> NestedTrieTopology<L, H>::~NestedTrieTopology() { for (size_t i = 0; i < nodes_.size(); ++i) { NextMap *node = nodes_[i]; delete node; } } // TODO(wuke): std::swap compatibility template <class L, class H> inline void NestedTrieTopology<L, H>::swap(NestedTrieTopology &that) { nodes_.swap(that.nodes_); } template <class L, class H> inline NestedTrieTopology<L, H> &NestedTrieTopology<L, H>::operator=( const NestedTrieTopology &that) { NestedTrieTopology copy(that); swap(copy); return *this; } template <class L, class H> inline bool NestedTrieTopology<L, H>::operator==( const NestedTrieTopology &that) const { if (NumNodes() != that.NumNodes()) return false; for (int i = 0; i < NumNodes(); ++i) if (ChildrenOf(i) != that.ChildrenOf(i)) return false; return true; } template <class L, class H> inline bool NestedTrieTopology<L, H>::operator!=( const NestedTrieTopology &that) const { return !(*this == that); } template <class L, class H> inline int NestedTrieTopology<L, H>::Insert(int parent, const L &label) { int ret = Find(parent, label); if (ret == kNoTrieNodeId) { ret = NumNodes(); (*nodes_[parent])[label] = ret; nodes_.push_back(new NextMap); } return ret; } template <class L, class H> inline int NestedTrieTopology<L, H>::Find(int parent, const L &label) const { typename NextMap::const_iterator it = nodes_[parent]->find(label); return it == nodes_[parent]->end() ? kNoTrieNodeId : it->second; } template <class L, class H> inline std::istream &NestedTrieTopology<L, H>::Read( std::istream &strm) { // NOLINT NestedTrieTopology new_trie; size_t num_nodes; if (!ReadType(strm, &num_nodes)) return strm; for (size_t i = 1; i < num_nodes; ++i) new_trie.nodes_.push_back(new NextMap); for (size_t i = 0; i < num_nodes; ++i) ReadType(strm, new_trie.nodes_[i]); if (strm) swap(new_trie); return strm; } template <class L, class H> inline std::ostream &NestedTrieTopology<L, H>::Write( std::ostream &strm) const { // NOLINT WriteType(strm, NumNodes()); for (size_t i = 0; i < NumNodes(); ++i) WriteType(strm, *nodes_[i]); return strm; } template <class L, class H> inline typename NestedTrieTopology<L, H>::const_iterator &NestedTrieTopology<L, H>::const_iterator::operator++() { ++cur_edge_; if (cur_edge_ == ptr_->nodes_[cur_node_]->end()) { ++cur_node_; while (cur_node_ < ptr_->NumNodes() && ptr_->nodes_[cur_node_]->empty()) ++cur_node_; SetProperCurEdge(); } return *this; } template <class L, class H> inline typename NestedTrieTopology<L, H>::const_iterator &NestedTrieTopology<L, H>::const_iterator::operator++(int) { // NOLINT const_iterator save(*this); ++(*this); return save; } // The trie topology in a single hash map; only allows iteration over // all the edges in arbitrary order. template <class L, class H> class FlatTrieTopology { private: typedef std::unordered_map<ParentLabel<L>, int, ParentLabelHash<L, H>> NextMap; public: // Iterator over edges as std::pair<ParentLabel<L>, int> typedef typename NextMap::const_iterator const_iterator; typedef L Label; typedef H Hash; FlatTrieTopology() {} FlatTrieTopology(const FlatTrieTopology &that) : next_(that.next_) {} template <class T> explicit FlatTrieTopology(const T &that); // TODO(wuke): std::swap compatibility void swap(FlatTrieTopology &that) { next_.swap(that.next_); } bool operator==(const FlatTrieTopology &that) const { return next_ == that.next_; } bool operator!=(const FlatTrieTopology &that) const { return !(*this == that); } int Root() const { return 0; } size_t NumNodes() const { return next_.size() + 1; } int Insert(int parent, const L &label); int Find(int parent, const L &label) const; std::istream &Read(std::istream &strm) { // NOLINT return ReadType(strm, &next_); } std::ostream &Write(std::ostream &strm) const { // NOLINT return WriteType(strm, next_); } const_iterator begin() const { return next_.begin(); } const_iterator end() const { return next_.end(); } private: NextMap next_; }; template <class L, class H> template <class T> FlatTrieTopology<L, H>::FlatTrieTopology(const T &that) : next_(that.begin(), that.end()) {} template <class L, class H> inline int FlatTrieTopology<L, H>::Insert(int parent, const L &label) { int ret = Find(parent, label); if (ret == kNoTrieNodeId) { ret = NumNodes(); next_[ParentLabel<L>(parent, label)] = ret; } return ret; } template <class L, class H> inline int FlatTrieTopology<L, H>::Find(int parent, const L &label) const { typename NextMap::const_iterator it = next_.find(ParentLabel<L>(parent, label)); return it == next_.end() ? kNoTrieNodeId : it->second; } // A collection of implementations of the trie data structure. The key // is a sequence of type `L` which must be hashable. The value is of // `V` which must be default constructible and copyable. In addition, // a value object is stored for each node in the trie therefore // copying `V` should be cheap. // // One can access the store values with an integer node id, using the // [] operator. A valid node id can be obtained by the following ways: // // 1. Using the `Root()` method to get the node id of the root. // // 2. Iterating through 0 to `NumNodes() - 1`. The node ids are dense // so every integer in this range is a valid node id. // // 3. Using the node id returned from a successful `Insert()` or // `Find()` call. // // 4. Iterating over the trie edges with an `EdgeIterator` and using // the node ids returned from its `Parent()` and `Child()` methods. // // Below is an example of inserting keys into the trie: // // const string words[] = {"hello", "health", "jello"}; // Trie<char, bool> dict; // for (auto word : words) { // int cur = dict.Root(); // for (char c : word) { // cur = dict.Insert(cur, c); // } // dict[cur] = true; // } // // And the following is an example of looking up the longest prefix of // a string using the trie constructed above: // // string query = "healed"; // size_t prefix_length = 0; // int cur = dict.Find(dict.Root(), query[prefix_length]); // while (prefix_length < query.size() && // cur != Trie<char, bool>::kNoNodeId) { // ++prefix_length; // cur = dict.Find(cur, query[prefix_length]); // } template <class L, class V, class T> class MutableTrie { public: template <class LL, class VV, class TT> friend class MutableTrie; typedef L Label; typedef V Value; typedef T Topology; // Constructs a trie with only the root node. MutableTrie() {} // Conversion from another trie of a possiblly different // topology. The underlying topology must supported conversion. template <class S> explicit MutableTrie(const MutableTrie<L, V, S> &that) : topology_(that.topology_), values_(that.values_) {} // TODO(wuke): std::swap compatibility void swap(MutableTrie &that) { topology_.swap(that.topology_); values_.swap(that.values_); } int Root() const { return topology_.Root(); } size_t NumNodes() const { return topology_.NumNodes(); } // Inserts an edge with given `label` at node `parent`. Returns the // child node id. If the node already exists, returns the node id // right away. int Insert(int parent, const L &label) { int ret = topology_.Insert(parent, label); values_.resize(NumNodes()); return ret; } // Finds the node id of the node from `parent` via `label`. Returns // `kNoTrieNodeId` when such a node does not exist. int Find(int parent, const L &label) const { return topology_.Find(parent, label); } const T &TrieTopology() const { return topology_; } // Accesses the value stored for the given node. V &operator[](int node_id) { return values_[node_id]; } const V &operator[](int node_id) const { return values_[node_id]; } // Comparison by content bool operator==(const MutableTrie &that) const { return topology_ == that.topology_ && values_ == that.values_; } bool operator!=(const MutableTrie &that) const { return !(*this == that); } std::istream &Read(std::istream &strm) { // NOLINT ReadType(strm, &topology_); ReadType(strm, &values_); return strm; } std::ostream &Write(std::ostream &strm) const { // NOLINT WriteType(strm, topology_); WriteType(strm, values_); return strm; } private: T topology_; std::vector<V> values_; }; } // namespace fst #endif // FST_EXTENSIONS_LINEAR_TRIE_H_
0
coqui_public_repos/STT/native_client/ctcdecode/third_party/openfst-1.6.9-win/src/include/fst/extensions
coqui_public_repos/STT/native_client/ctcdecode/third_party/openfst-1.6.9-win/src/include/fst/extensions/far/compile-strings.h
// See www.openfst.org for extensive documentation on this weighted // finite-state transducer library. #ifndef FST_EXTENSIONS_FAR_COMPILE_STRINGS_H_ #define FST_EXTENSIONS_FAR_COMPILE_STRINGS_H_ #ifndef _MSC_VER #include <libgen.h> #else #include <fst/compat.h> #endif #include <fstream> #include <istream> #include <string> #include <vector> #include <fst/extensions/far/far.h> #include <fstream> #include <fst/string.h> namespace fst { // Constructs a reader that provides FSTs from a file (stream) either on a // line-by-line basis or on a per-stream basis. Note that the freshly // constructed reader is already set to the first input. // // Sample usage: // // for (StringReader<Arc> reader(...); !reader.Done(); reader.Next()) { // auto *fst = reader.GetVectorFst(); // } template <class Arc> class StringReader { public: using Label = typename Arc::Label; using Weight = typename Arc::Weight; enum EntryType { LINE = 1, FILE = 2 }; StringReader(std::istream &istrm, const string &source, EntryType entry_type, StringTokenType token_type, bool allow_negative_labels, const SymbolTable *syms = nullptr, Label unknown_label = kNoStateId) : nline_(0), istrm_(istrm), source_(source), entry_type_(entry_type), token_type_(token_type), symbols_(syms), done_(false), compiler_(token_type, syms, unknown_label, allow_negative_labels) { Next(); // Initialize the reader to the first input. } bool Done() { return done_; } void Next() { VLOG(1) << "Processing source " << source_ << " at line " << nline_; if (!istrm_) { // We're done if we have no more input. done_ = true; return; } if (entry_type_ == LINE) { getline(istrm_, content_); ++nline_; } else { content_.clear(); string line; while (getline(istrm_, line)) { ++nline_; content_.append(line); content_.append("\n"); } } if (!istrm_ && content_.empty()) // We're also done if we read off all the done_ = true; // whitespace at the end of a file. } VectorFst<Arc> *GetVectorFst(bool keep_symbols = false) { std::unique_ptr<VectorFst<Arc>> fst(new VectorFst<Arc>()); if (keep_symbols) { fst->SetInputSymbols(symbols_); fst->SetOutputSymbols(symbols_); } if (compiler_(content_, fst.get())) { return fst.release(); } else { return nullptr; } } CompactStringFst<Arc> *GetCompactFst(bool keep_symbols = false) { std::unique_ptr<CompactStringFst<Arc>> fst; if (keep_symbols) { VectorFst<Arc> tmp; tmp.SetInputSymbols(symbols_); tmp.SetOutputSymbols(symbols_); fst.reset(new CompactStringFst<Arc>(tmp)); } else { fst.reset(new CompactStringFst<Arc>()); } if (compiler_(content_, fst.get())) { return fst.release(); } else { return nullptr; } } private: size_t nline_; std::istream &istrm_; string source_; EntryType entry_type_; StringTokenType token_type_; const SymbolTable *symbols_; bool done_; StringCompiler<Arc> compiler_; string content_; // The actual content of the input stream's next FST. StringReader(const StringReader &) = delete; StringReader &operator=(const StringReader &) = delete; }; // Computes the minimal length required to encode each line number as a decimal // number. int KeySize(const char *filename); template <class Arc> void FarCompileStrings(const std::vector<string> &in_fnames, const string &out_fname, const string &fst_type, const FarType &far_type, int32_t generate_keys, FarEntryType fet, FarTokenType tt, const string &symbols_fname, const string &unknown_symbol, bool keep_symbols, bool initial_symbols, bool allow_negative_labels, const string &key_prefix, const string &key_suffix) { typename StringReader<Arc>::EntryType entry_type; if (fet == FET_LINE) { entry_type = StringReader<Arc>::LINE; } else if (fet == FET_FILE) { entry_type = StringReader<Arc>::FILE; } else { FSTERROR() << "FarCompileStrings: Unknown entry type"; return; } StringTokenType token_type; if (tt == FTT_SYMBOL) { token_type = StringTokenType::SYMBOL; } else if (tt == FTT_BYTE) { token_type = StringTokenType::BYTE; } else if (tt == FTT_UTF8) { token_type = StringTokenType::UTF8; } else { FSTERROR() << "FarCompileStrings: Unknown token type"; return; } bool compact; if (fst_type.empty() || (fst_type == "vector")) { compact = false; } else if (fst_type == "compact") { compact = true; } else { FSTERROR() << "FarCompileStrings: Unknown FST type: " << fst_type; return; } std::unique_ptr<const SymbolTable> syms; typename Arc::Label unknown_label = kNoLabel; if (!symbols_fname.empty()) { const SymbolTableTextOptions opts(allow_negative_labels); syms.reset(SymbolTable::ReadText(symbols_fname, opts)); if (!syms) { LOG(ERROR) << "FarCompileStrings: Error reading symbol table: " << symbols_fname; return; } if (!unknown_symbol.empty()) { unknown_label = syms->Find(unknown_symbol); if (unknown_label == kNoLabel) { FSTERROR() << "FarCompileStrings: Label \"" << unknown_label << "\" missing from symbol table: " << symbols_fname; return; } } } std::unique_ptr<FarWriter<Arc>> far_writer( FarWriter<Arc>::Create(out_fname, far_type)); if (!far_writer) return; int n = 0; for (const auto &in_fname : in_fnames) { if (generate_keys == 0 && in_fname.empty()) { FSTERROR() << "FarCompileStrings: Read from a file instead of stdin or" << " set the --generate_keys flags."; return; } int key_size = generate_keys ? generate_keys : (entry_type == StringReader<Arc>::FILE ? 1 : KeySize(in_fname.c_str())); std::ifstream fstrm; if (!in_fname.empty()) { fstrm.open(in_fname); if (!fstrm) { FSTERROR() << "FarCompileStrings: Can't open file: " << in_fname; return; } } std::istream &istrm = fstrm.is_open() ? fstrm : std::cin; bool keep_syms = keep_symbols; for (StringReader<Arc> reader( istrm, in_fname.empty() ? "stdin" : in_fname, entry_type, token_type, allow_negative_labels, syms.get(), unknown_label); !reader.Done(); reader.Next()) { ++n; std::unique_ptr<const Fst<Arc>> fst; if (compact) { fst.reset(reader.GetCompactFst(keep_syms)); } else { fst.reset(reader.GetVectorFst(keep_syms)); } if (initial_symbols) keep_syms = false; if (!fst) { FSTERROR() << "FarCompileStrings: Compiling string number " << n << " in file " << in_fname << " failed with token_type = " << (tt == FTT_BYTE ? "byte" : (tt == FTT_UTF8 ? "utf8" : (tt == FTT_SYMBOL ? "symbol" : "unknown"))) << " and entry_type = " << (fet == FET_LINE ? "line" : (fet == FET_FILE ? "file" : "unknown")); return; } std::ostringstream keybuf; keybuf.width(key_size); keybuf.fill('0'); keybuf << n; string key; if (generate_keys > 0) { key = keybuf.str(); } else { auto *filename = new char[in_fname.size() + 1]; strcpy(filename, in_fname.c_str()); key = basename(filename); if (entry_type != StringReader<Arc>::FILE) { key += "-"; key += keybuf.str(); } delete[] filename; } far_writer->Add(key_prefix + key + key_suffix, *fst); } if (generate_keys == 0) n = 0; } } } // namespace fst #endif // FST_EXTENSIONS_FAR_COMPILE_STRINGS_H_
0
coqui_public_repos/inference-engine/third_party/openfst-1.6.9-win/src
coqui_public_repos/inference-engine/third_party/openfst-1.6.9-win/src/lib/Makefile.in
# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/lib ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_python_devel.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h \ $(top_builddir)/src/include/fst/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(libdir)" LTLIBRARIES = $(lib_LTLIBRARIES) am__DEPENDENCIES_1 = libfst_la_DEPENDENCIES = $(am__DEPENDENCIES_1) am_libfst_la_OBJECTS = compat.lo flags.lo fst.lo fst-types.lo \ mapped-file.lo properties.lo symbol-table.lo \ symbol-table-ops.lo weight.lo util.lo libfst_la_OBJECTS = $(am_libfst_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = libfst_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(libfst_la_LDFLAGS) $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLD = $(CXX) CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = SOURCES = $(libfst_la_SOURCES) DIST_SOURCES = $(libfst_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PYTHON = @PYTHON@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@ PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_SITE_PKG = @PYTHON_SITE_PKG@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ libfstdir = @libfstdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CPPFLAGS = -I$(srcdir)/../include $(ICU_CPPFLAGS) lib_LTLIBRARIES = libfst.la libfst_la_SOURCES = compat.cc flags.cc fst.cc fst-types.cc mapped-file.cc \ properties.cc symbol-table.cc symbol-table-ops.cc \ weight.cc util.cc libfst_la_LDFLAGS = -version-info 13:0:0 libfst_la_LIBADD = $(DL_LIBS) all: all-am .SUFFIXES: .SUFFIXES: .cc .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/lib/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign src/lib/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libfst.la: $(libfst_la_OBJECTS) $(libfst_la_DEPENDENCIES) $(EXTRA_libfst_la_DEPENDENCIES) $(AM_V_CXXLD)$(libfst_la_LINK) -rpath $(libdir) $(libfst_la_OBJECTS) $(libfst_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/compat.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/flags.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fst-types.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fst.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mapped-file.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/properties.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/symbol-table-ops.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/symbol-table.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/util.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/weight.Plo@am__quote@ .cc.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cc.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cc.lo: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(libdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-libLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-libLTLIBRARIES install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-libLTLIBRARIES .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT:
0
coqui_public_repos/STT
coqui_public_repos/STT/notebooks/train_your_first_coqui_STT_model.ipynb
## Install Coqui STT ! pip install -U pip ! pip install coqui_stt_training### Download sample data import os import pandas from coqui_stt_training.util.downloader import maybe_download def download_sample_data(): data_dir="english/" # Download data + alphabet audio_file = maybe_download("LDC93S1.wav", data_dir, "https://raw.githubusercontent.com/coqui-ai/STT/main/data/smoke_test/LDC93S1.wav") transcript_file = maybe_download("LDC93S1.txt", data_dir, "https://raw.githubusercontent.com/coqui-ai/STT/main/data/smoke_test/LDC93S1.txt") alphabet = maybe_download("alphabet.txt", data_dir, "https://raw.githubusercontent.com/coqui-ai/STT/main/data/alphabet.txt") # Format data with open(transcript_file, "r") as fin: transcript = " ".join(fin.read().strip().lower().split(" ")[2:]).replace(".", "") df = pandas.DataFrame(data=[(os.path.abspath(audio_file), os.path.getsize(audio_file), transcript)], columns=["wav_filename", "wav_filesize", "transcript"]) # Save formatted CSV df.to_csv(os.path.join(data_dir, "ldc93s1.csv"), index=False) # Download and format data download_sample_data()csv_file = open("english/ldc93s1.csv", "r") print(csv_file.read())alphabet_file = open("english/alphabet.txt", "r") print(alphabet_file.read())from coqui_stt_training.util.config import initialize_globals_from_args initialize_globals_from_args( alphabet_config_path="english/alphabet.txt", checkpoint_dir="ckpt_dir", train_files=["english/ldc93s1.csv"], dev_files=["english/ldc93s1.csv"], test_files=["english/ldc93s1.csv"], load_train="init", n_hidden=200, epochs=100, )from coqui_stt_training.util.config import Config # Take a peek at the entire Config print(Config.to_json())from coqui_stt_training.train import train # use maximum one GPU os.environ["CUDA_VISIBLE_DEVICES"] = "0" train()from coqui_stt_training.evaluate import test test()
0
coqui_public_repos/inference-engine/third_party/openfst-1.6.9-win/src/include/fst
coqui_public_repos/inference-engine/third_party/openfst-1.6.9-win/src/include/fst/script/epsnormalize.h
// See www.openfst.org for extensive documentation on this weighted // finite-state transducer library. #ifndef FST_SCRIPT_EPSNORMALIZE_H_ #define FST_SCRIPT_EPSNORMALIZE_H_ #include <tuple> #include <fst/epsnormalize.h> #include <fst/script/fst-class.h> namespace fst { namespace script { using EpsNormalizeArgs = std::tuple<const FstClass &, MutableFstClass *, EpsNormalizeType>; template <class Arc> void EpsNormalize(EpsNormalizeArgs *args) { const Fst<Arc> &ifst = *(std::get<0>(*args).GetFst<Arc>()); MutableFst<Arc> *ofst = std::get<1>(*args)->GetMutableFst<Arc>(); EpsNormalize(ifst, ofst, std::get<2>(*args)); } void EpsNormalize(const FstClass &ifst, MutableFstClass *ofst, EpsNormalizeType norm_type = EPS_NORM_INPUT); } // namespace script } // namespace fst #endif // FST_SCRIPT_EPSNORMALIZE_H_
0
coqui_public_repos/inference-engine/third_party
coqui_public_repos/inference-engine/third_party/openfst-1.6.9-win/test-driver
#! /bin/sh # test-driver - basic testsuite driver script. scriptversion=2013-07-13.22; # UTC # Copyright (C) 2011-2014 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to <bug-automake@gnu.org> or send patches to # <automake-patches@gnu.org>. # Make unconditional expansion of undefined variables an error. This # helps a lot in preventing typo-related bugs. set -u usage_error () { echo "$0: $*" >&2 print_usage >&2 exit 2 } print_usage () { cat <<END Usage: test-driver --test-name=NAME --log-file=PATH --trs-file=PATH [--expect-failure={yes|no}] [--color-tests={yes|no}] [--enable-hard-errors={yes|no}] [--] TEST-SCRIPT [TEST-SCRIPT-ARGUMENTS] The '--test-name', '--log-file' and '--trs-file' options are mandatory. END } test_name= # Used for reporting. log_file= # Where to save the output of the test script. trs_file= # Where to save the metadata of the test run. expect_failure=no color_tests=no enable_hard_errors=yes while test $# -gt 0; do case $1 in --help) print_usage; exit $?;; --version) echo "test-driver $scriptversion"; exit $?;; --test-name) test_name=$2; shift;; --log-file) log_file=$2; shift;; --trs-file) trs_file=$2; shift;; --color-tests) color_tests=$2; shift;; --expect-failure) expect_failure=$2; shift;; --enable-hard-errors) enable_hard_errors=$2; shift;; --) shift; break;; -*) usage_error "invalid option: '$1'";; *) break;; esac shift done missing_opts= test x"$test_name" = x && missing_opts="$missing_opts --test-name" test x"$log_file" = x && missing_opts="$missing_opts --log-file" test x"$trs_file" = x && missing_opts="$missing_opts --trs-file" if test x"$missing_opts" != x; then usage_error "the following mandatory options are missing:$missing_opts" fi if test $# -eq 0; then usage_error "missing argument" fi if test $color_tests = yes; then # Keep this in sync with 'lib/am/check.am:$(am__tty_colors)'. red='' # Red. grn='' # Green. lgn='' # Light green. blu='' # Blue. mgn='' # Magenta. std='' # No color. else red= grn= lgn= blu= mgn= std= fi do_exit='rm -f $log_file $trs_file; (exit $st); exit $st' trap "st=129; $do_exit" 1 trap "st=130; $do_exit" 2 trap "st=141; $do_exit" 13 trap "st=143; $do_exit" 15 # Test script is run here. "$@" >$log_file 2>&1 estatus=$? if test $enable_hard_errors = no && test $estatus -eq 99; then tweaked_estatus=1 else tweaked_estatus=$estatus fi case $tweaked_estatus:$expect_failure in 0:yes) col=$red res=XPASS recheck=yes gcopy=yes;; 0:*) col=$grn res=PASS recheck=no gcopy=no;; 77:*) col=$blu res=SKIP recheck=no gcopy=yes;; 99:*) col=$mgn res=ERROR recheck=yes gcopy=yes;; *:yes) col=$lgn res=XFAIL recheck=no gcopy=yes;; *:*) col=$red res=FAIL recheck=yes gcopy=yes;; esac # Report the test outcome and exit status in the logs, so that one can # know whether the test passed or failed simply by looking at the '.log' # file, without the need of also peaking into the corresponding '.trs' # file (automake bug#11814). echo "$res $test_name (exit status: $estatus)" >>$log_file # Report outcome to console. echo "${col}${res}${std}: $test_name" # Register the test result, and other relevant metadata. echo ":test-result: $res" > $trs_file echo ":global-test-result: $res" >> $trs_file echo ":recheck: $recheck" >> $trs_file echo ":copy-in-global-log: $gcopy" >> $trs_file # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End:
0
coqui_public_repos/inference-engine/third_party/openfst-1.6.7/src/include
coqui_public_repos/inference-engine/third_party/openfst-1.6.7/src/include/fst/cache.h
// See www.openfst.org for extensive documentation on this weighted // finite-state transducer library. // // An FST implementation that caches FST elements of a delayed computation. #ifndef FST_CACHE_H_ #define FST_CACHE_H_ #include <functional> #include <unordered_map> using std::unordered_map; using std::unordered_multimap; #include <list> #include <vector> #include <fst/flags.h> #include <fst/log.h> #include <fst/vector-fst.h> DECLARE_bool(fst_default_cache_gc); DECLARE_int64(fst_default_cache_gc_limit); namespace fst { // Options for controlling caching behavior; higher level than CacheImplOptions. struct CacheOptions { bool gc; // Enables GC. size_t gc_limit; // Number of bytes allowed before GC. explicit CacheOptions(bool gc = FLAGS_fst_default_cache_gc, size_t gc_limit = FLAGS_fst_default_cache_gc_limit) : gc(gc), gc_limit(gc_limit) {} }; // Options for controlling caching behavior, at a lower level than // CacheOptions; templated on the cache store and allows passing the store. template <class CacheStore> struct CacheImplOptions { bool gc; // Enables GC. size_t gc_limit; // Number of bytes allowed before GC. CacheStore *store; // Cache store. bool own_store; // Should CacheImpl takes ownership of the store? explicit CacheImplOptions(bool gc = FLAGS_fst_default_cache_gc, size_t gc_limit = FLAGS_fst_default_cache_gc_limit, CacheStore *store = nullptr) : gc(gc), gc_limit(gc_limit), store(store), own_store(true) {} explicit CacheImplOptions(const CacheOptions &opts) : gc(opts.gc), gc_limit(opts.gc_limit), store(nullptr), own_store(true) {} }; // Cache flags. constexpr uint32 kCacheFinal = 0x0001; // Final weight has been cached. constexpr uint32 kCacheArcs = 0x0002; // Arcs have been cached. constexpr uint32 kCacheInit = 0x0004; // Initialized by GC. constexpr uint32 kCacheRecent = 0x0008; // Visited since GC. constexpr uint32 kCacheFlags = kCacheFinal | kCacheArcs | kCacheInit | kCacheRecent; // Cache state, with arcs stored in a per-state std::vector. template <class A, class M = PoolAllocator<A>> class CacheState { public: using Arc = A; using Label = typename Arc::Label; using StateId = typename Arc::StateId; using Weight = typename Arc::Weight; using ArcAllocator = M; using StateAllocator = typename ArcAllocator::template rebind<CacheState<A, M>>::other; // Provides STL allocator for arcs. explicit CacheState(const ArcAllocator &alloc) : final_(Weight::Zero()), niepsilons_(0), noepsilons_(0), arcs_(alloc), flags_(0), ref_count_(0) {} CacheState(const CacheState<A> &state, const ArcAllocator &alloc) : final_(state.Final()), niepsilons_(state.NumInputEpsilons()), noepsilons_(state.NumOutputEpsilons()), arcs_(state.arcs_.begin(), state.arcs_.end(), alloc), flags_(state.Flags()), ref_count_(0) {} void Reset() { final_ = Weight::Zero(); niepsilons_ = 0; noepsilons_ = 0; ref_count_ = 0; flags_ = 0; arcs_.clear(); } Weight Final() const { return final_; } size_t NumInputEpsilons() const { return niepsilons_; } size_t NumOutputEpsilons() const { return noepsilons_; } size_t NumArcs() const { return arcs_.size(); } const Arc &GetArc(size_t n) const { return arcs_[n]; } // Used by the ArcIterator<Fst<Arc>> efficient implementation. const Arc *Arcs() const { return !arcs_.empty() ? &arcs_[0] : nullptr; } // Accesses flags; used by the caller. uint32 Flags() const { return flags_; } // Accesses ref count; used by the caller. int RefCount() const { return ref_count_; } void SetFinal(Weight weight) { final_ = std::move(weight); } void ReserveArcs(size_t n) { arcs_.reserve(n); } // Adds one arc at a time with all needed book-keeping; use PushArc and // SetArcs for a more efficient alternative. void AddArc(const Arc &arc) { arcs_.push_back(arc); if (arc.ilabel == 0) ++niepsilons_; if (arc.olabel == 0) ++noepsilons_; } // Adds one arc at a time with delayed book-keeping; finalize with SetArcs(). void PushArc(const Arc &arc) { arcs_.push_back(arc); } // Finalizes arcs book-keeping; call only once. void SetArcs() { for (const auto &arc : arcs_) { if (arc.ilabel == 0) ++niepsilons_; if (arc.olabel == 0) ++noepsilons_; } } // Modifies nth arc. void SetArc(const Arc &arc, size_t n) { if (arcs_[n].ilabel == 0) --niepsilons_; if (arcs_[n].olabel == 0) --noepsilons_; if (arc.ilabel == 0) ++niepsilons_; if (arc.olabel == 0) ++noepsilons_; arcs_[n] = arc; } // Deletes all arcs. void DeleteArcs() { niepsilons_ = 0; noepsilons_ = 0; arcs_.clear(); } void DeleteArcs(size_t n) { for (size_t i = 0; i < n; ++i) { if (arcs_.back().ilabel == 0) --niepsilons_; if (arcs_.back().olabel == 0) --noepsilons_; arcs_.pop_back(); } } // Sets status flags; used by the caller. void SetFlags(uint32 flags, uint32 mask) const { flags_ &= ~mask; flags_ |= flags; } // Mutates reference counts; used by the caller. int IncrRefCount() const { return ++ref_count_; } int DecrRefCount() const { return --ref_count_; } // Used by the ArcIterator<Fst<Arc>> efficient implementation. int *MutableRefCount() const { return &ref_count_; } // Used for state class allocation. void *operator new(size_t size, StateAllocator *alloc) { return alloc->allocate(1); } // For state destruction and memory freeing. static void Destroy(CacheState<Arc> *state, StateAllocator *alloc) { if (state) { state->~CacheState<Arc>(); alloc->deallocate(state, 1); } } private: Weight final_; // Final weight. size_t niepsilons_; // # of input epsilons. size_t noepsilons_; // # of output epsilons. std::vector<Arc, ArcAllocator> arcs_; // Arcs representation. mutable uint32 flags_; mutable int ref_count_; // If 0, available for GC. }; // Cache store, allocating and storing states, providing a mapping from state // IDs to cached states, and an iterator over these states. The state template // argument must implement the CacheState interface. The state for a StateId s // is constructed when requested by GetMutableState(s) if it is not yet stored. // Initially, a state has a reference count of zero, but the user may increment // or decrement this to control the time of destruction. In particular, a state // is destroyed when: // // 1. This instance is destroyed, or // 2. Clear() or Delete() is called, or // 3. Possibly (implementation-dependently) when: // - Garbage collection is enabled (as defined by opts.gc), // - The cache store size exceeds the limits (as defined by opts.gc_limits), // - The state's reference count is zero, and // - The state is not the most recently requested state. // // template <class S> // class CacheStore { // public: // using State = S; // using Arc = typename State::Arc; // using StateId = typename Arc::StateId; // // // Required constructors/assignment operators. // explicit CacheStore(const CacheOptions &opts); // // // Returns nullptr if state is not stored. // const State *GetState(StateId s); // // // Creates state if state is not stored. // State *GetMutableState(StateId s); // // // Similar to State::AddArc() but updates cache store book-keeping. // void AddArc(State *state, const Arc &arc); // // // Similar to State::SetArcs() but updates cache store book-keeping; call // // only once. // void SetArcs(State *state); // // // Similar to State::DeleteArcs() but updates cache store book-keeping. // // void DeleteArcs(State *state); // // void DeleteArcs(State *state, size_t n); // // // Deletes all cached states. // void Clear(); // // // Iterates over cached states (in an arbitrary order); only needed if // // opts.gc is true. // bool Done() const; // End of iteration. // StateId Value() const; // Current state. // void Next(); // Advances to next state (when !Done). // void Reset(); // Returns to initial condition. // void Delete(); // Deletes current state and advances to next. // }; // Container cache stores. // This class uses a vector of pointers to states to store cached states. template <class S> class VectorCacheStore { public: using State = S; using Arc = typename State::Arc; using StateId = typename Arc::StateId; using StateList = std::list<StateId, PoolAllocator<StateId>>; // Required constructors/assignment operators. explicit VectorCacheStore(const CacheOptions &opts) : cache_gc_(opts.gc) { Clear(); Reset(); } VectorCacheStore(const VectorCacheStore<S> &store) : cache_gc_(store.cache_gc_) { CopyStates(store); Reset(); } ~VectorCacheStore() { Clear(); } VectorCacheStore<State> &operator=(const VectorCacheStore<State> &store) { if (this != &store) { CopyStates(store); Reset(); } return *this; } // Returns nullptr if state is not stored. const State *GetState(StateId s) const { return s < state_vec_.size() ? state_vec_[s] : nullptr; } // Creates state if state is not stored. State *GetMutableState(StateId s) { State *state = nullptr; if (s >= state_vec_.size()) { state_vec_.resize(s + 1, nullptr); } else { state = state_vec_[s]; } if (!state) { state = new (&state_alloc_) State(arc_alloc_); state_vec_[s] = state; if (cache_gc_) state_list_.push_back(s); } return state; } // Similar to State::AddArc() but updates cache store book-keeping void AddArc(State *state, const Arc &arc) { state->AddArc(arc); } // Similar to State::SetArcs() but updates cache store book-keeping; call // only once. void SetArcs(State *state) { state->SetArcs(); } // Deletes all arcs. void DeleteArcs(State *state) { state->DeleteArcs(); } // Deletes some arcs. void DeleteArcs(State *state, size_t n) { state->DeleteArcs(n); } // Deletes all cached states. void Clear() { for (StateId s = 0; s < state_vec_.size(); ++s) { State::Destroy(state_vec_[s], &state_alloc_); } state_vec_.clear(); state_list_.clear(); } // Iterates over cached states (in an arbitrary order); only works if GC is // enabled (o.w. avoiding state_list_ overhead). bool Done() const { return iter_ == state_list_.end(); } StateId Value() const { return *iter_; } void Next() { ++iter_; } void Reset() { iter_ = state_list_.begin(); } // Deletes current state and advances to next. void Delete() { State::Destroy(state_vec_[*iter_], &state_alloc_); state_vec_[*iter_] = nullptr; state_list_.erase(iter_++); } private: void CopyStates(const VectorCacheStore<State> &store) { Clear(); state_vec_.reserve(store.state_vec_.size()); for (StateId s = 0; s < store.state_vec_.size(); ++s) { State *state = nullptr; const auto *store_state = store.state_vec_[s]; if (store_state) { state = new (&state_alloc_) State(*store_state, arc_alloc_); if (cache_gc_) state_list_.push_back(s); } state_vec_.push_back(state); } } bool cache_gc_; // Supports iteration when true. std::vector<State *> state_vec_; // Vector of states (or null). StateList state_list_; // List of states. typename StateList::iterator iter_; // State list iterator. typename State::StateAllocator state_alloc_; // For state allocation. typename State::ArcAllocator arc_alloc_; // For arc allocation. }; // This class uses a hash map from state IDs to pointers to cached states. template <class S> class HashCacheStore { public: using State = S; using Arc = typename State::Arc; using StateId = typename Arc::StateId; using StateMap = std::unordered_map<StateId, State *, std::hash<StateId>, std::equal_to<StateId>, PoolAllocator<std::pair<const StateId, State *>>>; // Required constructors/assignment operators. explicit HashCacheStore(const CacheOptions &opts) { Clear(); Reset(); } HashCacheStore(const HashCacheStore<S> &store) { CopyStates(store); Reset(); } ~HashCacheStore() { Clear(); } HashCacheStore<State> &operator=(const HashCacheStore<State> &store) { if (this != &store) { CopyStates(store); Reset(); } return *this; } // Returns nullptr if state is not stored. const State *GetState(StateId s) const { const auto it = state_map_.find(s); return it != state_map_.end() ? it->second : nullptr; } // Creates state if state is not stored. State *GetMutableState(StateId s) { auto *&state = state_map_[s]; if (!state) state = new (&state_alloc_) State(arc_alloc_); return state; } // Similar to State::AddArc() but updates cache store book-keeping. void AddArc(State *state, const Arc &arc) { state->AddArc(arc); } // Similar to State::SetArcs() but updates internal cache size; call only // once. void SetArcs(State *state) { state->SetArcs(); } // Deletes all arcs. void DeleteArcs(State *state) { state->DeleteArcs(); } // Deletes some arcs. void DeleteArcs(State *state, size_t n) { state->DeleteArcs(n); } // Deletes all cached states. void Clear() { for (auto it = state_map_.begin(); it != state_map_.end(); ++it) { State::Destroy(it->second, &state_alloc_); } state_map_.clear(); } // Iterates over cached states (in an arbitrary order). bool Done() const { return iter_ == state_map_.end(); } StateId Value() const { return iter_->first; } void Next() { ++iter_; } void Reset() { iter_ = state_map_.begin(); } // Deletes current state and advances to next. void Delete() { State::Destroy(iter_->second, &state_alloc_); state_map_.erase(iter_++); } private: void CopyStates(const HashCacheStore<State> &store) { Clear(); for (auto it = store.state_map_.begin(); it != store.state_map_.end(); ++it) { state_map_[it->first] = new (&state_alloc_) State(*it->second, arc_alloc_); } } StateMap state_map_; // Map from state ID to state. typename StateMap::iterator iter_; // State map iterator. typename State::StateAllocator state_alloc_; // For state allocation. typename State::ArcAllocator arc_alloc_; // For arc allocation. }; // Garbage-colllection cache stores. // This class implements a simple garbage collection scheme when // 'opts.gc_limit = 0'. In particular, the first cached state is reused for each // new state so long as the reference count is zero on the to-be-reused state. // Otherwise, the full underlying store is used. The caller can increment the // reference count to inhibit the GC of in-use states (e.g., in an ArcIterator). // // The typical use case for this optimization is when a single pass over a // cached // FST is performed with only one-state expanded at a time. template <class CacheStore> class FirstCacheStore { public: using State = typename CacheStore::State; using Arc = typename State::Arc; using StateId = typename Arc::StateId; // Required constructors/assignment operators. explicit FirstCacheStore(const CacheOptions &opts) : store_(opts), cache_gc_(opts.gc_limit == 0), // opts.gc ignored historically. cache_first_state_id_(kNoStateId), cache_first_state_(nullptr) {} FirstCacheStore(const FirstCacheStore<CacheStore> &store) : store_(store.store_), cache_gc_(store.cache_gc_), cache_first_state_id_(store.cache_first_state_id_), cache_first_state_(store.cache_first_state_id_ != kNoStateId ? store_.GetMutableState(0) : nullptr) {} FirstCacheStore<CacheStore> &operator=( const FirstCacheStore<CacheStore> &store) { if (this != &store) { store_ = store.store_; cache_gc_ = store.cache_gc_; cache_first_state_id_ = store.cache_first_state_id_; cache_first_state_ = store.cache_first_state_id_ != kNoStateId ? store_.GetMutableState(0) : nullptr; } return *this; } // Returns nullptr if state is not stored. const State *GetState(StateId s) const { // store_ state 0 may hold first cached state; the rest are shifted by 1. return s == cache_first_state_id_ ? cache_first_state_ : store_.GetState(s + 1); } // Creates state if state is not stored. State *GetMutableState(StateId s) { // store_ state 0 used to hold first cached state; the rest are shifted by // 1. if (cache_first_state_id_ == s) { return cache_first_state_; // Request for first cached state. } if (cache_gc_) { if (cache_first_state_id_ == kNoStateId) { cache_first_state_id_ = s; // Sets first cached state. cache_first_state_ = store_.GetMutableState(0); cache_first_state_->SetFlags(kCacheInit, kCacheInit); cache_first_state_->ReserveArcs(2 * kAllocSize); return cache_first_state_; } else if (cache_first_state_->RefCount() == 0) { cache_first_state_id_ = s; // Updates first cached state. cache_first_state_->Reset(); cache_first_state_->SetFlags(kCacheInit, kCacheInit); return cache_first_state_; } else { // Keeps first cached state. cache_first_state_->SetFlags(0, kCacheInit); // Clears initialized bit. cache_gc_ = false; // Disables GC. } } auto *state = store_.GetMutableState(s + 1); return state; } // Similar to State::AddArc() but updates cache store book-keeping. void AddArc(State *state, const Arc &arc) { store_.AddArc(state, arc); } // Similar to State::SetArcs() but updates internal cache size; call only // once. void SetArcs(State *state) { store_.SetArcs(state); } // Deletes all arcs void DeleteArcs(State *state) { store_.DeleteArcs(state); } // Deletes some arcs void DeleteArcs(State *state, size_t n) { store_.DeleteArcs(state, n); } // Deletes all cached states void Clear() { store_.Clear(); cache_first_state_id_ = kNoStateId; cache_first_state_ = nullptr; } // Iterates over cached states (in an arbitrary order). Only needed if GC is // enabled. bool Done() const { return store_.Done(); } StateId Value() const { // store_ state 0 may hold first cached state; rest shifted + 1. const auto s = store_.Value(); return s ? s - 1 : cache_first_state_id_; } void Next() { store_.Next(); } void Reset() { store_.Reset(); } // Deletes current state and advances to next. void Delete() { if (Value() == cache_first_state_id_) { cache_first_state_id_ = kNoStateId; cache_first_state_ = nullptr; } store_.Delete(); } private: CacheStore store_; // Underlying store. bool cache_gc_; // GC enabled. StateId cache_first_state_id_; // First cached state ID. State *cache_first_state_; // First cached state. }; // This class implements mark-sweep garbage collection on an underlying cache // store. If GC is enabled, garbage collection of states is performed in a // rough approximation of LRU order once when 'gc_limit' bytes is reached. The // caller can increment the reference count to inhibit the GC of in-use state // (e.g., in an ArcIterator). With GC enabled, the 'gc_limit' parameter allows // the caller to trade-off time vs. space. template <class CacheStore> class GCCacheStore { public: using State = typename CacheStore::State; using Arc = typename State::Arc; using StateId = typename Arc::StateId; // Required constructors/assignment operators. explicit GCCacheStore(const CacheOptions &opts) : store_(opts), cache_gc_request_(opts.gc), cache_limit_(opts.gc_limit > kMinCacheLimit ? opts.gc_limit : kMinCacheLimit), cache_gc_(false), cache_size_(0) {} // Returns 0 if state is not stored. const State *GetState(StateId s) const { return store_.GetState(s); } // Creates state if state is not stored State *GetMutableState(StateId s) { auto *state = store_.GetMutableState(s); if (cache_gc_request_ && !(state->Flags() & kCacheInit)) { state->SetFlags(kCacheInit, kCacheInit); cache_size_ += sizeof(State) + state->NumArcs() * sizeof(Arc); // GC is enabled once an uninited state (from underlying store) is seen. cache_gc_ = true; if (cache_size_ > cache_limit_) GC(state, false); } return state; } // Similar to State::AddArc() but updates cache store book-keeping. void AddArc(State *state, const Arc &arc) { store_.AddArc(state, arc); if (cache_gc_ && (state->Flags() & kCacheInit)) { cache_size_ += sizeof(Arc); if (cache_size_ > cache_limit_) GC(state, false); } } // Similar to State::SetArcs() but updates internal cache size; call only // once. void SetArcs(State *state) { store_.SetArcs(state); if (cache_gc_ && (state->Flags() & kCacheInit)) { cache_size_ += state->NumArcs() * sizeof(Arc); if (cache_size_ > cache_limit_) GC(state, false); } } // Deletes all arcs. void DeleteArcs(State *state) { if (cache_gc_ && (state->Flags() & kCacheInit)) { cache_size_ -= state->NumArcs() * sizeof(Arc); } store_.DeleteArcs(state); } // Deletes some arcs. void DeleteArcs(State *state, size_t n) { if (cache_gc_ && (state->Flags() & kCacheInit)) { cache_size_ -= n * sizeof(Arc); } store_.DeleteArcs(state, n); } // Deletes all cached states. void Clear() { store_.Clear(); cache_size_ = 0; } // Iterates over cached states (in an arbitrary order); only needed if GC is // enabled. bool Done() const { return store_.Done(); } StateId Value() const { return store_.Value(); } void Next() { store_.Next(); } void Reset() { store_.Reset(); } // Deletes current state and advances to next. void Delete() { if (cache_gc_) { const auto *state = store_.GetState(Value()); if (state->Flags() & kCacheInit) { cache_size_ -= sizeof(State) + state->NumArcs() * sizeof(Arc); } } store_.Delete(); } // Removes from the cache store (not referenced-counted and not the current) // states that have not been accessed since the last GC until at most // cache_fraction * cache_limit_ bytes are cached. If that fails to free // enough, attempts to uncaching recently visited states as well. If still // unable to free enough memory, then widens cache_limit_. void GC(const State *current, bool free_recent, float cache_fraction = 0.666); // Returns the current cache size in bytes or 0 if GC is disabled. size_t CacheSize() const { return cache_size_; } // Returns the cache limit in bytes. size_t CacheLimit() const { return cache_limit_; } private: static constexpr size_t kMinCacheLimit = 8096; // Minimum cache limit. CacheStore store_; // Underlying store. bool cache_gc_request_; // GC requested but possibly not yet enabled. size_t cache_limit_; // Number of bytes allowed before GC. bool cache_gc_; // GC enabled size_t cache_size_; // Number of bytes cached. }; template <class CacheStore> void GCCacheStore<CacheStore>::GC(const State *current, bool free_recent, float cache_fraction) { if (!cache_gc_) return; VLOG(2) << "GCCacheStore: Enter GC: object = " << "(" << this << "), free recently cached = " << free_recent << ", cache size = " << cache_size_ << ", cache frac = " << cache_fraction << ", cache limit = " << cache_limit_ << "\n"; size_t cache_target = cache_fraction * cache_limit_; store_.Reset(); while (!store_.Done()) { auto *state = store_.GetMutableState(store_.Value()); if (cache_size_ > cache_target && state->RefCount() == 0 && (free_recent || !(state->Flags() & kCacheRecent)) && state != current) { if (state->Flags() & kCacheInit) { size_t size = sizeof(State) + state->NumArcs() * sizeof(Arc); if (size < cache_size_) { cache_size_ -= size; } } store_.Delete(); } else { state->SetFlags(0, kCacheRecent); store_.Next(); } } if (!free_recent && cache_size_ > cache_target) { // Recurses on recent. GC(current, true, cache_fraction); } else if (cache_target > 0) { // Widens cache limit. while (cache_size_ > cache_target) { cache_limit_ *= 2; cache_target *= 2; } } else if (cache_size_ > 0) { FSTERROR() << "GCCacheStore:GC: Unable to free all cached states"; } VLOG(2) << "GCCacheStore: Exit GC: object = " << "(" << this << "), free recently cached = " << free_recent << ", cache size = " << cache_size_ << ", cache frac = " << cache_fraction << ", cache limit = " << cache_limit_ << "\n"; } template <class CacheStore> constexpr size_t GCCacheStore<CacheStore>::kMinCacheLimit; // This class is the default cache state and store used by CacheBaseImpl. // It uses VectorCacheStore for storage decorated by FirstCacheStore // and GCCacheStore to do (optional) garbage collection. template <class Arc> class DefaultCacheStore : public GCCacheStore<FirstCacheStore<VectorCacheStore<CacheState<Arc>>>> { public: explicit DefaultCacheStore(const CacheOptions &opts) : GCCacheStore<FirstCacheStore<VectorCacheStore<CacheState<Arc>>>>(opts) { } }; namespace internal { // This class is used to cache FST elements stored in states of type State // (see CacheState) with the flags used to indicate what has been cached. Use // HasStart(), HasFinal(), and HasArcs() to determine if cached and SetStart(), // SetFinal(), AddArc(), (or PushArc() and SetArcs()) to cache. Note that you // must set the final weight even if the state is non-final to mark it as // cached. The state storage method and any garbage collection policy are // determined by the cache store. If the store is passed in with the options, // CacheBaseImpl takes ownership. template <class State, class CacheStore = DefaultCacheStore<typename State::Arc>> class CacheBaseImpl : public FstImpl<typename State::Arc> { public: using Arc = typename State::Arc; using StateId = typename Arc::StateId; using Weight = typename Arc::Weight; using Store = CacheStore; using FstImpl<Arc>::Type; using FstImpl<Arc>::Properties; explicit CacheBaseImpl(const CacheOptions &opts = CacheOptions()) : has_start_(false), cache_start_(kNoStateId), nknown_states_(0), min_unexpanded_state_id_(0), max_expanded_state_id_(-1), cache_gc_(opts.gc), cache_limit_(opts.gc_limit), cache_store_(new CacheStore(opts)), new_cache_store_(true), own_cache_store_(true) {} explicit CacheBaseImpl(const CacheImplOptions<CacheStore> &opts) : has_start_(false), cache_start_(kNoStateId), nknown_states_(0), min_unexpanded_state_id_(0), max_expanded_state_id_(-1), cache_gc_(opts.gc), cache_limit_(opts.gc_limit), cache_store_(opts.store ? opts.store : new CacheStore(CacheOptions( opts.gc, opts.gc_limit))), new_cache_store_(!opts.store), own_cache_store_(opts.store ? opts.own_store : true) {} // Preserve gc parameters. If preserve_cache is true, also preserves // cache data. CacheBaseImpl(const CacheBaseImpl<State, CacheStore> &impl, bool preserve_cache = false) : FstImpl<Arc>(), has_start_(false), cache_start_(kNoStateId), nknown_states_(0), min_unexpanded_state_id_(0), max_expanded_state_id_(-1), cache_gc_(impl.cache_gc_), cache_limit_(impl.cache_limit_), cache_store_(new CacheStore(CacheOptions(cache_gc_, cache_limit_))), new_cache_store_(impl.new_cache_store_ || !preserve_cache), own_cache_store_(true) { if (preserve_cache) { *cache_store_ = *impl.cache_store_; has_start_ = impl.has_start_; cache_start_ = impl.cache_start_; nknown_states_ = impl.nknown_states_; expanded_states_ = impl.expanded_states_; min_unexpanded_state_id_ = impl.min_unexpanded_state_id_; max_expanded_state_id_ = impl.max_expanded_state_id_; } } ~CacheBaseImpl() override { if (own_cache_store_) delete cache_store_; } void SetStart(StateId s) { cache_start_ = s; has_start_ = true; if (s >= nknown_states_) nknown_states_ = s + 1; } void SetFinal(StateId s, Weight weight) { auto *state = cache_store_->GetMutableState(s); state->SetFinal(std::move(weight)); static constexpr auto flags = kCacheFinal | kCacheRecent; state->SetFlags(flags, flags); } // Disabled to ensure PushArc not AddArc is used in existing code // TODO(sorenj): re-enable for backing store #if 0 // AddArc adds a single arc to a state and does incremental cache // book-keeping. For efficiency, prefer PushArc and SetArcs below // when possible. void AddArc(StateId s, const Arc &arc) { auto *state = cache_store_->GetMutableState(s); cache_store_->AddArc(state, arc); if (arc.nextstate >= nknown_states_) nknown_states_ = arc.nextstate + 1; SetExpandedState(s); static constexpr auto flags = kCacheArcs | kCacheRecent; state->SetFlags(flags, flags); } #endif // Adds a single arc to a state but delays cache book-keeping. SetArcs must // be called when all PushArc calls at a state are complete. Do not mix with // calls to AddArc. void PushArc(StateId s, const Arc &arc) { auto *state = cache_store_->GetMutableState(s); state->PushArc(arc); } // Marks arcs of a state as cached and does cache book-keeping after all // calls to PushArc have been completed. Do not mix with calls to AddArc. void SetArcs(StateId s) { auto *state = cache_store_->GetMutableState(s); cache_store_->SetArcs(state); const auto narcs = state->NumArcs(); for (size_t a = 0; a < narcs; ++a) { const auto &arc = state->GetArc(a); if (arc.nextstate >= nknown_states_) nknown_states_ = arc.nextstate + 1; } SetExpandedState(s); static constexpr auto flags = kCacheArcs | kCacheRecent; state->SetFlags(flags, flags); } void ReserveArcs(StateId s, size_t n) { auto *state = cache_store_->GetMutableState(s); state->ReserveArcs(n); } void DeleteArcs(StateId s) { auto *state = cache_store_->GetMutableState(s); cache_store_->DeleteArcs(state); } void DeleteArcs(StateId s, size_t n) { auto *state = cache_store_->GetMutableState(s); cache_store_->DeleteArcs(state, n); } void Clear() { nknown_states_ = 0; min_unexpanded_state_id_ = 0; max_expanded_state_id_ = -1; has_start_ = false; cache_start_ = kNoStateId; cache_store_->Clear(); } // Is the start state cached? bool HasStart() const { if (!has_start_ && Properties(kError)) has_start_ = true; return has_start_; } // Is the final weight of the state cached? bool HasFinal(StateId s) const { const auto *state = cache_store_->GetState(s); if (state && state->Flags() & kCacheFinal) { state->SetFlags(kCacheRecent, kCacheRecent); return true; } else { return false; } } // Are arcs of the state cached? bool HasArcs(StateId s) const { const auto *state = cache_store_->GetState(s); if (state && state->Flags() & kCacheArcs) { state->SetFlags(kCacheRecent, kCacheRecent); return true; } else { return false; } } StateId Start() const { return cache_start_; } Weight Final(StateId s) const { const auto *state = cache_store_->GetState(s); return state->Final(); } size_t NumArcs(StateId s) const { const auto *state = cache_store_->GetState(s); return state->NumArcs(); } size_t NumInputEpsilons(StateId s) const { const auto *state = cache_store_->GetState(s); return state->NumInputEpsilons(); } size_t NumOutputEpsilons(StateId s) const { const auto *state = cache_store_->GetState(s); return state->NumOutputEpsilons(); } // Provides information needed for generic arc iterator. void InitArcIterator(StateId s, ArcIteratorData<Arc> *data) const { const auto *state = cache_store_->GetState(s); data->base = nullptr; data->narcs = state->NumArcs(); data->arcs = state->Arcs(); data->ref_count = state->MutableRefCount(); state->IncrRefCount(); } // Number of known states. StateId NumKnownStates() const { return nknown_states_; } // Updates number of known states, taking into account the passed state ID. void UpdateNumKnownStates(StateId s) { if (s >= nknown_states_) nknown_states_ = s + 1; } // Finds the mininum never-expanded state ID. StateId MinUnexpandedState() const { while (min_unexpanded_state_id_ <= max_expanded_state_id_ && ExpandedState(min_unexpanded_state_id_)) { ++min_unexpanded_state_id_; } return min_unexpanded_state_id_; } // Returns maximum ever-expanded state ID. StateId MaxExpandedState() const { return max_expanded_state_id_; } void SetExpandedState(StateId s) { if (s > max_expanded_state_id_) max_expanded_state_id_ = s; if (s < min_unexpanded_state_id_) return; if (s == min_unexpanded_state_id_) ++min_unexpanded_state_id_; if (cache_gc_ || cache_limit_ == 0) { if (expanded_states_.size() <= s) expanded_states_.resize(s + 1, false); expanded_states_[s] = true; } } bool ExpandedState(StateId s) const { if (cache_gc_ || cache_limit_ == 0) { return expanded_states_[s]; } else if (new_cache_store_) { return cache_store_->GetState(s) != nullptr; } else { // If the cache was not created by this class, then the cached state needs // to be inspected to update nknown_states_. return false; } } const CacheStore *GetCacheStore() const { return cache_store_; } CacheStore *GetCacheStore() { return cache_store_; } // Caching on/off switch, limit and size accessors. bool GetCacheGc() const { return cache_gc_; } size_t GetCacheLimit() const { return cache_limit_; } private: mutable bool has_start_; // Is the start state cached? StateId cache_start_; // ID of start state. StateId nknown_states_; // Number of known states. std::vector<bool> expanded_states_; // States that have been expanded. mutable StateId min_unexpanded_state_id_; // Minimum never-expanded state ID mutable StateId max_expanded_state_id_; // Maximum ever-expanded state ID bool cache_gc_; // GC enabled. size_t cache_limit_; // Number of bytes allowed before GC. CacheStore *cache_store_; // The store of cached states. bool new_cache_store_; // Was the store was created by class? bool own_cache_store_; // Is the store owned by class? CacheBaseImpl &operator=(const CacheBaseImpl &impl) = delete; }; // A CacheBaseImpl with the default cache state type. template <class Arc> class CacheImpl : public CacheBaseImpl<CacheState<Arc>> { public: using State = CacheState<Arc>; CacheImpl() {} explicit CacheImpl(const CacheOptions &opts) : CacheBaseImpl<CacheState<Arc>>(opts) {} CacheImpl(const CacheImpl<Arc> &impl, bool preserve_cache = false) : CacheBaseImpl<State>(impl, preserve_cache) {} private: CacheImpl &operator=(const CacheImpl &impl) = delete; }; } // namespace internal // Use this to make a state iterator for a CacheBaseImpl-derived FST, which must // have Arc and Store types defined. Note this iterator only returns those // states reachable from the initial state, so consider implementing a // class-specific one. // // This class may be derived from. template <class FST> class CacheStateIterator : public StateIteratorBase<typename FST::Arc> { public: using Arc = typename FST::Arc; using StateId = typename Arc::StateId; using Weight = typename Arc::Weight; using Store = typename FST::Store; using State = typename Store::State; using Impl = internal::CacheBaseImpl<State, Store>; CacheStateIterator(const FST &fst, Impl *impl) : fst_(fst), impl_(impl), s_(0) { fst_.Start(); // Forces start state. } bool Done() const final { if (s_ < impl_->NumKnownStates()) return false; for (StateId u = impl_->MinUnexpandedState(); u < impl_->NumKnownStates(); u = impl_->MinUnexpandedState()) { // Forces state expansion. ArcIterator<FST> aiter(fst_, u); aiter.SetFlags(kArcValueFlags, kArcValueFlags | kArcNoCache); for (; !aiter.Done(); aiter.Next()) { impl_->UpdateNumKnownStates(aiter.Value().nextstate); } impl_->SetExpandedState(u); if (s_ < impl_->NumKnownStates()) return false; } return true; } StateId Value() const final { return s_; } void Next() final { ++s_; } void Reset() final { s_ = 0; } private: const FST &fst_; Impl *impl_; StateId s_; }; // Used to make an arc iterator for a CacheBaseImpl-derived FST, which must // have Arc and State types defined. template <class FST> class CacheArcIterator { public: using Arc = typename FST::Arc; using StateId = typename Arc::StateId; using Weight = typename Arc::Weight; using Store = typename FST::Store; using State = typename Store::State; using Impl = internal::CacheBaseImpl<State, Store>; CacheArcIterator(Impl *impl, StateId s) : i_(0) { state_ = impl->GetCacheStore()->GetMutableState(s); state_->IncrRefCount(); } ~CacheArcIterator() { state_->DecrRefCount(); } bool Done() const { return i_ >= state_->NumArcs(); } const Arc &Value() const { return state_->GetArc(i_); } void Next() { ++i_; } size_t Position() const { return i_; } void Reset() { i_ = 0; } void Seek(size_t a) { i_ = a; } constexpr uint32 Flags() const { return kArcValueFlags; } void SetFlags(uint32 flags, uint32 mask) {} private: const State *state_; size_t i_; CacheArcIterator(const CacheArcIterator &) = delete; CacheArcIterator &operator=(const CacheArcIterator &) = delete; }; // Use this to make a mutable arc iterator for a CacheBaseImpl-derived FST, // which must have types Arc and Store defined. template <class FST> class CacheMutableArcIterator : public MutableArcIteratorBase<typename FST::Arc> { public: using Arc = typename FST::Arc; using StateId = typename Arc::StateId; using Weight = typename Arc::Weight; using Store = typename FST::Store; using State = typename Store::State; using Impl = internal::CacheBaseImpl<State, Store>; // User must call MutateCheck() in the constructor. CacheMutableArcIterator(Impl *impl, StateId s) : i_(0), s_(s), impl_(impl) { state_ = impl_->GetCacheStore()->GetMutableState(s_); state_->IncrRefCount(); } ~CacheMutableArcIterator() override { state_->DecrRefCount(); } bool Done() const final { return i_ >= state_->NumArcs(); } const Arc &Value() const final { return state_->GetArc(i_); } void Next() final { ++i_; } size_t Position() const final { return i_; } void Reset() final { i_ = 0; } void Seek(size_t a) final { i_ = a; } void SetValue(const Arc &arc) final { state_->SetArc(arc, i_); } uint32 Flags() const final { return kArcValueFlags; } void SetFlags(uint32, uint32) final {} private: size_t i_; StateId s_; Impl *impl_; State *state_; CacheMutableArcIterator(const CacheMutableArcIterator &) = delete; CacheMutableArcIterator &operator=(const CacheMutableArcIterator &) = delete; }; // Wrap existing CacheStore implementation to use with ExpanderFst. template <class CacheStore> class ExpanderCacheStore { public: using State = typename CacheStore::State; using Arc = typename CacheStore::Arc; using StateId = typename Arc::StateId; using Weight = typename Arc::Weight; explicit ExpanderCacheStore(const CacheOptions &opts = CacheOptions()) : store_(opts) {} template <class Expander> State *FindOrExpand(Expander &expander, StateId s) { // NOLINT auto *state = store_.GetMutableState(s); if (state->Flags()) { state->SetFlags(kCacheRecent, kCacheRecent); } else { StateBuilder builder(state); expander.Expand(s, &builder); state->SetFlags(kCacheFlags, kCacheFlags); store_.SetArcs(state); } return state; } private: CacheStore store_; struct StateBuilder { State *state; explicit StateBuilder(State *state_) : state(state_) {} void AddArc(const Arc &arc) { state->PushArc(arc); } void SetFinal(Weight weight) { state->SetFinal(std::move(weight)); } }; }; } // namespace fst #endif // FST_CACHE_H_
0
coqui_public_repos/STT
coqui_public_repos/STT/taskcluster/test-nodejs_14x_8k_multiarchpkg-linux-tflite-opt.yml
build: template_file: test-linux-opt-base.tyml docker_image: "ubuntu:16.04" dependencies: - "node-package-tflite" - "test-training_8k-linux-amd64-py36m-opt" test_model_task: "test-training_8k-linux-amd64-py36m-opt" system_setup: > ${nodejs.packages_xenial.prep_14} && ${nodejs.packages_xenial.apt_pinning} && apt-get -qq update && apt-get -qq -y install ${nodejs.packages_xenial.apt} args: tests_cmdline: "${system.homedir.linux}/DeepSpeech/ds/taskcluster/tc-node_tflite-tests.sh 14.x 8k" workerType: "${docker.dsTests}" metadata: name: "DeepSpeech Linux AMD64 TFLite NodeJS MultiArch Package 14.x tests (8kHz)" description: "Testing DeepSpeech for Linux/AMD64 on NodeJS MultiArch Package v14.x, TFLite only, optimized version (8kHz)"
0
coqui_public_repos/STT
coqui_public_repos/STT/taskcluster/test-electronjs_v8.0_multiarchpkg-win-tflite-opt.yml
build: template_file: test-win-opt-base.tyml dependencies: - "node-package-tflite" - "test-training_16k-linux-amd64-py36m-opt" test_model_task: "test-training_16k-linux-amd64-py36m-opt" system_setup: > ${system.sox_win} && ${nodejs.win.prep_12} args: tests_cmdline: "${system.homedir.win}/DeepSpeech/ds/taskcluster/tc-electron_tflite-tests.sh 12.x 8.0.1 16k" metadata: name: "DeepSpeech Windows AMD64 TFLite ElectronJS MultiArch Package v8.0 tests" description: "Testing DeepSpeech for Windows/AMD64 on ElectronJS MultiArch Package v8.0, TFLite only, optimized version"
0
coqui_public_repos/STT/native_client/ctcdecode/third_party/openfst-1.6.9-win/src/include/fst/extensions
coqui_public_repos/STT/native_client/ctcdecode/third_party/openfst-1.6.9-win/src/include/fst/extensions/far/farscript.h
// See www.openfst.org for extensive documentation on this weighted // finite-state transducer library. // // Convenience file for including all of the FAR operations, or registering // them for new arc types. #ifndef FST_EXTENSIONS_FAR_FARSCRIPT_H_ #define FST_EXTENSIONS_FAR_FARSCRIPT_H_ #include <string> #include <vector> #include <fst/types.h> #include <fst/extensions/far/compile-strings.h> #include <fst/extensions/far/create.h> #include <fst/extensions/far/equal.h> #include <fst/extensions/far/extract.h> #include <fst/extensions/far/far.h> #include <fst/extensions/far/far-class.h> #include <fst/extensions/far/info.h> #include <fst/extensions/far/isomorphic.h> #include <fst/extensions/far/print-strings.h> #include <fst/extensions/far/script-impl.h> #include <fst/script/arg-packs.h> namespace fst { namespace script { // Note: it is safe to pass these strings as references because this struct is // only used to pass them deeper in the call graph. Be sure you understand why // this is so before using this struct for anything else! struct FarCompileStringsArgs { const std::vector<string> &in_fnames; const string &out_fname; const string &fst_type; const FarType &far_type; const int32_t generate_keys; const FarEntryType fet; const FarTokenType tt; const string &symbols_fname; const string &unknown_symbol; const bool keep_symbols; const bool initial_symbols; const bool allow_negative_labels; const string &key_prefix; const string &key_suffix; FarCompileStringsArgs(const std::vector<string> &in_fnames, const string &out_fname, const string &fst_type, const FarType &far_type, int32_t generate_keys, FarEntryType fet, FarTokenType tt, const string &symbols_fname, const string &unknown_symbol, bool keep_symbols, bool initial_symbols, bool allow_negative_labels, const string &key_prefix, const string &key_suffix) : in_fnames(in_fnames), out_fname(out_fname), fst_type(fst_type), far_type(far_type), generate_keys(generate_keys), fet(fet), tt(tt), symbols_fname(symbols_fname), unknown_symbol(unknown_symbol), keep_symbols(keep_symbols), initial_symbols(initial_symbols), allow_negative_labels(allow_negative_labels), key_prefix(key_prefix), key_suffix(key_suffix) {} }; template <class Arc> void FarCompileStrings(FarCompileStringsArgs *args) { FarCompileStrings<Arc>( args->in_fnames, args->out_fname, args->fst_type, args->far_type, args->generate_keys, args->fet, args->tt, args->symbols_fname, args->unknown_symbol, args->keep_symbols, args->initial_symbols, args->allow_negative_labels, args->key_prefix, args->key_suffix); } void FarCompileStrings(const std::vector<string> &in_fnames, const string &out_fname, const string &arc_type, const string &fst_type, const FarType &far_type, int32_t generate_keys, FarEntryType fet, FarTokenType tt, const string &symbols_fname, const string &unknown_symbol, bool keep_symbols, bool initial_symbols, bool allow_negative_labels, const string &key_prefix, const string &key_suffix); // Note: it is safe to pass these strings as references because this struct is // only used to pass them deeper in the call graph. Be sure you understand why // this is so before using this struct for anything else! struct FarCreateArgs { const std::vector<string> &in_fnames; const string &out_fname; const int32_t generate_keys; const FarType &far_type; const string &key_prefix; const string &key_suffix; FarCreateArgs(const std::vector<string> &in_fnames, const string &out_fname, const int32_t generate_keys, const FarType &far_type, const string &key_prefix, const string &key_suffix) : in_fnames(in_fnames), out_fname(out_fname), generate_keys(generate_keys), far_type(far_type), key_prefix(key_prefix), key_suffix(key_suffix) {} }; template <class Arc> void FarCreate(FarCreateArgs *args) { FarCreate<Arc>(args->in_fnames, args->out_fname, args->generate_keys, args->far_type, args->key_prefix, args->key_suffix); } void FarCreate(const std::vector<string> &in_fnames, const string &out_fname, const string &arc_type, const int32_t generate_keys, const FarType &far_type, const string &key_prefix, const string &key_suffix); using FarEqualInnerArgs = std::tuple<const string &, const string &, float, const string &, const string &>; using FarEqualArgs = WithReturnValue<bool, FarEqualInnerArgs>; template <class Arc> void FarEqual(FarEqualArgs *args) { args->retval = fst::FarEqual<Arc>( std::get<0>(args->args), std::get<1>(args->args), std::get<2>(args->args), std::get<3>(args->args), std::get<4>(args->args)); } bool FarEqual(const string &filename1, const string &filename2, const string &arc_type, float delta = kDelta, const string &begin_key = string(), const string &end_key = string()); using FarExtractArgs = std::tuple<const std::vector<string> &, int32_t, const string &, const string &, const string &, const string &, const string &>; template <class Arc> void FarExtract(FarExtractArgs *args) { fst::FarExtract<Arc>(std::get<0>(*args), std::get<1>(*args), std::get<2>(*args), std::get<3>(*args), std::get<4>(*args), std::get<5>(*args), std::get<6>(*args)); } void FarExtract(const std::vector<string> &ifilenames, const string &arc_type, int32_t generate_filenames, const string &keys, const string &key_separator, const string &range_delimiter, const string &filename_prefix, const string &filename_suffix); using FarInfoArgs = std::tuple<const std::vector<string> &, const string &, const string &, const bool>; template <class Arc> void FarInfo(FarInfoArgs *args) { fst::FarInfo<Arc>(std::get<0>(*args), std::get<1>(*args), std::get<2>(*args), std::get<3>(*args)); } void FarInfo(const std::vector<string> &filenames, const string &arc_type, const string &begin_key, const string &end_key, const bool list_fsts); using GetFarInfoArgs = std::tuple<const std::vector<string> &, const string &, const string &, const bool, FarInfoData *>; template <class Arc> void GetFarInfo(GetFarInfoArgs *args) { fst::GetFarInfo<Arc>(std::get<0>(*args), std::get<1>(*args), std::get<2>(*args), std::get<3>(*args), std::get<4>(*args)); } void GetFarInfo(const std::vector<string> &filenames, const string &arc_type, const string &begin_key, const string &end_key, const bool list_fsts, FarInfoData *); using FarIsomorphicInnerArgs = std::tuple<const string &, const string &, float, const string &, const string &>; using FarIsomorphicArgs = WithReturnValue<bool, FarIsomorphicInnerArgs>; template <class Arc> void FarIsomorphic(FarIsomorphicArgs *args) { args->retval = fst::FarIsomorphic<Arc>( std::get<0>(args->args), std::get<1>(args->args), std::get<2>(args->args), std::get<3>(args->args), std::get<4>(args->args)); } bool FarIsomorphic(const string &filename1, const string &filename2, const string &arc_type, float delta = kDelta, const string &begin_key = string(), const string &end_key = string()); struct FarPrintStringsArgs { const std::vector<string> &ifilenames; const FarEntryType entry_type; const FarTokenType token_type; const string &begin_key; const string &end_key; const bool print_key; const bool print_weight; const string &symbols_fname; const bool initial_symbols; const int32_t generate_filenames; const string &filename_prefix; const string &filename_suffix; FarPrintStringsArgs(const std::vector<string> &ifilenames, const FarEntryType entry_type, const FarTokenType token_type, const string &begin_key, const string &end_key, const bool print_key, const bool print_weight, const string &symbols_fname, const bool initial_symbols, const int32_t generate_filenames, const string &filename_prefix, const string &filename_suffix) : ifilenames(ifilenames), entry_type(entry_type), token_type(token_type), begin_key(begin_key), end_key(end_key), print_key(print_key), print_weight(print_weight), symbols_fname(symbols_fname), initial_symbols(initial_symbols), generate_filenames(generate_filenames), filename_prefix(filename_prefix), filename_suffix(filename_suffix) {} }; template <class Arc> void FarPrintStrings(FarPrintStringsArgs *args) { fst::FarPrintStrings<Arc>( args->ifilenames, args->entry_type, args->token_type, args->begin_key, args->end_key, args->print_key, args->print_weight, args->symbols_fname, args->initial_symbols, args->generate_filenames, args->filename_prefix, args->filename_suffix); } void FarPrintStrings(const std::vector<string> &ifilenames, const string &arc_type, const FarEntryType entry_type, const FarTokenType token_type, const string &begin_key, const string &end_key, const bool print_key, const bool print_weight, const string &symbols_fname, const bool initial_symbols, const int32_t generate_filenames, const string &filename_prefix, const string &filename_suffix); } // namespace script } // namespace fst #define REGISTER_FST_FAR_OPERATIONS(ArcType) \ REGISTER_FST_OPERATION(FarCompileStrings, ArcType, FarCompileStringsArgs); \ REGISTER_FST_OPERATION(FarCreate, ArcType, FarCreateArgs); \ REGISTER_FST_OPERATION(FarEqual, ArcType, FarEqualArgs); \ REGISTER_FST_OPERATION(FarExtract, ArcType, FarExtractArgs); \ REGISTER_FST_OPERATION(FarInfo, ArcType, FarInfoArgs); \ REGISTER_FST_OPERATION(FarIsomorphic, ArcType, FarIsomorphicArgs); \ REGISTER_FST_OPERATION(FarPrintStrings, ArcType, FarPrintStringsArgs); \ REGISTER_FST_OPERATION(GetFarInfo, ArcType, GetFarInfoArgs) #endif // FST_EXTENSIONS_FAR_FARSCRIPT_H_
0
coqui_public_repos/STT
coqui_public_repos/STT/taskcluster/kenlm_darwin-amd64-cpu-opt.yml
build: template_file: generic_tc_caching-darwin-opt-base.tyml cache: artifact_url: ${system.kenlm.darwin_amd64_cpu.url} artifact_namespace: ${system.kenlm.darwin_amd64_cpu.namespace} scripts: setup: "taskcluster/kenlm_tc-setup.sh --macos-amd64" build: "taskcluster/kenlm_tc-build.sh --macos-amd64" package: "taskcluster/kenlm_tc-package.sh" workerType: ${macOS.dsBuild} metadata: name: "KenLM macOS AMD64 CPU" description: "Building KenLM for macOS/AMD64, CPU only, optimized version"
0
coqui_public_repos/inference-engine/src
coqui_public_repos/inference-engine/src/ctcdecode/COPYING
Decoder sources originally imported from https://github.com/parlance/ctcdecode, commit 140b45860cec6671fb0bf6dbb675073241c0f9b0 Decoder sources are under the MIT license (LICENSE.parlance). Binding code adapted from https://github.com/PaddlePaddle/DeepSpeech/tree/develop/decoders/swig, commit 3ea19973c66a6a10320888ba47a8857bebf5abfa Binding code are under the Apache License (LICENSE.paddlepaddle).
0
coqui_public_repos/STT-models/french/commonvoice-fr
coqui_public_repos/STT-models/french/commonvoice-fr/v0.9/alphabet.txt
# Each line in this file represents the Unicode codepoint (UTF-8 encoded) # associated with a numeric index. # A line that starts with # is a comment. You can escape it with \# if you wish # to use '#' in the Alphabet. ' a b c d e f g h i j k l m n o p q r s t u v w x y z ~ ® à á â ã ç è é ê ë í î ï ñ ò ó ô ö ù û ü ď ĩ ĺ ń ō œ ţ ũ ū ŭ ů ű ŵ ǎ ǔ ɑ ɨ ʋ θ φ о п ц ч э і ј џ ӌ գ զ ḥ ẓ ẵ ế ề ố ớ ờ ụ ủ ứ ‐ ― ’ ₽ ∆ − ∨ ⋅ ⠈ ꝑ ÿ # The last (non-comment) line needs to end with a newline.
0
coqui_public_repos/TTS/TTS/tts/utils/text
coqui_public_repos/TTS/TTS/tts/utils/text/phonemizers/__init__.py
from TTS.tts.utils.text.phonemizers.bangla_phonemizer import BN_Phonemizer from TTS.tts.utils.text.phonemizers.base import BasePhonemizer from TTS.tts.utils.text.phonemizers.belarusian_phonemizer import BEL_Phonemizer from TTS.tts.utils.text.phonemizers.espeak_wrapper import ESpeak from TTS.tts.utils.text.phonemizers.gruut_wrapper import Gruut from TTS.tts.utils.text.phonemizers.ko_kr_phonemizer import KO_KR_Phonemizer from TTS.tts.utils.text.phonemizers.zh_cn_phonemizer import ZH_CN_Phonemizer try: from TTS.tts.utils.text.phonemizers.ja_jp_phonemizer import JA_JP_Phonemizer except ImportError: JA_JP_Phonemizer = None pass PHONEMIZERS = {b.name(): b for b in (ESpeak, Gruut, KO_KR_Phonemizer, BN_Phonemizer)} ESPEAK_LANGS = list(ESpeak.supported_languages().keys()) GRUUT_LANGS = list(Gruut.supported_languages()) # Dict setting default phonemizers for each language # Add Gruut languages _ = [Gruut.name()] * len(GRUUT_LANGS) DEF_LANG_TO_PHONEMIZER = dict(list(zip(GRUUT_LANGS, _))) # Add ESpeak languages and override any existing ones _ = [ESpeak.name()] * len(ESPEAK_LANGS) _new_dict = dict(list(zip(list(ESPEAK_LANGS), _))) DEF_LANG_TO_PHONEMIZER.update(_new_dict) # Force default for some languages DEF_LANG_TO_PHONEMIZER["en"] = DEF_LANG_TO_PHONEMIZER["en-us"] DEF_LANG_TO_PHONEMIZER["zh-cn"] = ZH_CN_Phonemizer.name() DEF_LANG_TO_PHONEMIZER["ko-kr"] = KO_KR_Phonemizer.name() DEF_LANG_TO_PHONEMIZER["bn"] = BN_Phonemizer.name() DEF_LANG_TO_PHONEMIZER["be"] = BEL_Phonemizer.name() # JA phonemizer has deal breaking dependencies like MeCab for some systems. # So we only have it when we have it. if JA_JP_Phonemizer is not None: PHONEMIZERS[JA_JP_Phonemizer.name()] = JA_JP_Phonemizer DEF_LANG_TO_PHONEMIZER["ja-jp"] = JA_JP_Phonemizer.name() def get_phonemizer_by_name(name: str, **kwargs) -> BasePhonemizer: """Initiate a phonemizer by name Args: name (str): Name of the phonemizer that should match `phonemizer.name()`. kwargs (dict): Extra keyword arguments that should be passed to the phonemizer. """ if name == "espeak": return ESpeak(**kwargs) if name == "gruut": return Gruut(**kwargs) if name == "zh_cn_phonemizer": return ZH_CN_Phonemizer(**kwargs) if name == "ja_jp_phonemizer": if JA_JP_Phonemizer is None: raise ValueError(" ❗ You need to install JA phonemizer dependencies. Try `pip install TTS[ja]`.") return JA_JP_Phonemizer(**kwargs) if name == "ko_kr_phonemizer": return KO_KR_Phonemizer(**kwargs) if name == "bn_phonemizer": return BN_Phonemizer(**kwargs) if name == "be_phonemizer": return BEL_Phonemizer(**kwargs) raise ValueError(f"Phonemizer {name} not found") if __name__ == "__main__": print(DEF_LANG_TO_PHONEMIZER)
0
coqui_public_repos/STT/native_client/kenlm/lm/common/test_data
coqui_public_repos/STT/native_client/kenlm/lm/common/test_data/littleendian/toy0.vocab
<unk><s>a</s>b
0
coqui_public_repos/TTS/recipes
coqui_public_repos/TTS/recipes/blizzard2013/README.md
# How to get the Blizzard 2013 Dataset The Capacitron model is a variational encoder extension of standard Tacotron based models to model prosody. To take full advantage of the model, it is advised to train the model with a dataset that contains a significant amount of prosodic information in the utterances. A tested candidate for such applications is the blizzard2013 dataset from the Blizzard Challenge, containing many hours of high quality audio book recordings. To get a license and download link for this dataset, you need to visit the [website](https://www.cstr.ed.ac.uk/projects/blizzard/2013/lessac_blizzard2013/license.html) of the Centre for Speech Technology Research of the University of Edinburgh. You get access to the raw dataset in a couple of days. There are a few preprocessing steps you need to do to be able to use the high fidelity dataset. 1. Get the forced time alignments for the blizzard dataset from [here](https://github.com/mueller91/tts_alignments). 2. Segment the high fidelity audio-book files based on the instructions [here](https://github.com/Tomiinek/Blizzard2013_Segmentation).
0
coqui_public_repos/STT/native_client/ctcdecode/third_party/openfst-1.6.7/src/include
coqui_public_repos/STT/native_client/ctcdecode/third_party/openfst-1.6.7/src/include/fst/state-map.h
// See www.openfst.org for extensive documentation on this weighted // finite-state transducer library. // // Class to map over/transform states e.g., sort transitions. // // Consider using when operation does not change the number of states. #ifndef FST_STATE_MAP_H_ #define FST_STATE_MAP_H_ #include <algorithm> #include <string> #include <utility> #include <fst/log.h> #include <fst/arc-map.h> #include <fst/cache.h> #include <fst/mutable-fst.h> namespace fst { // StateMapper Interface. The class determines how states are mapped; useful for // implementing operations that do not change the number of states. // // class StateMapper { // public: // using FromArc = A; // using ToArc = B; // // // Typical constructor. // StateMapper(const Fst<A> &fst); // // // Required copy constructor that allows updating FST argument; // // pass only if relevant and changed. // StateMapper(const StateMapper &mapper, const Fst<A> *fst = 0); // // // Specifies initial state of result. // B::StateId Start() const; // // Specifies state's final weight in result. // B::Weight Final(B::StateId state) const; // // // These methods iterate through a state's arcs in result. // // // Specifies state to iterate over. // void SetState(B::StateId state); // // // End of arcs? // bool Done() const; // // // Current arc. // const B &Value() const; // // // Advances to next arc (when !Done) // void Next(); // // // Specifies input symbol table action the mapper requires (see above). // MapSymbolsAction InputSymbolsAction() const; // // // Specifies output symbol table action the mapper requires (see above). // MapSymbolsAction OutputSymbolsAction() const; // // // This specifies the known properties of an FST mapped by this // // mapper. It takes as argument the input FST's known properties. // uint64 Properties(uint64 props) const; // }; // // We include a various state map versions below. One dimension of variation is // whether the mapping mutates its input, writes to a new result FST, or is an // on-the-fly Fst. Another dimension is how we pass the mapper. We allow passing // the mapper by pointer for cases that we need to change the state of the // user's mapper. We also include map versions that pass the mapper by value or // const reference when this suffices. // Maps an arc type A using a mapper function object C, passed by pointer. This // version modifies the input FST. template <class A, class C> void StateMap(MutableFst<A> *fst, C *mapper) { if (mapper->InputSymbolsAction() == MAP_CLEAR_SYMBOLS) { fst->SetInputSymbols(nullptr); } if (mapper->OutputSymbolsAction() == MAP_CLEAR_SYMBOLS) { fst->SetOutputSymbols(nullptr); } if (fst->Start() == kNoStateId) return; const auto props = fst->Properties(kFstProperties, false); fst->SetStart(mapper->Start()); for (StateIterator<Fst<A>> siter(*fst); !siter.Done(); siter.Next()) { const auto state = siter.Value(); mapper->SetState(state); fst->DeleteArcs(state); for (; !mapper->Done(); mapper->Next()) { fst->AddArc(state, mapper->Value()); } fst->SetFinal(state, mapper->Final(state)); } fst->SetProperties(mapper->Properties(props), kFstProperties); } // Maps an arc type A using a mapper function object C, passed by value. // This version modifies the input FST. template <class A, class C> void StateMap(MutableFst<A> *fst, C mapper) { StateMap(fst, &mapper); } // Maps an arc type A to an arc type B using mapper functor C, passed by // pointer. This version writes to an output FST. template <class A, class B, class C> void StateMap(const Fst<A> &ifst, MutableFst<B> *ofst, C *mapper) { ofst->DeleteStates(); if (mapper->InputSymbolsAction() == MAP_COPY_SYMBOLS) { ofst->SetInputSymbols(ifst.InputSymbols()); } else if (mapper->InputSymbolsAction() == MAP_CLEAR_SYMBOLS) { ofst->SetInputSymbols(nullptr); } if (mapper->OutputSymbolsAction() == MAP_COPY_SYMBOLS) { ofst->SetOutputSymbols(ifst.OutputSymbols()); } else if (mapper->OutputSymbolsAction() == MAP_CLEAR_SYMBOLS) { ofst->SetOutputSymbols(nullptr); } const auto iprops = ifst.Properties(kCopyProperties, false); if (ifst.Start() == kNoStateId) { if (iprops & kError) ofst->SetProperties(kError, kError); return; } // Adds all states. if (ifst.Properties(kExpanded, false)) ofst->ReserveStates(CountStates(ifst)); for (StateIterator<Fst<A>> siter(ifst); !siter.Done(); siter.Next()) { ofst->AddState(); } ofst->SetStart(mapper->Start()); for (StateIterator<Fst<A>> siter(ifst); !siter.Done(); siter.Next()) { const auto state = siter.Value(); mapper->SetState(state); for (; !mapper->Done(); mapper->Next()) { ofst->AddArc(state, mapper->Value()); } ofst->SetFinal(state, mapper->Final(state)); } const auto oprops = ofst->Properties(kFstProperties, false); ofst->SetProperties(mapper->Properties(iprops) | oprops, kFstProperties); } // Maps an arc type A to an arc type B using mapper functor object C, passed by // value. This version writes to an output FST. template <class A, class B, class C> void StateMap(const Fst<A> &ifst, MutableFst<B> *ofst, C mapper) { StateMap(ifst, ofst, &mapper); } using StateMapFstOptions = CacheOptions; template <class A, class B, class C> class StateMapFst; // Facade around StateIteratorBase<A> inheriting from StateIteratorBase<B>. template <class A, class B> class StateMapStateIteratorBase : public StateIteratorBase<B> { public: using Arc = B; using StateId = typename Arc::StateId; explicit StateMapStateIteratorBase(StateIteratorBase<A> *base) : base_(base) {} bool Done() const final { return base_->Done(); } StateId Value() const final { return base_->Value(); } void Next() final { base_->Next(); } void Reset() final { base_->Reset(); } private: std::unique_ptr<StateIteratorBase<A>> base_; StateMapStateIteratorBase() = delete; }; namespace internal { // Implementation of delayed StateMapFst. template <class A, class B, class C> class StateMapFstImpl : public CacheImpl<B> { public: using Arc = B; using StateId = typename Arc::StateId; using Weight = typename Arc::Weight; using FstImpl<B>::SetType; using FstImpl<B>::SetProperties; using FstImpl<B>::SetInputSymbols; using FstImpl<B>::SetOutputSymbols; using CacheImpl<B>::PushArc; using CacheImpl<B>::HasArcs; using CacheImpl<B>::HasFinal; using CacheImpl<B>::HasStart; using CacheImpl<B>::SetArcs; using CacheImpl<B>::SetFinal; using CacheImpl<B>::SetStart; friend class StateIterator<StateMapFst<A, B, C>>; StateMapFstImpl(const Fst<A> &fst, const C &mapper, const StateMapFstOptions &opts) : CacheImpl<B>(opts), fst_(fst.Copy()), mapper_(new C(mapper, fst_.get())), own_mapper_(true) { Init(); } StateMapFstImpl(const Fst<A> &fst, C *mapper, const StateMapFstOptions &opts) : CacheImpl<B>(opts), fst_(fst.Copy()), mapper_(mapper), own_mapper_(false) { Init(); } StateMapFstImpl(const StateMapFstImpl<A, B, C> &impl) : CacheImpl<B>(impl), fst_(impl.fst_->Copy(true)), mapper_(new C(*impl.mapper_, fst_.get())), own_mapper_(true) { Init(); } ~StateMapFstImpl() override { if (own_mapper_) delete mapper_; } StateId Start() { if (!HasStart()) SetStart(mapper_->Start()); return CacheImpl<B>::Start(); } Weight Final(StateId state) { if (!HasFinal(state)) SetFinal(state, mapper_->Final(state)); return CacheImpl<B>::Final(state); } size_t NumArcs(StateId state) { if (!HasArcs(state)) Expand(state); return CacheImpl<B>::NumArcs(state); } size_t NumInputEpsilons(StateId state) { if (!HasArcs(state)) Expand(state); return CacheImpl<B>::NumInputEpsilons(state); } size_t NumOutputEpsilons(StateId state) { if (!HasArcs(state)) Expand(state); return CacheImpl<B>::NumOutputEpsilons(state); } void InitStateIterator(StateIteratorData<B> *datb) const { StateIteratorData<A> data; fst_->InitStateIterator(&data); datb->base = data.base ? new StateMapStateIteratorBase<A, B>(data.base) : nullptr; datb->nstates = data.nstates; } void InitArcIterator(StateId state, ArcIteratorData<B> *data) { if (!HasArcs(state)) Expand(state); CacheImpl<B>::InitArcIterator(state, data); } uint64 Properties() const override { return Properties(kFstProperties); } uint64 Properties(uint64 mask) const override { if ((mask & kError) && (fst_->Properties(kError, false) || (mapper_->Properties(0) & kError))) { SetProperties(kError, kError); } return FstImpl<Arc>::Properties(mask); } void Expand(StateId state) { // Adds exiting arcs. for (mapper_->SetState(state); !mapper_->Done(); mapper_->Next()) { PushArc(state, mapper_->Value()); } SetArcs(state); } const Fst<A> *GetFst() const { return fst_.get(); } private: void Init() { SetType("statemap"); if (mapper_->InputSymbolsAction() == MAP_COPY_SYMBOLS) { SetInputSymbols(fst_->InputSymbols()); } else if (mapper_->InputSymbolsAction() == MAP_CLEAR_SYMBOLS) { SetInputSymbols(nullptr); } if (mapper_->OutputSymbolsAction() == MAP_COPY_SYMBOLS) { SetOutputSymbols(fst_->OutputSymbols()); } else if (mapper_->OutputSymbolsAction() == MAP_CLEAR_SYMBOLS) { SetOutputSymbols(nullptr); } const auto props = fst_->Properties(kCopyProperties, false); SetProperties(mapper_->Properties(props)); } std::unique_ptr<const Fst<A>> fst_; C *mapper_; bool own_mapper_; }; } // namespace internal // Maps an arc type A to an arc type B using Mapper function object // C. This version is a delayed FST. template <class A, class B, class C> class StateMapFst : public ImplToFst<internal::StateMapFstImpl<A, B, C>> { public: friend class ArcIterator<StateMapFst<A, B, C>>; using Arc = B; using StateId = typename Arc::StateId; using Weight = typename Arc::Weight; using Store = DefaultCacheStore<Arc>; using State = typename Store::State; using Impl = internal::StateMapFstImpl<A, B, C>; StateMapFst(const Fst<A> &fst, const C &mapper, const StateMapFstOptions &opts) : ImplToFst<Impl>(std::make_shared<Impl>(fst, mapper, opts)) {} StateMapFst(const Fst<A> &fst, C *mapper, const StateMapFstOptions &opts) : ImplToFst<Impl>(std::make_shared<Impl>(fst, mapper, opts)) {} StateMapFst(const Fst<A> &fst, const C &mapper) : ImplToFst<Impl>( std::make_shared<Impl>(fst, mapper, StateMapFstOptions())) {} StateMapFst(const Fst<A> &fst, C *mapper) : ImplToFst<Impl>( std::make_shared<Impl>(fst, mapper, StateMapFstOptions())) {} // See Fst<>::Copy() for doc. StateMapFst(const StateMapFst<A, B, C> &fst, bool safe = false) : ImplToFst<Impl>(fst, safe) {} // Get a copy of this StateMapFst. See Fst<>::Copy() for further doc. StateMapFst<A, B, C> *Copy(bool safe = false) const override { return new StateMapFst<A, B, C>(*this, safe); } void InitStateIterator(StateIteratorData<B> *data) const override { GetImpl()->InitStateIterator(data); } void InitArcIterator(StateId state, ArcIteratorData<B> *data) const override { GetMutableImpl()->InitArcIterator(state, data); } protected: using ImplToFst<Impl>::GetImpl; using ImplToFst<Impl>::GetMutableImpl; private: StateMapFst &operator=(const StateMapFst &) = delete; }; // Specialization for StateMapFst. template <class A, class B, class C> class ArcIterator<StateMapFst<A, B, C>> : public CacheArcIterator<StateMapFst<A, B, C>> { public: using StateId = typename A::StateId; ArcIterator(const StateMapFst<A, B, C> &fst, StateId state) : CacheArcIterator<StateMapFst<A, B, C>>(fst.GetMutableImpl(), state) { if (!fst.GetImpl()->HasArcs(state)) fst.GetMutableImpl()->Expand(state); } }; // Utility mappers. // Mapper that returns its input. template <class Arc> class IdentityStateMapper { public: using FromArc = Arc; using ToArc = Arc; using StateId = typename Arc::StateId; using Weight = typename Arc::Weight; explicit IdentityStateMapper(const Fst<Arc> &fst) : fst_(fst) {} // Allows updating FST argument; pass only if changed. IdentityStateMapper(const IdentityStateMapper<Arc> &mapper, const Fst<Arc> *fst = nullptr) : fst_(fst ? *fst : mapper.fst_) {} StateId Start() const { return fst_.Start(); } Weight Final(StateId state) const { return fst_.Final(state); } void SetState(StateId state) { aiter_.reset(new ArcIterator<Fst<Arc>>(fst_, state)); } bool Done() const { return aiter_->Done(); } const Arc &Value() const { return aiter_->Value(); } void Next() { aiter_->Next(); } constexpr MapSymbolsAction InputSymbolsAction() const { return MAP_COPY_SYMBOLS; } constexpr MapSymbolsAction OutputSymbolsAction() const { return MAP_COPY_SYMBOLS; } uint64 Properties(uint64 props) const { return props; } private: const Fst<Arc> &fst_; std::unique_ptr<ArcIterator<Fst<Arc>>> aiter_; }; template <class Arc> class ArcSumMapper { public: using FromArc = Arc; using ToArc = Arc; using StateId = typename Arc::StateId; using Weight = typename Arc::Weight; explicit ArcSumMapper(const Fst<Arc> &fst) : fst_(fst), i_(0) {} // Allows updating FST argument; pass only if changed. ArcSumMapper(const ArcSumMapper<Arc> &mapper, const Fst<Arc> *fst = nullptr) : fst_(fst ? *fst : mapper.fst_), i_(0) {} StateId Start() const { return fst_.Start(); } Weight Final(StateId state) const { return fst_.Final(state); } void SetState(StateId state) { i_ = 0; arcs_.clear(); arcs_.reserve(fst_.NumArcs(state)); for (ArcIterator<Fst<Arc>> aiter(fst_, state); !aiter.Done(); aiter.Next()) { arcs_.push_back(aiter.Value()); } // First sorts the exiting arcs by input label, output label and destination // state and then sums weights of arcs with the same input label, output // label, and destination state. std::sort(arcs_.begin(), arcs_.end(), comp_); size_t narcs = 0; for (const auto &arc : arcs_) { if (narcs > 0 && equal_(arc, arcs_[narcs - 1])) { arcs_[narcs - 1].weight = Plus(arcs_[narcs - 1].weight, arc.weight); } else { arcs_[narcs] = arc; ++narcs; } } arcs_.resize(narcs); } bool Done() const { return i_ >= arcs_.size(); } const Arc &Value() const { return arcs_[i_]; } void Next() { ++i_; } constexpr MapSymbolsAction InputSymbolsAction() const { return MAP_COPY_SYMBOLS; } constexpr MapSymbolsAction OutputSymbolsAction() const { return MAP_COPY_SYMBOLS; } uint64 Properties(uint64 props) const { return props & kArcSortProperties & kDeleteArcsProperties & kWeightInvariantProperties; } private: struct Compare { bool operator()(const Arc &x, const Arc &y) const { if (x.ilabel < y.ilabel) return true; if (x.ilabel > y.ilabel) return false; if (x.olabel < y.olabel) return true; if (x.olabel > y.olabel) return false; if (x.nextstate < y.nextstate) return true; if (x.nextstate > y.nextstate) return false; return false; } }; struct Equal { bool operator()(const Arc &x, const Arc &y) const { return (x.ilabel == y.ilabel && x.olabel == y.olabel && x.nextstate == y.nextstate); } }; const Fst<Arc> &fst_; Compare comp_; Equal equal_; std::vector<Arc> arcs_; ssize_t i_; // Current arc position. ArcSumMapper &operator=(const ArcSumMapper &) = delete; }; template <class Arc> class ArcUniqueMapper { public: using FromArc = Arc; using ToArc = Arc; using StateId = typename Arc::StateId; using Weight = typename Arc::Weight; explicit ArcUniqueMapper(const Fst<Arc> &fst) : fst_(fst), i_(0) {} // Allows updating FST argument; pass only if changed. ArcUniqueMapper(const ArcUniqueMapper<Arc> &mapper, const Fst<Arc> *fst = nullptr) : fst_(fst ? *fst : mapper.fst_), i_(0) {} StateId Start() const { return fst_.Start(); } Weight Final(StateId state) const { return fst_.Final(state); } void SetState(StateId state) { i_ = 0; arcs_.clear(); arcs_.reserve(fst_.NumArcs(state)); for (ArcIterator<Fst<Arc>> aiter(fst_, state); !aiter.Done(); aiter.Next()) { arcs_.push_back(aiter.Value()); } // First sorts the exiting arcs by input label, output label and destination // state and then uniques identical arcs. std::sort(arcs_.begin(), arcs_.end(), comp_); arcs_.erase(std::unique(arcs_.begin(), arcs_.end(), equal_), arcs_.end()); } bool Done() const { return i_ >= arcs_.size(); } const Arc &Value() const { return arcs_[i_]; } void Next() { ++i_; } constexpr MapSymbolsAction InputSymbolsAction() const { return MAP_COPY_SYMBOLS; } constexpr MapSymbolsAction OutputSymbolsAction() const { return MAP_COPY_SYMBOLS; } uint64 Properties(uint64 props) const { return props & kArcSortProperties & kDeleteArcsProperties; } private: struct Compare { bool operator()(const Arc &x, const Arc &y) const { if (x.ilabel < y.ilabel) return true; if (x.ilabel > y.ilabel) return false; if (x.olabel < y.olabel) return true; if (x.olabel > y.olabel) return false; if (x.nextstate < y.nextstate) return true; if (x.nextstate > y.nextstate) return false; return false; } }; struct Equal { bool operator()(const Arc &x, const Arc &y) const { return (x.ilabel == y.ilabel && x.olabel == y.olabel && x.nextstate == y.nextstate && x.weight == y.weight); } }; const Fst<Arc> &fst_; Compare comp_; Equal equal_; std::vector<Arc> arcs_; size_t i_; // Current arc position. ArcUniqueMapper &operator=(const ArcUniqueMapper &) = delete; }; // Useful aliases when using StdArc. using StdArcSumMapper = ArcSumMapper<StdArc>; using StdArcUniqueMapper = ArcUniqueMapper<StdArc>; } // namespace fst #endif // FST_STATE_MAP_H_
0
coqui_public_repos/inference-engine/third_party/openfst-1.6.7/src/extensions
coqui_public_repos/inference-engine/third_party/openfst-1.6.7/src/extensions/mpdt/mpdtexpand.cc
// See www.openfst.org for extensive documentation on this weighted // finite-state transducer library. // // Expands a (bounded-stack) MPDT as an FST. #include <cstring> #include <memory> #include <string> #include <vector> #include <fst/flags.h> #include <fst/log.h> #include <fst/extensions/mpdt/mpdtscript.h> #include <fst/extensions/mpdt/read_write_utils.h> #include <fst/util.h> DEFINE_string(mpdt_parentheses, "", "MPDT parenthesis label pairs with assignments"); DEFINE_bool(connect, true, "Trim output?"); DEFINE_bool(keep_parentheses, false, "Keep PDT parentheses in result?"); int main(int argc, char **argv) { namespace s = fst::script; using fst::script::FstClass; using fst::script::VectorFstClass; using fst::ReadLabelTriples; using fst::MPdtExpandOptions; string usage = "Expand a (bounded-stack) MPDT as an FST.\n\n Usage: "; usage += argv[0]; usage += " in.pdt [out.fst]\n"; std::set_new_handler(FailedNewHandler); SET_FLAGS(usage.c_str(), &argc, &argv, true); if (argc > 3) { ShowUsage(); return 1; } const string in_name = (argc > 1 && (strcmp(argv[1], "-") != 0)) ? argv[1] : ""; const string out_name = argc > 2 ? argv[2] : ""; std::unique_ptr<FstClass> ifst(FstClass::Read(in_name)); if (!ifst) return 1; if (FLAGS_mpdt_parentheses.empty()) { LOG(ERROR) << argv[0] << ": No MPDT parenthesis label pairs provided"; return 1; } std::vector<s::LabelPair> parens; std::vector<int64> assignments; if (!ReadLabelTriples(FLAGS_mpdt_parentheses, &parens, &assignments, false)) return 1; VectorFstClass ofst(ifst->ArcType()); const MPdtExpandOptions opts(FLAGS_connect, FLAGS_keep_parentheses); s::MPdtExpand(*ifst, parens, assignments, &ofst, opts); ofst.Write(out_name); return 0; }
0
coqui_public_repos
coqui_public_repos/coqui-py/MANIFEST.in
include VERSION include LICENSE
0
coqui_public_repos/inference-engine/third_party/kenlm
coqui_public_repos/inference-engine/third_party/kenlm/util/multi_intersection.hh
#ifndef UTIL_MULTI_INTERSECTION_H #define UTIL_MULTI_INTERSECTION_H #include <boost/optional.hpp> #include <boost/range/iterator_range.hpp> #include <algorithm> #include <functional> #include <vector> namespace util { namespace detail { template <class Range> struct RangeLessBySize : public std::binary_function<const Range &, const Range &, bool> { bool operator()(const Range &left, const Range &right) const { return left.size() < right.size(); } }; /* Takes sets specified by their iterators and a boost::optional containing * the lowest intersection if any. Each set must be sorted in increasing * order. sets is changed to truncate the beginning of each sequence to the * location of the match or an empty set. Precondition: sets is not empty * since the intersection over null is the universe and this function does not * know the universe. */ template <class Iterator, class Less> boost::optional<typename std::iterator_traits<Iterator>::value_type> FirstIntersectionSorted(std::vector<boost::iterator_range<Iterator> > &sets, const Less &less = std::less<typename std::iterator_traits<Iterator>::value_type>()) { typedef std::vector<boost::iterator_range<Iterator> > Sets; typedef typename std::iterator_traits<Iterator>::value_type Value; assert(!sets.empty()); if (sets.front().empty()) return boost::optional<Value>(); // Possibly suboptimal to copy for general Value; makes unsigned int go slightly faster. Value highest(sets.front().front()); for (typename Sets::iterator i(sets.begin()); i != sets.end(); ) { i->advance_begin(std::lower_bound(i->begin(), i->end(), highest, less) - i->begin()); if (i->empty()) return boost::optional<Value>(); if (less(highest, i->front())) { highest = i->front(); // start over i = sets.begin(); } else { ++i; } } return boost::optional<Value>(highest); } } // namespace detail template <class Iterator, class Less> boost::optional<typename std::iterator_traits<Iterator>::value_type> FirstIntersection(std::vector<boost::iterator_range<Iterator> > &sets, const Less less) { assert(!sets.empty()); std::sort(sets.begin(), sets.end(), detail::RangeLessBySize<boost::iterator_range<Iterator> >()); return detail::FirstIntersectionSorted(sets, less); } template <class Iterator> boost::optional<typename std::iterator_traits<Iterator>::value_type> FirstIntersection(std::vector<boost::iterator_range<Iterator> > &sets) { return FirstIntersection(sets, std::less<typename std::iterator_traits<Iterator>::value_type>()); } template <class Iterator, class Output, class Less> void AllIntersection(std::vector<boost::iterator_range<Iterator> > &sets, Output &out, const Less less) { typedef typename std::iterator_traits<Iterator>::value_type Value; assert(!sets.empty()); std::sort(sets.begin(), sets.end(), detail::RangeLessBySize<boost::iterator_range<Iterator> >()); boost::optional<Value> ret; for (boost::optional<Value> ret; (ret = detail::FirstIntersectionSorted(sets, less)); sets.front().advance_begin(1)) { out(*ret); } } template <class Iterator, class Output> void AllIntersection(std::vector<boost::iterator_range<Iterator> > &sets, Output &out) { AllIntersection(sets, out, std::less<typename std::iterator_traits<Iterator>::value_type>()); } } // namespace util #endif // UTIL_MULTI_INTERSECTION_H
0
coqui_public_repos/STT
coqui_public_repos/STT/taskcluster/android-arm64-cpu-dbg.yml
build: template_file: linux-opt-base.tyml dependencies: - "swig-linux-amd64" - "node-gyp-cache" - "pyenv-linux-amd64" - "tf_android-arm64-dbg" routes: - "index.project.deepspeech.deepspeech.native_client.${event.head.branchortag}.android-arm64-dbg" - "index.project.deepspeech.deepspeech.native_client.${event.head.branchortag}.${event.head.sha}.android-arm64-dbg" - "index.project.deepspeech.deepspeech.native_client.android-arm64-dbg.${event.head.sha}" tensorflow: ${system.tensorflow_dbg.android_arm64.url} scripts: setup: "taskcluster/tc-true.sh" build: "taskcluster/android-build-dbg.sh arm64-v8a" package: "taskcluster/android-package.sh arm64-v8a" nc_asset_name: "native_client.arm64.cpu.android_dbg.tar.xz" workerType: "${docker.dsBuild}" metadata: name: "DeepSpeech Android ARM64 debug" description: "Building DeepSpeech for Android ARM64, debug version"
0
coqui_public_repos/STT
coqui_public_repos/STT/taskcluster/test-nodejs_14x-armbian-arm64-opt.yml
build: template_file: test-armbian-opt-base.tyml dependencies: - "linux-arm64-cpu-opt" - "test-training_16k-linux-amd64-py36m-opt" test_model_task: "test-training_16k-linux-amd64-py36m-opt" system_setup: > ${nodejs.packages_buster.prep_14} && ${nodejs.packages_buster.apt_pinning} && apt-get -qq update && apt-get -qq -y install ${nodejs.packages_buster.apt} args: tests_cmdline: "${system.homedir.linux}/DeepSpeech/ds/taskcluster/tc-node_tflite-tests.sh 14.x 16k" metadata: name: "DeepSpeech ARMbian ARM64 Cortex-A53 CPU NodeJS 14.x tests" description: "Testing DeepSpeech for ARMbian ARM64 Cortex-A53 on NodeJS v14.x, CPU only, optimized version"
0
coqui_public_repos/TTS
coqui_public_repos/TTS/TTS/model.py
from abc import abstractmethod from typing import Dict import torch from coqpit import Coqpit from trainer import TrainerModel # pylint: skip-file class BaseTrainerModel(TrainerModel): """BaseTrainerModel model expanding TrainerModel with required functions by 🐸TTS. Every new 🐸TTS model must inherit it. """ @staticmethod @abstractmethod def init_from_config(config: Coqpit): """Init the model and all its attributes from the given config. Override this depending on your model. """ ... @abstractmethod def inference(self, input: torch.Tensor, aux_input={}) -> Dict: """Forward pass for inference. It must return a dictionary with the main model output and all the auxiliary outputs. The key ```model_outputs``` is considered to be the main output and you can add any other auxiliary outputs as you want. We don't use `*kwargs` since it is problematic with the TorchScript API. Args: input (torch.Tensor): [description] aux_input (Dict): Auxiliary inputs like speaker embeddings, durations etc. Returns: Dict: [description] """ outputs_dict = {"model_outputs": None} ... return outputs_dict @abstractmethod def load_checkpoint( self, config: Coqpit, checkpoint_path: str, eval: bool = False, strict: bool = True, cache=False ) -> None: """Load a model checkpoint gile and get ready for training or inference. Args: config (Coqpit): Model configuration. checkpoint_path (str): Path to the model checkpoint file. eval (bool, optional): If true, init model for inference else for training. Defaults to False. strict (bool, optional): Match all checkpoint keys to model's keys. Defaults to True. cache (bool, optional): If True, cache the file locally for subsequent calls. It is cached under `get_user_data_dir()/tts_cache`. Defaults to False. """ ...
0
coqui_public_repos/STT
coqui_public_repos/STT/ci_scripts/wasm-build.sh
#!/bin/bash set -xe source $(dirname "$0")/all-vars.sh source $(dirname "$0")/all-utils.sh source $(dirname "$0")/build-utils.sh source $(dirname "$0")/tf-vars.sh BAZEL_TARGETS=" //native_client:stt_wasm_bindings " BAZEL_OPT_FLAGS="--copt=-pthread --copt=-fexceptions" # Bazel caching and emsdk do not play nice together: unless path # is explicitly passed, emsdk would end up using an old version of # Python which does not support f-strings, making build fail. BAZEL_EXTRA_FLAGS="${BAZEL_EXTRA_FLAGS} ${BAZEL_WASM_EXTRA_FLAGS} --action_env=PATH" BAZEL_BUILD_FLAGS="${BAZEL_OPT_FLAGS} ${BAZEL_EXTRA_FLAGS}" SYSTEM_TARGET= do_bazel_build
0
coqui_public_repos/STT/native_client/ctcdecode/third_party/openfst-1.6.7/src/include/fst/extensions
coqui_public_repos/STT/native_client/ctcdecode/third_party/openfst-1.6.7/src/include/fst/extensions/compress/compress.h
// See www.openfst.org for extensive documentation on this weighted // finite-state transducer library. // // Compresses and decompresses unweighted FSTs. #ifndef FST_EXTENSIONS_COMPRESS_COMPRESS_H_ #define FST_EXTENSIONS_COMPRESS_COMPRESS_H_ #include <cstdio> #include <iostream> #include <queue> #include <vector> #include <fst/compat.h> #include <fst/extensions/compress/elias.h> #include <fst/extensions/compress/gzfile.h> #include <fstream> #include <fst/encode.h> #include <fst/expanded-fst.h> #include <fst/fst.h> #include <fst/mutable-fst.h> #include <fst/statesort.h> namespace fst { // Identifies stream data as a vanilla compressed FST. static const int32 kCompressMagicNumber = 1858869554; // Identifies stream data as (probably) a Gzip file accidentally read from // a vanilla stream, without gzip support. static const int32 kGzipMagicNumber = 0x8b1f; // Selects the two most significant bytes. constexpr uint32 kGzipMask = 0xffffffff >> 16; namespace internal { // Expands a Lempel Ziv code and returns the set of code words. expanded_code[i] // is the i^th Lempel Ziv codeword. template <class Var, class Edge> bool ExpandLZCode(const std::vector<std::pair<Var, Edge>> &code, std::vector<std::vector<Edge>> *expanded_code) { expanded_code->resize(code.size()); for (int i = 0; i < code.size(); ++i) { if (code[i].first > i) { LOG(ERROR) << "ExpandLZCode: Not a valid code"; return false; } if (code[i].first == 0) { (*expanded_code)[i].resize(1, code[i].second); } else { (*expanded_code)[i].resize((*expanded_code)[code[i].first - 1].size() + 1); std::copy((*expanded_code)[code[i].first - 1].begin(), (*expanded_code)[code[i].first - 1].end(), (*expanded_code)[i].begin()); (*expanded_code)[i][(*expanded_code)[code[i].first - 1].size()] = code[i].second; } } return true; } } // namespace internal // Lempel Ziv on data structure Edge, with a less than operator // EdgeLessThan and an equals operator EdgeEquals. // Edge has a value defaultedge which it never takes and // Edge is defined, it is initialized to defaultedge template <class Var, class Edge, class EdgeLessThan, class EdgeEquals> class LempelZiv { public: LempelZiv() : dict_number_(0), default_edge_() { root_.current_number = dict_number_++; root_.current_edge = default_edge_; decode_vector_.push_back(std::make_pair(0, default_edge_)); } // Encodes a vector input into output void BatchEncode(const std::vector<Edge> &input, std::vector<std::pair<Var, Edge>> *output); // Decodes codedvector to output. Returns false if // the index exceeds the size. bool BatchDecode(const std::vector<std::pair<Var, Edge>> &input, std::vector<Edge> *output); // Decodes a single dictionary element. Returns false // if the index exceeds the size. bool SingleDecode(const Var &index, Edge *output) { if (index >= decode_vector_.size()) { LOG(ERROR) << "LempelZiv::SingleDecode: " << "Index exceeded the dictionary size"; return false; } else { *output = decode_vector_[index].second; return true; } } ~LempelZiv() { for (auto it = (root_.next_number).begin(); it != (root_.next_number).end(); ++it) { CleanUp(it->second); } } // Adds a single dictionary element while decoding // void AddDictElement(const std::pair<Var, Edge> &newdict) { // EdgeEquals InstEdgeEquals; // if (InstEdgeEquals(newdict.second, default_edge_) != 1) // decode_vector_.push_back(newdict); // } private: // Node datastructure is used for encoding struct Node { Var current_number; Edge current_edge; std::map<Edge, Node *, EdgeLessThan> next_number; }; void CleanUp(Node *temp) { for (auto it = (temp->next_number).begin(); it != (temp->next_number).end(); ++it) { CleanUp(it->second); } delete temp; } Node root_; Var dict_number_; // decode_vector_ is used for decoding std::vector<std::pair<Var, Edge>> decode_vector_; Edge default_edge_; }; template <class Var, class Edge, class EdgeLessThan, class EdgeEquals> void LempelZiv<Var, Edge, EdgeLessThan, EdgeEquals>::BatchEncode( const std::vector<Edge> &input, std::vector<std::pair<Var, Edge>> *output) { for (typename std::vector<Edge>::const_iterator it = input.begin(); it != input.end(); ++it) { Node *temp_node = &root_; while (it != input.end()) { auto next = (temp_node->next_number).find(*it); if (next != (temp_node->next_number).end()) { temp_node = next->second; ++it; } else { break; } } if (it == input.end() && temp_node->current_number != 0) { output->push_back( std::make_pair(temp_node->current_number, default_edge_)); } else if (it != input.end()) { output->push_back(std::make_pair(temp_node->current_number, *it)); Node *new_node = new (Node); new_node->current_number = dict_number_++; new_node->current_edge = *it; (temp_node->next_number)[*it] = new_node; } if (it == input.end()) break; } } template <class Var, class Edge, class EdgeLessThan, class EdgeEquals> bool LempelZiv<Var, Edge, EdgeLessThan, EdgeEquals>::BatchDecode( const std::vector<std::pair<Var, Edge>> &input, std::vector<Edge> *output) { for (typename std::vector<std::pair<Var, Edge>>::const_iterator it = input.begin(); it != input.end(); ++it) { std::vector<Edge> temp_output; EdgeEquals InstEdgeEquals; if (InstEdgeEquals(it->second, default_edge_) != 1) { decode_vector_.push_back(*it); temp_output.push_back(it->second); } Var temp_integer = it->first; if (temp_integer >= decode_vector_.size()) { LOG(ERROR) << "LempelZiv::BatchDecode: " << "Index exceeded the dictionary size"; return false; } else { while (temp_integer != 0) { temp_output.push_back(decode_vector_[temp_integer].second); temp_integer = decode_vector_[temp_integer].first; } std::reverse(temp_output.begin(), temp_output.end()); output->insert(output->end(), temp_output.begin(), temp_output.end()); } } return true; } // The main Compressor class template <class Arc> class Compressor { public: typedef typename Arc::StateId StateId; typedef typename Arc::Label Label; typedef typename Arc::Weight Weight; Compressor() {} // Compresses fst into a boolean vector code. Returns true on sucesss. bool Compress(const Fst<Arc> &fst, std::ostream &strm); // Decompresses the boolean vector into Fst. Returns true on sucesss. bool Decompress(std::istream &strm, const string &source, MutableFst<Arc> *fst); // Finds the BFS order of a fst void BfsOrder(const ExpandedFst<Arc> &fst, std::vector<StateId> *order); // Preprocessing step to convert fst to a isomorphic fst // Returns a preproccess fst and a dictionary void Preprocess(const Fst<Arc> &fst, MutableFst<Arc> *preprocessedfst, EncodeMapper<Arc> *encoder); // Performs Lempel Ziv and outputs a stream of integers // and sends it to a stream void EncodeProcessedFst(const ExpandedFst<Arc> &fst, std::ostream &strm); // Decodes fst from the stream void DecodeProcessedFst(const std::vector<StateId> &input, MutableFst<Arc> *fst, bool unweighted); // Converts buffer_code_ to uint8 and writes to a stream. // Writes the boolean file to the stream void WriteToStream(std::ostream &strm); // Writes the weights to the stream void WriteWeight(const std::vector<Weight> &input, std::ostream &strm); void ReadWeight(std::istream &strm, std::vector<Weight> *output); // Same as fst::Decode without the line RmFinalEpsilon(fst) void DecodeForCompress(MutableFst<Arc> *fst, const EncodeMapper<Arc> &mapper); // Updates the buffer_code_ template <class CVar> void WriteToBuffer(CVar input) { std::vector<bool> current_code; Elias<CVar>::DeltaEncode(input, &current_code); if (!buffer_code_.empty()) { buffer_code_.insert(buffer_code_.end(), current_code.begin(), current_code.end()); } else { buffer_code_.assign(current_code.begin(), current_code.end()); } } private: struct LZLabel { LZLabel() : label(0) {} Label label; }; struct LabelLessThan { bool operator()(const LZLabel &labelone, const LZLabel &labeltwo) const { return labelone.label < labeltwo.label; } }; struct LabelEquals { bool operator()(const LZLabel &labelone, const LZLabel &labeltwo) const { return labelone.label == labeltwo.label; } }; struct Transition { Transition() : nextstate(0), label(0), weight(Weight::Zero()) {} StateId nextstate; Label label; Weight weight; }; struct TransitionLessThan { bool operator()(const Transition &transition_one, const Transition &transition_two) const { if (transition_one.nextstate == transition_two.nextstate) return transition_one.label < transition_two.label; else return transition_one.nextstate < transition_two.nextstate; } } transition_less_than; struct TransitionEquals { bool operator()(const Transition &transition_one, const Transition &transition_two) const { return transition_one.nextstate == transition_two.nextstate && transition_one.label == transition_two.label; } } transition_equals; struct OldDictCompare { bool operator()(const std::pair<StateId, Transition> &pair_one, const std::pair<StateId, Transition> &pair_two) const { if ((pair_one.second).nextstate == (pair_two.second).nextstate) return (pair_one.second).label < (pair_two.second).label; else return (pair_one.second).nextstate < (pair_two.second).nextstate; } } old_dict_compare; std::vector<bool> buffer_code_; std::vector<Weight> arc_weight_; std::vector<Weight> final_weight_; }; template <class Arc> inline void Compressor<Arc>::DecodeForCompress( MutableFst<Arc> *fst, const EncodeMapper<Arc> &mapper) { ArcMap(fst, EncodeMapper<Arc>(mapper, DECODE)); fst->SetInputSymbols(mapper.InputSymbols()); fst->SetOutputSymbols(mapper.OutputSymbols()); } // Compressor::BfsOrder template <class Arc> void Compressor<Arc>::BfsOrder(const ExpandedFst<Arc> &fst, std::vector<StateId> *order) { Arc arc; StateId bfs_visit_number = 0; std::queue<StateId> states_queue; order->assign(fst.NumStates(), kNoStateId); states_queue.push(fst.Start()); (*order)[fst.Start()] = bfs_visit_number++; while (!states_queue.empty()) { for (ArcIterator<Fst<Arc>> aiter(fst, states_queue.front()); !aiter.Done(); aiter.Next()) { arc = aiter.Value(); StateId nextstate = arc.nextstate; if ((*order)[nextstate] == kNoStateId) { (*order)[nextstate] = bfs_visit_number++; states_queue.push(nextstate); } } states_queue.pop(); } // If the FST is unconnected, then the following // code finds them while (bfs_visit_number < fst.NumStates()) { int unseen_state = 0; for (unseen_state = 0; unseen_state < fst.NumStates(); ++unseen_state) { if ((*order)[unseen_state] == kNoStateId) break; } states_queue.push(unseen_state); (*order)[unseen_state] = bfs_visit_number++; while (!states_queue.empty()) { for (ArcIterator<Fst<Arc>> aiter(fst, states_queue.front()); !aiter.Done(); aiter.Next()) { arc = aiter.Value(); StateId nextstate = arc.nextstate; if ((*order)[nextstate] == kNoStateId) { (*order)[nextstate] = bfs_visit_number++; states_queue.push(nextstate); } } states_queue.pop(); } } } template <class Arc> void Compressor<Arc>::Preprocess(const Fst<Arc> &fst, MutableFst<Arc> *preprocessedfst, EncodeMapper<Arc> *encoder) { *preprocessedfst = fst; if (!preprocessedfst->NumStates()) { return; } // Relabels the edges and develops a dictionary Encode(preprocessedfst, encoder); std::vector<StateId> order; // Finds the BFS sorting order of the fst BfsOrder(*preprocessedfst, &order); // Reorders the states according to the BFS order StateSort(preprocessedfst, order); } template <class Arc> void Compressor<Arc>::EncodeProcessedFst(const ExpandedFst<Arc> &fst, std::ostream &strm) { std::vector<StateId> output; LempelZiv<StateId, LZLabel, LabelLessThan, LabelEquals> dict_new; LempelZiv<StateId, Transition, TransitionLessThan, TransitionEquals> dict_old; std::vector<LZLabel> current_new_input; std::vector<Transition> current_old_input; std::vector<std::pair<StateId, LZLabel>> current_new_output; std::vector<std::pair<StateId, Transition>> current_old_output; std::vector<StateId> final_states; StateId number_of_states = fst.NumStates(); StateId seen_states = 0; // Adding the number of states WriteToBuffer<StateId>(number_of_states); for (StateId state = 0; state < number_of_states; ++state) { current_new_input.clear(); current_old_input.clear(); current_new_output.clear(); current_old_output.clear(); if (state > seen_states) ++seen_states; // Collecting the final states if (fst.Final(state) != Weight::Zero()) { final_states.push_back(state); final_weight_.push_back(fst.Final(state)); } // Reading the states for (ArcIterator<Fst<Arc>> aiter(fst, state); !aiter.Done(); aiter.Next()) { Arc arc = aiter.Value(); if (arc.nextstate > seen_states) { // RILEY: > or >= ? ++seen_states; LZLabel temp_label; temp_label.label = arc.ilabel; arc_weight_.push_back(arc.weight); current_new_input.push_back(temp_label); } else { Transition temp_transition; temp_transition.nextstate = arc.nextstate; temp_transition.label = arc.ilabel; temp_transition.weight = arc.weight; current_old_input.push_back(temp_transition); } } // Adding new states dict_new.BatchEncode(current_new_input, &current_new_output); WriteToBuffer<StateId>(current_new_output.size()); for (auto it = current_new_output.begin(); it != current_new_output.end(); ++it) { WriteToBuffer<StateId>(it->first); WriteToBuffer<Label>((it->second).label); } // Adding old states by sorting and using difference coding std::sort(current_old_input.begin(), current_old_input.end(), transition_less_than); for (auto it = current_old_input.begin(); it != current_old_input.end(); ++it) { arc_weight_.push_back(it->weight); } dict_old.BatchEncode(current_old_input, &current_old_output); std::vector<StateId> dict_old_temp; std::vector<Transition> transition_old_temp; for (auto it = current_old_output.begin(); it != current_old_output.end(); ++it) { dict_old_temp.push_back(it->first); transition_old_temp.push_back(it->second); } if (!transition_old_temp.empty()) { if ((transition_old_temp.back()).nextstate == 0 && (transition_old_temp.back()).label == 0) { transition_old_temp.pop_back(); } } std::sort(dict_old_temp.begin(), dict_old_temp.end()); std::sort(transition_old_temp.begin(), transition_old_temp.end(), transition_less_than); WriteToBuffer<StateId>(dict_old_temp.size()); if (dict_old_temp.size() != transition_old_temp.size()) WriteToBuffer<int>(1); else WriteToBuffer<int>(0); StateId previous; if (!dict_old_temp.empty()) { WriteToBuffer<StateId>(dict_old_temp.front()); previous = dict_old_temp.front(); } if (dict_old_temp.size() > 1) { for (auto it = dict_old_temp.begin() + 1; it != dict_old_temp.end(); ++it) { WriteToBuffer<StateId>(*it - previous); previous = *it; } } if (!transition_old_temp.empty()) { WriteToBuffer<StateId>((transition_old_temp.front()).nextstate); previous = (transition_old_temp.front()).nextstate; WriteToBuffer<Label>((transition_old_temp.front()).label); } if (transition_old_temp.size() > 1) { for (auto it = transition_old_temp.begin() + 1; it != transition_old_temp.end(); ++it) { WriteToBuffer<StateId>(it->nextstate - previous); previous = it->nextstate; WriteToBuffer<StateId>(it->label); } } } // Adding final states WriteToBuffer<StateId>(final_states.size()); if (!final_states.empty()) { for (auto it = final_states.begin(); it != final_states.end(); ++it) { WriteToBuffer<StateId>(*it); } } WriteToStream(strm); uint8 unweighted = (fst.Properties(kUnweighted, true) == kUnweighted); WriteType(strm, unweighted); if (unweighted == 0) { WriteWeight(arc_weight_, strm); WriteWeight(final_weight_, strm); } } template <class Arc> void Compressor<Arc>::DecodeProcessedFst(const std::vector<StateId> &input, MutableFst<Arc> *fst, bool unweighted) { LempelZiv<StateId, LZLabel, LabelLessThan, LabelEquals> dict_new; LempelZiv<StateId, Transition, TransitionLessThan, TransitionEquals> dict_old; std::vector<std::pair<StateId, LZLabel>> current_new_input; std::vector<std::pair<StateId, Transition>> current_old_input; std::vector<LZLabel> current_new_output; std::vector<Transition> current_old_output; std::vector<std::pair<StateId, Transition>> actual_old_dict_numbers; std::vector<Transition> actual_old_dict_transitions; auto arc_weight_it = arc_weight_.begin(); Transition default_transition; StateId seen_states = 1; // Adding states. const StateId num_states = input.front(); if (num_states > 0) { const StateId start_state = fst->AddState(); fst->SetStart(start_state); for (StateId state = 1; state < num_states; ++state) { fst->AddState(); } } typename std::vector<StateId>::const_iterator main_it = input.begin(); ++main_it; for (StateId current_state = 0; current_state < num_states; ++current_state) { if (current_state >= seen_states) ++seen_states; current_new_input.clear(); current_new_output.clear(); current_old_input.clear(); current_old_output.clear(); // New states StateId current_number_new_elements = *main_it; ++main_it; for (StateId new_integer = 0; new_integer < current_number_new_elements; ++new_integer) { std::pair<StateId, LZLabel> temp_new_dict_element; temp_new_dict_element.first = *main_it; ++main_it; LZLabel temp_label; temp_label.label = *main_it; ++main_it; temp_new_dict_element.second = temp_label; current_new_input.push_back(temp_new_dict_element); } dict_new.BatchDecode(current_new_input, &current_new_output); for (auto it = current_new_output.begin(); it != current_new_output.end(); ++it) { if (!unweighted) { fst->AddArc(current_state, Arc(it->label, it->label, *arc_weight_it, seen_states++)); ++arc_weight_it; } else { fst->AddArc(current_state, Arc(it->label, it->label, Weight::One(), seen_states++)); } } // Old states dictionary StateId current_number_old_elements = *main_it; ++main_it; StateId is_zero_removed = *main_it; ++main_it; StateId previous = 0; actual_old_dict_numbers.clear(); for (StateId new_integer = 0; new_integer < current_number_old_elements; ++new_integer) { std::pair<StateId, Transition> pair_temp_transition; if (new_integer == 0) { pair_temp_transition.first = *main_it; previous = *main_it; } else { pair_temp_transition.first = *main_it + previous; previous = pair_temp_transition.first; } ++main_it; Transition temp_test; if (!dict_old.SingleDecode(pair_temp_transition.first, &temp_test)) { FSTERROR() << "Compressor::Decode: failed"; fst->DeleteStates(); fst->SetProperties(kError, kError); return; } pair_temp_transition.second = temp_test; actual_old_dict_numbers.push_back(pair_temp_transition); } // Reordering the dictionary elements std::sort(actual_old_dict_numbers.begin(), actual_old_dict_numbers.end(), old_dict_compare); // Transitions previous = 0; actual_old_dict_transitions.clear(); for (StateId new_integer = 0; new_integer < current_number_old_elements - is_zero_removed; ++new_integer) { Transition temp_transition; if (new_integer == 0) { temp_transition.nextstate = *main_it; previous = *main_it; } else { temp_transition.nextstate = *main_it + previous; previous = temp_transition.nextstate; } ++main_it; temp_transition.label = *main_it; ++main_it; actual_old_dict_transitions.push_back(temp_transition); } if (is_zero_removed == 1) { actual_old_dict_transitions.push_back(default_transition); } auto trans_it = actual_old_dict_transitions.begin(); auto dict_it = actual_old_dict_numbers.begin(); while (trans_it != actual_old_dict_transitions.end() && dict_it != actual_old_dict_numbers.end()) { if (dict_it->first == 0) { ++dict_it; } else { std::pair<StateId, Transition> temp_pair; if (transition_equals(*trans_it, default_transition) == 1) { temp_pair.first = dict_it->first; temp_pair.second = default_transition; ++dict_it; } else if (transition_less_than(dict_it->second, *trans_it) == 1) { temp_pair.first = dict_it->first; temp_pair.second = *trans_it; ++dict_it; } else { temp_pair.first = 0; temp_pair.second = *trans_it; } ++trans_it; current_old_input.push_back(temp_pair); } } while (trans_it != actual_old_dict_transitions.end()) { std::pair<StateId, Transition> temp_pair; temp_pair.first = 0; temp_pair.second = *trans_it; ++trans_it; current_old_input.push_back(temp_pair); } // Adding old elements in the dictionary if (!dict_old.BatchDecode(current_old_input, &current_old_output)) { FSTERROR() << "Compressor::Decode: Failed"; fst->DeleteStates(); fst->SetProperties(kError, kError); return; } for (auto it = current_old_output.begin(); it != current_old_output.end(); ++it) { if (!unweighted) { fst->AddArc(current_state, Arc(it->label, it->label, *arc_weight_it, it->nextstate)); ++arc_weight_it; } else { fst->AddArc(current_state, Arc(it->label, it->label, Weight::One(), it->nextstate)); } } } // Adding the final states StateId number_of_final_states = *main_it; if (number_of_final_states > 0) { ++main_it; for (StateId temp_int = 0; temp_int < number_of_final_states; ++temp_int) { if (!unweighted) { fst->SetFinal(*main_it, final_weight_[temp_int]); } else { fst->SetFinal(*main_it, Weight(0)); } ++main_it; } } } template <class Arc> void Compressor<Arc>::ReadWeight(std::istream &strm, std::vector<Weight> *output) { int64 size; Weight weight; ReadType(strm, &size); for (int64 i = 0; i < size; ++i) { weight.Read(strm); output->push_back(weight); } } template <class Arc> bool Compressor<Arc>::Decompress(std::istream &strm, const string &source, MutableFst<Arc> *fst) { fst->DeleteStates(); int32 magic_number = 0; ReadType(strm, &magic_number); if (magic_number != kCompressMagicNumber) { LOG(ERROR) << "Decompress: Bad compressed Fst: " << source; // If the most significant two bytes of the magic number match the // gzip magic number, then we are probably reading a gzip file as an // ordinary stream. if ((magic_number & kGzipMask) == kGzipMagicNumber) { LOG(ERROR) << "Decompress: Fst appears to be compressed with Gzip, but " "gzip decompression was not requested. Try with " "the --gzip flag" "."; } return false; } std::unique_ptr<EncodeMapper<Arc>> encoder( EncodeMapper<Arc>::Read(strm, "Decoding", DECODE)); std::vector<bool> bool_code; uint8 block; uint8 msb = 128; int64 data_size; ReadType(strm, &data_size); for (int64 i = 0; i < data_size; ++i) { ReadType(strm, &block); for (int j = 0; j < 8; ++j) { uint8 temp = msb & block; if (temp == 128) bool_code.push_back(1); else bool_code.push_back(0); block = block << 1; } } std::vector<StateId> int_code; Elias<StateId>::BatchDecode(bool_code, &int_code); bool_code.clear(); uint8 unweighted; ReadType(strm, &unweighted); if (unweighted == 0) { ReadWeight(strm, &arc_weight_); ReadWeight(strm, &final_weight_); } DecodeProcessedFst(int_code, fst, unweighted); DecodeForCompress(fst, *encoder); return !fst->Properties(kError, false); } template <class Arc> void Compressor<Arc>::WriteWeight(const std::vector<Weight> &input, std::ostream &strm) { int64 size = input.size(); WriteType(strm, size); for (typename std::vector<Weight>::const_iterator it = input.begin(); it != input.end(); ++it) { it->Write(strm); } } template <class Arc> void Compressor<Arc>::WriteToStream(std::ostream &strm) { while (buffer_code_.size() % 8 != 0) buffer_code_.push_back(1); int64 data_size = buffer_code_.size() / 8; WriteType(strm, data_size); std::vector<bool>::const_iterator it; int64 i; uint8 block; for (it = buffer_code_.begin(), i = 0; it != buffer_code_.end(); ++it, ++i) { if (i % 8 == 0) { if (i > 0) WriteType(strm, block); block = 0; } else { block = block << 1; } block |= *it; } WriteType(strm, block); } template <class Arc> bool Compressor<Arc>::Compress(const Fst<Arc> &fst, std::ostream &strm) { VectorFst<Arc> processedfst; EncodeMapper<Arc> encoder(kEncodeLabels, ENCODE); Preprocess(fst, &processedfst, &encoder); WriteType(strm, kCompressMagicNumber); encoder.Write(strm, "encoder stream"); EncodeProcessedFst(processedfst, strm); return true; } // Convenience functions that call the compressor and decompressor. template <class Arc> void Compress(const Fst<Arc> &fst, std::ostream &strm) { Compressor<Arc> comp; comp.Compress(fst, strm); } // Returns true on success. template <class Arc> bool Compress(const Fst<Arc> &fst, const string &file_name, const bool gzip = false) { if (gzip) { if (file_name.empty()) { std::stringstream strm; Compress(fst, strm); OGzFile gzfile(fileno(stdout)); gzfile.write(strm); if (!gzfile) { LOG(ERROR) << "Compress: Can't write to file: stdout"; return false; } } else { std::stringstream strm; Compress(fst, strm); OGzFile gzfile(file_name); if (!gzfile) { LOG(ERROR) << "Compress: Can't open file: " << file_name; return false; } gzfile.write(strm); if (!gzfile) { LOG(ERROR) << "Compress: Can't write to file: " << file_name; return false; } } } else if (file_name.empty()) { Compress(fst, std::cout); } else { std::ofstream strm(file_name, std::ios_base::out | std::ios_base::binary); if (!strm) { LOG(ERROR) << "Compress: Can't open file: " << file_name; return false; } Compress(fst, strm); } return true; } template <class Arc> void Decompress(std::istream &strm, const string &source, MutableFst<Arc> *fst) { Compressor<Arc> comp; comp.Decompress(strm, source, fst); } // Returns true on success. template <class Arc> bool Decompress(const string &file_name, MutableFst<Arc> *fst, const bool gzip = false) { if (gzip) { if (file_name.empty()) { IGzFile gzfile(fileno(stdin)); Decompress(*gzfile.read(), "stdin", fst); if (!gzfile) { LOG(ERROR) << "Decompress: Can't read from file: stdin"; return false; } } else { IGzFile gzfile(file_name); if (!gzfile) { LOG(ERROR) << "Decompress: Can't open file: " << file_name; return false; } Decompress(*gzfile.read(), file_name, fst); if (!gzfile) { LOG(ERROR) << "Decompress: Can't read from file: " << file_name; return false; } } } else if (file_name.empty()) { Decompress(std::cin, "stdin", fst); } else { std::ifstream strm(file_name, std::ios_base::in | std::ios_base::binary); if (!strm) { LOG(ERROR) << "Decompress: Can't open file: " << file_name; return false; } Decompress(strm, file_name, fst); } return true; } } // namespace fst #endif // FST_EXTENSIONS_COMPRESS_COMPRESS_H_
0
coqui_public_repos/inference-engine/third_party/openfst-1.6.9-win/src
coqui_public_repos/inference-engine/third_party/openfst-1.6.9-win/src/script/libfstscript.vcxproj.filters
<?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <ItemGroup> <Filter Include="Source Files"> <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier> <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions> </Filter> <Filter Include="Header Files"> <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier> <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions> </Filter> </ItemGroup> </Project>
0
coqui_public_repos/inference-engine/third_party/openfst-1.6.9-win/src/include/fst
coqui_public_repos/inference-engine/third_party/openfst-1.6.9-win/src/include/fst/script/weight-class.h
// See www.openfst.org for extensive documentation on this weighted // finite-state transducer library. // // Represents a generic weight in an FST; that is, represents a specific type // of weight underneath while hiding that type from a client. #ifndef FST_SCRIPT_WEIGHT_CLASS_H_ #define FST_SCRIPT_WEIGHT_CLASS_H_ #include <memory> #include <ostream> #include <string> #include <fst/arc.h> #include <fst/generic-register.h> #include <fst/util.h> #include <fst/weight.h> namespace fst { namespace script { class WeightImplBase { public: virtual WeightImplBase *Copy() const = 0; virtual void Print(std::ostream *o) const = 0; virtual const string &Type() const = 0; virtual string ToString() const = 0; virtual bool operator==(const WeightImplBase &other) const = 0; virtual bool operator!=(const WeightImplBase &other) const = 0; virtual WeightImplBase &PlusEq(const WeightImplBase &other) = 0; virtual WeightImplBase &TimesEq(const WeightImplBase &other) = 0; virtual WeightImplBase &DivideEq(const WeightImplBase &other) = 0; virtual WeightImplBase &PowerEq(size_t n) = 0; virtual ~WeightImplBase() {} }; template <class W> class WeightClassImpl : public WeightImplBase { public: explicit WeightClassImpl(const W &weight) : weight_(weight) {} WeightClassImpl<W> *Copy() const final { return new WeightClassImpl<W>(weight_); } const string &Type() const final { return W::Type(); } void Print(std::ostream *ostrm) const final { *ostrm << weight_; } string ToString() const final { string str; WeightToStr(weight_, &str); return str; } bool operator==(const WeightImplBase &other) const final { const auto *typed_other = static_cast<const WeightClassImpl<W> *>(&other); return weight_ == typed_other->weight_; } bool operator!=(const WeightImplBase &other) const final { return !(*this == other); } WeightClassImpl<W> &PlusEq(const WeightImplBase &other) final { const auto *typed_other = static_cast<const WeightClassImpl<W> *>(&other); weight_ = Plus(weight_, typed_other->weight_); return *this; } WeightClassImpl<W> &TimesEq(const WeightImplBase &other) final { const auto *typed_other = static_cast<const WeightClassImpl<W> *>(&other); weight_ = Times(weight_, typed_other->weight_); return *this; } WeightClassImpl<W> &DivideEq(const WeightImplBase &other) final { const auto *typed_other = static_cast<const WeightClassImpl<W> *>(&other); weight_ = Divide(weight_, typed_other->weight_); return *this; } WeightClassImpl<W> &PowerEq(size_t n) final { weight_ = Power(weight_, n); return *this; } W *GetImpl() { return &weight_; } private: W weight_; }; class WeightClass { public: WeightClass() = default; template <class W> explicit WeightClass(const W &weight) : impl_(new WeightClassImpl<W>(weight)) {} template <class W> explicit WeightClass(const WeightClassImpl<W> &impl) : impl_(new WeightClassImpl<W>(impl)) {} WeightClass(const string &weight_type, const string &weight_str); WeightClass(const WeightClass &other) : impl_(other.impl_ ? other.impl_->Copy() : nullptr) {} WeightClass &operator=(const WeightClass &other) { impl_.reset(other.impl_ ? other.impl_->Copy() : nullptr); return *this; } static constexpr const char *__ZERO__ = "__ZERO__"; // NOLINT static WeightClass Zero(const string &weight_type); static constexpr const char *__ONE__ = "__ONE__"; // NOLINT static WeightClass One(const string &weight_type); static constexpr const char *__NOWEIGHT__ = "__NOWEIGHT__"; // NOLINT static WeightClass NoWeight(const string &weight_type); template <class W> const W *GetWeight() const { if (W::Type() != impl_->Type()) { return nullptr; } else { auto *typed_impl = static_cast<WeightClassImpl<W> *>(impl_.get()); return typed_impl->GetImpl(); } } string ToString() const { return (impl_) ? impl_->ToString() : "none"; } const string &Type() const { if (impl_) return impl_->Type(); static const string *const no_type = new string("none"); return *no_type; } bool WeightTypesMatch(const WeightClass &other, const string &op_name) const; friend bool operator==(const WeightClass &lhs, const WeightClass &rhs); friend WeightClass Plus(const WeightClass &lhs, const WeightClass &rhs); friend WeightClass Times(const WeightClass &lhs, const WeightClass &rhs); friend WeightClass Divide(const WeightClass &lhs, const WeightClass &rhs); friend WeightClass Power(const WeightClass &w, size_t n); private: const WeightImplBase *GetImpl() const { return impl_.get(); } WeightImplBase *GetImpl() { return impl_.get(); } std::unique_ptr<WeightImplBase> impl_; friend std::ostream &operator<<(std::ostream &o, const WeightClass &c); }; bool operator==(const WeightClass &lhs, const WeightClass &rhs); bool operator!=(const WeightClass &lhs, const WeightClass &rhs); WeightClass Plus(const WeightClass &lhs, const WeightClass &rhs); WeightClass Times(const WeightClass &lhs, const WeightClass &rhs); WeightClass Divide(const WeightClass &lhs, const WeightClass &rhs); WeightClass Power(const WeightClass &w, size_t n); std::ostream &operator<<(std::ostream &o, const WeightClass &c); // Registration for generic weight types. using StrToWeightImplBaseT = WeightImplBase *(*)(const string &str, const string &src, size_t nline); template <class W> WeightImplBase *StrToWeightImplBase(const string &str, const string &src, size_t nline) { if (str == WeightClass::__ZERO__) return new WeightClassImpl<W>(W::Zero()); else if (str == WeightClass::__ONE__) return new WeightClassImpl<W>(W::One()); else if (str == WeightClass::__NOWEIGHT__) return new WeightClassImpl<W>(W::NoWeight()); return new WeightClassImpl<W>(StrToWeight<W>(str, src, nline)); } class WeightClassRegister : public GenericRegister<string, StrToWeightImplBaseT, WeightClassRegister> { protected: string ConvertKeyToSoFilename(const string &key) const final { string legal_type(key); ConvertToLegalCSymbol(&legal_type); return legal_type + ".so"; } }; using WeightClassRegisterer = GenericRegisterer<WeightClassRegister>; // Internal version; needs to be called by wrapper in order for macro args to // expand. #define REGISTER_FST_WEIGHT__(Weight, line) \ static WeightClassRegisterer weight_registerer##_##line( \ Weight::Type(), StrToWeightImplBase<Weight>) // This layer is where __FILE__ and __LINE__ are expanded. #define REGISTER_FST_WEIGHT_EXPANDER(Weight, line) \ REGISTER_FST_WEIGHT__(Weight, line) // Macro for registering new weight types; clients call this. #define REGISTER_FST_WEIGHT(Weight) \ REGISTER_FST_WEIGHT_EXPANDER(Weight, __LINE__) } // namespace script } // namespace fst #endif // FST_SCRIPT_WEIGHT_CLASS_H_
0
coqui_public_repos/STT/native_client/ctcdecode/third_party/openfst-1.6.9-win/src/include
coqui_public_repos/STT/native_client/ctcdecode/third_party/openfst-1.6.9-win/src/include/fst/fst-decl.h
// See www.openfst.org for extensive documentation on this weighted // finite-state transducer library. // // This file contains declarations of classes in the Fst template library. #ifndef FST_FST_DECL_H_ #define FST_FST_DECL_H_ #include <sys/types.h> #include <memory> // for allocator<> #include <fst/types.h> namespace fst { // Symbol table and iterator. class SymbolTable; class SymbolTableIterator; // Weight templates and weights. template <class T> class FloatWeightTpl; template <class T> class TropicalWeightTpl; template <class T> class LogWeightTpl; template <class T> class MinMaxWeightTpl; using FloatWeight = FloatWeightTpl<float>; using TropicalWeight = TropicalWeightTpl<float>; using LogWeight = LogWeightTpl<float>; using MinMaxWeight = MinMaxWeightTpl<float>; // Arc templates and arcs. template <class Weight> struct ArcTpl; using StdArc = ArcTpl<TropicalWeight>; using LogArc = ArcTpl<LogWeight>; // Stores. template <class Element, class U> class DefaultCompactStore; template <class Arc> class DefaultCacheStore; // FST templates. template <class A, class ArcCompactor, class Unsigned = uint32_t, class CompactStore = DefaultCompactStore<typename ArcCompactor::Element, Unsigned>, class CacheStore = DefaultCacheStore<A>> class CompactFst; template <class Arc, class U = uint32_t> class ConstFst; template <class Arc, class Weight, class Matcher> class EditFst; template <class Arc> class ExpandedFst; template <class Arc> class Fst; template <class Arc> class MutableFst; template <class A, class Allocator = std::allocator<A>> class VectorState; template <class A, class State = VectorState<A>> class VectorFst; template <class Arc, class U = std::ptrdiff_t> class DefaultReplaceStateTable; // On-the-fly operations. template <class Arc, class Compare> class ArcSortFst; template <class Arc> class ClosureFst; template <class A, class Store = DefaultCacheStore<A>> class ComposeFst; template <class Arc> class ConcatFst; template <class Arc> class DeterminizeFst; template <class Arc> class DifferenceFst; template <class Arc> class IntersectFst; template <class Arc> class InvertFst; template <class AArc, class BArc, class Mapper> class ArcMapFst; template <class Arc> class ProjectFst; template <class AArc, class BArc, class Selector> class RandGenFst; template <class Arc> class RelabelFst; template <class A, class StateTable = DefaultReplaceStateTable<A>, class Store = DefaultCacheStore<A>> class ReplaceFst; template <class Arc> class RmEpsilonFst; template <class Arc> class UnionFst; // Heap. template <class T, class Compare> class Heap; // Compactors. template <class Arc> class AcceptorCompactor; template <class Arc> class StringCompactor; template <class Arc> class UnweightedAcceptorCompactor; template <class Arc> class UnweightedCompactor; template <class Arc> class WeightedStringCompactor; // Compact FSTs. template <class Arc, class U = uint32_t> using CompactStringFst = CompactFst<Arc, StringCompactor<Arc>, U>; template <class Arc, class U = uint32_t> using CompactWeightedStringFst = CompactFst<Arc, WeightedStringCompactor<Arc>, U>; template <class Arc, class U = uint32_t> using CompactAcceptorFst = CompactFst<Arc, AcceptorCompactor<Arc>, U>; template <class Arc, class U = uint32_t> using CompactUnweightedFst = CompactFst<Arc, UnweightedCompactor<Arc>, U>; template <class Arc, class U = uint32_t> using CompactUnweightedAcceptorFst = CompactFst<Arc, UnweightedAcceptorCompactor<Arc>, U>; // StdArc aliases for FSTs. using StdConstFst = ConstFst<StdArc>; using StdExpandedFst = ExpandedFst<StdArc>; using StdFst = Fst<StdArc>; using StdMutableFst = MutableFst<StdArc>; using StdVectorFst = VectorFst<StdArc>; // StdArc aliases for on-the-fly operations. template <class Compare> using StdArcSortFst = ArcSortFst<StdArc, Compare>; using StdClosureFst = ClosureFst<StdArc>; using StdComposeFst = ComposeFst<StdArc>; using StdConcatFst = ConcatFst<StdArc>; using StdDeterminizeFst = DeterminizeFst<StdArc>; using StdDifferenceFst = DifferenceFst<StdArc>; using StdIntersectFst = IntersectFst<StdArc>; using StdInvertFst = InvertFst<StdArc>; using StdProjectFst = ProjectFst<StdArc>; using StdRelabelFst = RelabelFst<StdArc>; using StdReplaceFst = ReplaceFst<StdArc>; using StdRmEpsilonFst = RmEpsilonFst<StdArc>; using StdUnionFst = UnionFst<StdArc>; // Filter states. template <class T> class IntegerFilterState; using CharFilterState = IntegerFilterState<signed char>; using ShortFilterState = IntegerFilterState<short>; // NOLINT using IntFilterState = IntegerFilterState<int>; // Matchers and filters. template <class FST> class Matcher; template <class M1, class M2 = M1> class NullComposeFilter; template <class M1, class M2 = M1> class TrivialComposeFilter; template <class M1, class M2 = M1> class SequenceComposeFilter; template <class M1, class M2 = M1> class AltSequenceComposeFilter; template <class M1, class M2 = M1> class MatchComposeFilter; } // namespace fst #endif // FST_FST_DECL_H_
0
coqui_public_repos/STT
coqui_public_repos/STT/doc/doxygen-java.conf
# Doxyfile 1.8.13 # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project. # # All text after a double hash (##) is considered a comment and is placed in # front of the TAG it is preceding. # # All text after a single hash (#) is considered a comment and will be ignored. # The format is: # TAG = value [value, ...] # For lists, items can also be appended using: # TAG += value [value, ...] # Values that contain spaces should be placed between quotes (\" \"). #--------------------------------------------------------------------------- # Project related configuration options #--------------------------------------------------------------------------- # This tag specifies the encoding used for all characters in the config file # that follow. The default is UTF-8 which is also the encoding used for all text # before the first occurrence of this tag. Doxygen uses libiconv (or the iconv # built into libc) for the transcoding. See http://www.gnu.org/software/libiconv # for the list of possible encodings. # The default value is: UTF-8. DOXYFILE_ENCODING = UTF-8 # The PROJECT_NAME tag is a single word (or a sequence of words surrounded by # double-quotes, unless you are using Doxywizard) that should identify the # project for which the documentation is generated. This name is used in the # title of most generated pages and in a few other places. # The default value is: My Project. PROJECT_NAME = "My Project" # The PROJECT_NUMBER tag can be used to enter a project or revision number. This # could be handy for archiving the generated documentation or if some version # control system is used. PROJECT_NUMBER = # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a # quick idea about the purpose of the project. Keep the description short. PROJECT_BRIEF = # With the PROJECT_LOGO tag one can specify a logo or an icon that is included # in the documentation. The maximum height of the logo should not exceed 55 # pixels and the maximum width should not exceed 200 pixels. Doxygen will copy # the logo to the output directory. PROJECT_LOGO = # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path # into which the generated documentation will be written. If a relative path is # entered, it will be relative to the location where doxygen was started. If # left blank the current directory will be used. OUTPUT_DIRECTORY = doc/ # If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub- # directories (in 2 levels) under the output directory of each output format and # will distribute the generated files over these directories. Enabling this # option can be useful when feeding doxygen a huge amount of source files, where # putting all generated files in the same directory would otherwise causes # performance problems for the file system. # The default value is: NO. CREATE_SUBDIRS = NO # If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII # characters to appear in the names of generated files. If set to NO, non-ASCII # characters will be escaped, for example _xE3_x81_x84 will be used for Unicode # U+3044. # The default value is: NO. ALLOW_UNICODE_NAMES = NO # The OUTPUT_LANGUAGE tag is used to specify the language in which all # documentation generated by doxygen is written. Doxygen will use this # information to generate all constant output in the proper language. # Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese, # Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States), # Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian, # Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages), # Korean, Korean-en (Korean with English messages), Latvian, Lithuanian, # Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian, # Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish, # Ukrainian and Vietnamese. # The default value is: English. OUTPUT_LANGUAGE = English # If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member # descriptions after the members that are listed in the file and class # documentation (similar to Javadoc). Set to NO to disable this. # The default value is: YES. BRIEF_MEMBER_DESC = YES # If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief # description of a member or function before the detailed description # # Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the # brief descriptions will be completely suppressed. # The default value is: YES. REPEAT_BRIEF = YES # This tag implements a quasi-intelligent brief description abbreviator that is # used to form the text in various listings. Each string in this list, if found # as the leading text of the brief description, will be stripped from the text # and the result, after processing the whole list, is used as the annotated # text. Otherwise, the brief description is used as-is. If left blank, the # following values are used ($name is automatically replaced with the name of # the entity):The $name class, The $name widget, The $name file, is, provides, # specifies, contains, represents, a, an and the. ABBREVIATE_BRIEF = "The $name class" \ "The $name widget" \ "The $name file" \ is \ provides \ specifies \ contains \ represents \ a \ an \ the # If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then # doxygen will generate a detailed section even if there is only a brief # description. # The default value is: NO. ALWAYS_DETAILED_SEC = NO # If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all # inherited members of a class in the documentation of that class as if those # members were ordinary class members. Constructors, destructors and assignment # operators of the base classes will not be shown. # The default value is: NO. INLINE_INHERITED_MEMB = NO # If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path # before files name in the file list and in the header files. If set to NO the # shortest path that makes the file name unique will be used # The default value is: YES. FULL_PATH_NAMES = YES # The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path. # Stripping is only done if one of the specified strings matches the left-hand # part of the path. The tag can be used to show relative paths in the file list. # If left blank the directory from which doxygen is run is used as the path to # strip. # # Note that you can specify absolute paths here, but also relative paths, which # will be relative from the directory where doxygen is started. # This tag requires that the tag FULL_PATH_NAMES is set to YES. STRIP_FROM_PATH = # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the # path mentioned in the documentation of a class, which tells the reader which # header file to include in order to use a class. If left blank only the name of # the header file containing the class definition is used. Otherwise one should # specify the list of include paths that are normally passed to the compiler # using the -I flag. STRIP_FROM_INC_PATH = # If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but # less readable) file names. This can be useful is your file systems doesn't # support long names like on DOS, Mac, or CD-ROM. # The default value is: NO. SHORT_NAMES = NO # If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the # first line (until the first dot) of a Javadoc-style comment as the brief # description. If set to NO, the Javadoc-style will behave just like regular Qt- # style comments (thus requiring an explicit @brief command for a brief # description.) # The default value is: NO. JAVADOC_AUTOBRIEF = NO # If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first # line (until the first dot) of a Qt-style comment as the brief description. If # set to NO, the Qt-style will behave just like regular Qt-style comments (thus # requiring an explicit \brief command for a brief description.) # The default value is: NO. QT_AUTOBRIEF = NO # The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a # multi-line C++ special comment block (i.e. a block of //! or /// comments) as # a brief description. This used to be the default behavior. The new default is # to treat a multi-line C++ comment block as a detailed description. Set this # tag to YES if you prefer the old behavior instead. # # Note that setting this tag to YES also means that rational rose comments are # not recognized any more. # The default value is: NO. MULTILINE_CPP_IS_BRIEF = NO # If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the # documentation from any documented member that it re-implements. # The default value is: YES. INHERIT_DOCS = YES # If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new # page for each member. If set to NO, the documentation of a member will be part # of the file/class/namespace that contains it. # The default value is: NO. SEPARATE_MEMBER_PAGES = NO # The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen # uses this value to replace tabs by spaces in code fragments. # Minimum value: 1, maximum value: 16, default value: 4. TAB_SIZE = 4 # This tag can be used to specify a number of aliases that act as commands in # the documentation. An alias has the form: # name=value # For example adding # "sideeffect=@par Side Effects:\n" # will allow you to put the command \sideeffect (or @sideeffect) in the # documentation, which will result in a user-defined paragraph with heading # "Side Effects:". You can put \n's in the value part of an alias to insert # newlines. ALIASES = # This tag can be used to specify a number of word-keyword mappings (TCL only). # A mapping has the form "name=value". For example adding "class=itcl::class" # will allow you to use the command class in the itcl::class meaning. TCL_SUBST = # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources # only. Doxygen will then generate output that is more tailored for C. For # instance, some of the names that are used will be different. The list of all # members will be omitted, etc. # The default value is: NO. OPTIMIZE_OUTPUT_FOR_C = NO # Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or # Python sources only. Doxygen will then generate output that is more tailored # for that language. For instance, namespaces will be presented as packages, # qualified scopes will look different, etc. # The default value is: NO. OPTIMIZE_OUTPUT_JAVA = YES # Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran # sources. Doxygen will then generate output that is tailored for Fortran. # The default value is: NO. OPTIMIZE_FOR_FORTRAN = NO # Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL # sources. Doxygen will then generate output that is tailored for VHDL. # The default value is: NO. OPTIMIZE_OUTPUT_VHDL = NO # Doxygen selects the parser to use depending on the extension of the files it # parses. With this tag you can assign which parser to use for a given # extension. Doxygen has a built-in mapping, but you can override or extend it # using this tag. The format is ext=language, where ext is a file extension, and # language is one of the parsers supported by doxygen: IDL, Java, Javascript, # C#, C, C++, D, PHP, Objective-C, Python, Fortran (fixed format Fortran: # FortranFixed, free formatted Fortran: FortranFree, unknown formatted Fortran: # Fortran. In the later case the parser tries to guess whether the code is fixed # or free formatted code, this is the default for Fortran type files), VHDL. For # instance to make doxygen treat .inc files as Fortran files (default is PHP), # and .f files as C (default is Fortran), use: inc=Fortran f=C. # # Note: For files without extension you can use no_extension as a placeholder. # # Note that for custom extensions you also need to set FILE_PATTERNS otherwise # the files are not read by doxygen. EXTENSION_MAPPING = # If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments # according to the Markdown format, which allows for more readable # documentation. See http://daringfireball.net/projects/markdown/ for details. # The output of markdown processing is further processed by doxygen, so you can # mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in # case of backward compatibilities issues. # The default value is: YES. MARKDOWN_SUPPORT = YES # When the TOC_INCLUDE_HEADINGS tag is set to a non-zero value, all headings up # to that level are automatically included in the table of contents, even if # they do not have an id attribute. # Note: This feature currently applies only to Markdown headings. # Minimum value: 0, maximum value: 99, default value: 0. # This tag requires that the tag MARKDOWN_SUPPORT is set to YES. TOC_INCLUDE_HEADINGS = 0 # When enabled doxygen tries to link words that correspond to documented # classes, or namespaces to their corresponding documentation. Such a link can # be prevented in individual cases by putting a % sign in front of the word or # globally by setting AUTOLINK_SUPPORT to NO. # The default value is: YES. AUTOLINK_SUPPORT = YES # If you use STL classes (i.e. std::string, std::vector, etc.) but do not want # to include (a tag file for) the STL sources as input, then you should set this # tag to YES in order to let doxygen match functions declarations and # definitions whose arguments contain STL classes (e.g. func(std::string); # versus func(std::string) {}). This also make the inheritance and collaboration # diagrams that involve STL classes more complete and accurate. # The default value is: NO. BUILTIN_STL_SUPPORT = NO # If you use Microsoft's C++/CLI language, you should set this option to YES to # enable parsing support. # The default value is: NO. CPP_CLI_SUPPORT = NO # Set the SIP_SUPPORT tag to YES if your project consists of sip (see: # http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen # will parse them like normal C++ but will assume all classes use public instead # of private inheritance when no explicit protection keyword is present. # The default value is: NO. SIP_SUPPORT = NO # For Microsoft's IDL there are propget and propput attributes to indicate # getter and setter methods for a property. Setting this option to YES will make # doxygen to replace the get and set methods by a property in the documentation. # This will only work if the methods are indeed getting or setting a simple # type. If this is not the case, or you want to show the methods anyway, you # should set this option to NO. # The default value is: YES. IDL_PROPERTY_SUPPORT = YES # If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC # tag is set to YES then doxygen will reuse the documentation of the first # member in the group (if any) for the other members of the group. By default # all members of a group must be documented explicitly. # The default value is: NO. DISTRIBUTE_GROUP_DOC = NO # If one adds a struct or class to a group and this option is enabled, then also # any nested class or struct is added to the same group. By default this option # is disabled and one has to add nested compounds explicitly via \ingroup. # The default value is: NO. GROUP_NESTED_COMPOUNDS = NO # Set the SUBGROUPING tag to YES to allow class member groups of the same type # (for instance a group of public functions) to be put as a subgroup of that # type (e.g. under the Public Functions section). Set it to NO to prevent # subgrouping. Alternatively, this can be done per class using the # \nosubgrouping command. # The default value is: YES. SUBGROUPING = YES # When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions # are shown inside the group in which they are included (e.g. using \ingroup) # instead of on a separate page (for HTML and Man pages) or section (for LaTeX # and RTF). # # Note that this feature does not work in combination with # SEPARATE_MEMBER_PAGES. # The default value is: NO. INLINE_GROUPED_CLASSES = NO # When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions # with only public data fields or simple typedef fields will be shown inline in # the documentation of the scope in which they are defined (i.e. file, # namespace, or group documentation), provided this scope is documented. If set # to NO, structs, classes, and unions are shown on a separate page (for HTML and # Man pages) or section (for LaTeX and RTF). # The default value is: NO. INLINE_SIMPLE_STRUCTS = NO # When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or # enum is documented as struct, union, or enum with the name of the typedef. So # typedef struct TypeS {} TypeT, will appear in the documentation as a struct # with name TypeT. When disabled the typedef will appear as a member of a file, # namespace, or class. And the struct will be named TypeS. This can typically be # useful for C code in case the coding convention dictates that all compound # types are typedef'ed and only the typedef is referenced, never the tag name. # The default value is: NO. TYPEDEF_HIDES_STRUCT = NO # The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This # cache is used to resolve symbols given their name and scope. Since this can be # an expensive process and often the same symbol appears multiple times in the # code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small # doxygen will become slower. If the cache is too large, memory is wasted. The # cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range # is 0..9, the default is 0, corresponding to a cache size of 2^16=65536 # symbols. At the end of a run doxygen will report the cache usage and suggest # the optimal cache size from a speed point of view. # Minimum value: 0, maximum value: 9, default value: 0. LOOKUP_CACHE_SIZE = 0 #--------------------------------------------------------------------------- # Build related configuration options #--------------------------------------------------------------------------- # If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in # documentation are documented, even if no documentation was available. Private # class members and static file members will be hidden unless the # EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES. # Note: This will also disable the warnings about undocumented members that are # normally produced when WARNINGS is set to YES. # The default value is: NO. EXTRACT_ALL = YES # If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will # be included in the documentation. # The default value is: NO. EXTRACT_PRIVATE = NO # If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal # scope will be included in the documentation. # The default value is: NO. EXTRACT_PACKAGE = NO # If the EXTRACT_STATIC tag is set to YES, all static members of a file will be # included in the documentation. # The default value is: NO. EXTRACT_STATIC = NO # If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined # locally in source files will be included in the documentation. If set to NO, # only classes defined in header files are included. Does not have any effect # for Java sources. # The default value is: YES. EXTRACT_LOCAL_CLASSES = YES # This flag is only useful for Objective-C code. If set to YES, local methods, # which are defined in the implementation section but not in the interface are # included in the documentation. If set to NO, only methods in the interface are # included. # The default value is: NO. EXTRACT_LOCAL_METHODS = NO # If this flag is set to YES, the members of anonymous namespaces will be # extracted and appear in the documentation as a namespace called # 'anonymous_namespace{file}', where file will be replaced with the base name of # the file that contains the anonymous namespace. By default anonymous namespace # are hidden. # The default value is: NO. EXTRACT_ANON_NSPACES = NO # If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all # undocumented members inside documented classes or files. If set to NO these # members will be included in the various overviews, but no documentation # section is generated. This option has no effect if EXTRACT_ALL is enabled. # The default value is: NO. HIDE_UNDOC_MEMBERS = NO # If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all # undocumented classes that are normally visible in the class hierarchy. If set # to NO, these classes will be included in the various overviews. This option # has no effect if EXTRACT_ALL is enabled. # The default value is: NO. HIDE_UNDOC_CLASSES = NO # If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend # (class|struct|union) declarations. If set to NO, these declarations will be # included in the documentation. # The default value is: NO. HIDE_FRIEND_COMPOUNDS = NO # If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any # documentation blocks found inside the body of a function. If set to NO, these # blocks will be appended to the function's detailed documentation block. # The default value is: NO. HIDE_IN_BODY_DOCS = NO # The INTERNAL_DOCS tag determines if documentation that is typed after a # \internal command is included. If the tag is set to NO then the documentation # will be excluded. Set it to YES to include the internal documentation. # The default value is: NO. INTERNAL_DOCS = NO # If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file # names in lower-case letters. If set to YES, upper-case letters are also # allowed. This is useful if you have classes or files whose names only differ # in case and if your file system supports case sensitive file names. Windows # and Mac users are advised to set this option to NO. # The default value is: system dependent. CASE_SENSE_NAMES = YES # If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with # their full class and namespace scopes in the documentation. If set to YES, the # scope will be hidden. # The default value is: NO. HIDE_SCOPE_NAMES = NO # If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will # append additional text to a page's title, such as Class Reference. If set to # YES the compound reference will be hidden. # The default value is: NO. HIDE_COMPOUND_REFERENCE= NO # If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of # the files that are included by a file in the documentation of that file. # The default value is: YES. SHOW_INCLUDE_FILES = YES # If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each # grouped member an include statement to the documentation, telling the reader # which file to include in order to use the member. # The default value is: NO. SHOW_GROUPED_MEMB_INC = NO # If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include # files with double quotes in the documentation rather than with sharp brackets. # The default value is: NO. FORCE_LOCAL_INCLUDES = NO # If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the # documentation for inline members. # The default value is: YES. INLINE_INFO = YES # If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the # (detailed) documentation of file and class members alphabetically by member # name. If set to NO, the members will appear in declaration order. # The default value is: YES. SORT_MEMBER_DOCS = YES # If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief # descriptions of file, namespace and class members alphabetically by member # name. If set to NO, the members will appear in declaration order. Note that # this will also influence the order of the classes in the class list. # The default value is: NO. SORT_BRIEF_DOCS = NO # If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the # (brief and detailed) documentation of class members so that constructors and # destructors are listed first. If set to NO the constructors will appear in the # respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS. # Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief # member documentation. # Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting # detailed member documentation. # The default value is: NO. SORT_MEMBERS_CTORS_1ST = NO # If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy # of group names into alphabetical order. If set to NO the group names will # appear in their defined order. # The default value is: NO. SORT_GROUP_NAMES = NO # If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by # fully-qualified names, including namespaces. If set to NO, the class list will # be sorted only by class name, not including the namespace part. # Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. # Note: This option applies only to the class list, not to the alphabetical # list. # The default value is: NO. SORT_BY_SCOPE_NAME = NO # If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper # type resolution of all parameters of a function it will reject a match between # the prototype and the implementation of a member function even if there is # only one candidate or it is obvious which candidate to choose by doing a # simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still # accept a match between prototype and implementation in such cases. # The default value is: NO. STRICT_PROTO_MATCHING = NO # The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo # list. This list is created by putting \todo commands in the documentation. # The default value is: YES. GENERATE_TODOLIST = NO # The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test # list. This list is created by putting \test commands in the documentation. # The default value is: YES. GENERATE_TESTLIST = NO # The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug # list. This list is created by putting \bug commands in the documentation. # The default value is: YES. GENERATE_BUGLIST = NO # The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO) # the deprecated list. This list is created by putting \deprecated commands in # the documentation. # The default value is: YES. GENERATE_DEPRECATEDLIST= YES # The ENABLED_SECTIONS tag can be used to enable conditional documentation # sections, marked by \if <section_label> ... \endif and \cond <section_label> # ... \endcond blocks. ENABLED_SECTIONS = # The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the # initial value of a variable or macro / define can have for it to appear in the # documentation. If the initializer consists of more lines than specified here # it will be hidden. Use a value of 0 to hide initializers completely. The # appearance of the value of individual variables and macros / defines can be # controlled using \showinitializer or \hideinitializer command in the # documentation regardless of this setting. # Minimum value: 0, maximum value: 10000, default value: 30. MAX_INITIALIZER_LINES = 30 # Set the SHOW_USED_FILES tag to NO to disable the list of files generated at # the bottom of the documentation of classes and structs. If set to YES, the # list will mention the files that were used to generate the documentation. # The default value is: YES. SHOW_USED_FILES = YES # Set the SHOW_FILES tag to NO to disable the generation of the Files page. This # will remove the Files entry from the Quick Index and from the Folder Tree View # (if specified). # The default value is: YES. SHOW_FILES = YES # Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces # page. This will remove the Namespaces entry from the Quick Index and from the # Folder Tree View (if specified). # The default value is: YES. SHOW_NAMESPACES = YES # The FILE_VERSION_FILTER tag can be used to specify a program or script that # doxygen should invoke to get the current version for each file (typically from # the version control system). Doxygen will invoke the program by executing (via # popen()) the command command input-file, where command is the value of the # FILE_VERSION_FILTER tag, and input-file is the name of an input file provided # by doxygen. Whatever the program writes to standard output is used as the file # version. For an example see the documentation. FILE_VERSION_FILTER = # The LAYOUT_FILE tag can be used to specify a layout file which will be parsed # by doxygen. The layout file controls the global structure of the generated # output files in an output format independent way. To create the layout file # that represents doxygen's defaults, run doxygen with the -l option. You can # optionally specify a file name after the option, if omitted DoxygenLayout.xml # will be used as the name of the layout file. # # Note that if you run doxygen from a directory containing a file called # DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE # tag is left empty. LAYOUT_FILE = # The CITE_BIB_FILES tag can be used to specify one or more bib files containing # the reference definitions. This must be a list of .bib files. The .bib # extension is automatically appended if omitted. This requires the bibtex tool # to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info. # For LaTeX the style of the bibliography can be controlled using # LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the # search path. See also \cite for info how to create references. CITE_BIB_FILES = #--------------------------------------------------------------------------- # Configuration options related to warning and progress messages #--------------------------------------------------------------------------- # The QUIET tag can be used to turn on/off the messages that are generated to # standard output by doxygen. If QUIET is set to YES this implies that the # messages are off. # The default value is: NO. QUIET = NO # The WARNINGS tag can be used to turn on/off the warning messages that are # generated to standard error (stderr) by doxygen. If WARNINGS is set to YES # this implies that the warnings are on. # # Tip: Turn warnings on while writing the documentation. # The default value is: YES. WARNINGS = YES # If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate # warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag # will automatically be disabled. # The default value is: YES. WARN_IF_UNDOCUMENTED = YES # If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for # potential errors in the documentation, such as not documenting some parameters # in a documented function, or documenting parameters that don't exist or using # markup commands wrongly. # The default value is: YES. WARN_IF_DOC_ERROR = YES # This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that # are documented, but have no documentation for their parameters or return # value. If set to NO, doxygen will only warn about wrong or incomplete # parameter documentation, but not about the absence of documentation. # The default value is: NO. WARN_NO_PARAMDOC = NO # If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when # a warning is encountered. # The default value is: NO. WARN_AS_ERROR = NO # The WARN_FORMAT tag determines the format of the warning messages that doxygen # can produce. The string should contain the $file, $line, and $text tags, which # will be replaced by the file and line number from which the warning originated # and the warning text. Optionally the format may contain $version, which will # be replaced by the version of the file (if it could be obtained via # FILE_VERSION_FILTER) # The default value is: $file:$line: $text. WARN_FORMAT = "$file:$line: $text" # The WARN_LOGFILE tag can be used to specify a file to which warning and error # messages should be written. If left blank the output is written to standard # error (stderr). WARN_LOGFILE = #--------------------------------------------------------------------------- # Configuration options related to the input files #--------------------------------------------------------------------------- # The INPUT tag is used to specify the files and/or directories that contain # documented source files. You may enter file names like myfile.cpp or # directories like /usr/src/myproject. Separate the files or directories with # spaces. See also FILE_PATTERNS and EXTENSION_MAPPING # Note: If this tag is empty the current directory is searched. INPUT = native_client/java/libstt/src/main/java/ai/coqui/libstt/ native_client/java/libstt/src/main/java/ai/coqui/libstt_doc/ # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses # libiconv (or the iconv built into libc) for the transcoding. See the libiconv # documentation (see: http://www.gnu.org/software/libiconv) for the list of # possible encodings. # The default value is: UTF-8. INPUT_ENCODING = UTF-8 # If the value of the INPUT tag contains directories, you can use the # FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and # *.h) to filter out the source-files in the directories. # # Note that for custom extensions or not directly supported extensions you also # need to set EXTENSION_MAPPING for the extension otherwise the files are not # read by doxygen. # # If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp, # *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, # *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, # *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.pyw, *.f90, *.f95, *.f03, *.f08, # *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf and *.qsf. FILE_PATTERNS = *.c \ *.cc \ *.cxx \ *.cpp \ *.c++ \ *.java \ *.ii \ *.ixx \ *.ipp \ *.i++ \ *.inl \ *.idl \ *.ddl \ *.odl \ *.h \ *.hh \ *.hxx \ *.hpp \ *.h++ \ *.cs \ *.d \ *.php \ *.php4 \ *.php5 \ *.phtml \ *.inc \ *.m \ *.markdown \ *.md \ *.mm \ *.dox \ *.py \ *.pyw \ *.f90 \ *.f95 \ *.f03 \ *.f08 \ *.f \ *.for \ *.tcl \ *.vhd \ *.vhdl \ *.ucf \ *.qsf # The RECURSIVE tag can be used to specify whether or not subdirectories should # be searched for input files as well. # The default value is: NO. RECURSIVE = NO # The EXCLUDE tag can be used to specify files and/or directories that should be # excluded from the INPUT source files. This way you can easily exclude a # subdirectory from a directory tree whose root is specified with the INPUT tag. # # Note that relative paths are relative to the directory from which doxygen is # run. EXCLUDE = # The EXCLUDE_SYMLINKS tag can be used to select whether or not files or # directories that are symbolic links (a Unix file system feature) are excluded # from the input. # The default value is: NO. EXCLUDE_SYMLINKS = NO # If the value of the INPUT tag contains directories, you can use the # EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude # certain files from those directories. # # Note that the wildcards are matched against the file with absolute path, so to # exclude all test directories for example use the pattern */test/* EXCLUDE_PATTERNS = # The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names # (namespaces, classes, functions, etc.) that should be excluded from the # output. The symbol name can be a fully qualified name, a word, or if the # wildcard * is used, a substring. Examples: ANamespace, AClass, # AClass::ANamespace, ANamespace::*Test # # Note that the wildcards are matched against the file with absolute path, so to # exclude all test directories use the pattern */test/* EXCLUDE_SYMBOLS = # The EXAMPLE_PATH tag can be used to specify one or more files or directories # that contain example code fragments that are included (see the \include # command). EXAMPLE_PATH = # If the value of the EXAMPLE_PATH tag contains directories, you can use the # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and # *.h) to filter out the source-files in the directories. If left blank all # files are included. EXAMPLE_PATTERNS = * # If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be # searched for input files to be used with the \include or \dontinclude commands # irrespective of the value of the RECURSIVE tag. # The default value is: NO. EXAMPLE_RECURSIVE = NO # The IMAGE_PATH tag can be used to specify one or more files or directories # that contain images that are to be included in the documentation (see the # \image command). IMAGE_PATH = # The INPUT_FILTER tag can be used to specify a program that doxygen should # invoke to filter for each input file. Doxygen will invoke the filter program # by executing (via popen()) the command: # # <filter> <input-file> # # where <filter> is the value of the INPUT_FILTER tag, and <input-file> is the # name of an input file. Doxygen will then use the output that the filter # program writes to standard output. If FILTER_PATTERNS is specified, this tag # will be ignored. # # Note that the filter must not add or remove lines; it is applied before the # code is scanned, but not when the output code is generated. If lines are added # or removed, the anchors will not be placed correctly. # # Note that for custom extensions or not directly supported extensions you also # need to set EXTENSION_MAPPING for the extension otherwise the files are not # properly processed by doxygen. INPUT_FILTER = # The FILTER_PATTERNS tag can be used to specify filters on a per file pattern # basis. Doxygen will compare the file name with each pattern and apply the # filter if there is a match. The filters are a list of the form: pattern=filter # (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how # filters are used. If the FILTER_PATTERNS tag is empty or if none of the # patterns match the file name, INPUT_FILTER is applied. # # Note that for custom extensions or not directly supported extensions you also # need to set EXTENSION_MAPPING for the extension otherwise the files are not # properly processed by doxygen. FILTER_PATTERNS = # If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using # INPUT_FILTER) will also be used to filter the input files that are used for # producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES). # The default value is: NO. FILTER_SOURCE_FILES = NO # The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file # pattern. A pattern will override the setting for FILTER_PATTERN (if any) and # it is also possible to disable source filtering for a specific pattern using # *.ext= (so without naming a filter). # This tag requires that the tag FILTER_SOURCE_FILES is set to YES. FILTER_SOURCE_PATTERNS = # If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that # is part of the input, its contents will be placed on the main page # (index.html). This can be useful if you have a project on for instance GitHub # and want to reuse the introduction page also for the doxygen output. USE_MDFILE_AS_MAINPAGE = #--------------------------------------------------------------------------- # Configuration options related to source browsing #--------------------------------------------------------------------------- # If the SOURCE_BROWSER tag is set to YES then a list of source files will be # generated. Documented entities will be cross-referenced with these sources. # # Note: To get rid of all source code in the generated output, make sure that # also VERBATIM_HEADERS is set to NO. # The default value is: NO. SOURCE_BROWSER = NO # Setting the INLINE_SOURCES tag to YES will include the body of functions, # classes and enums directly into the documentation. # The default value is: NO. INLINE_SOURCES = NO # Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any # special comment blocks from generated source code fragments. Normal C, C++ and # Fortran comments will always remain visible. # The default value is: YES. STRIP_CODE_COMMENTS = YES # If the REFERENCED_BY_RELATION tag is set to YES then for each documented # function all documented functions referencing it will be listed. # The default value is: NO. REFERENCED_BY_RELATION = NO # If the REFERENCES_RELATION tag is set to YES then for each documented function # all documented entities called/used by that function will be listed. # The default value is: NO. REFERENCES_RELATION = NO # If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set # to YES then the hyperlinks from functions in REFERENCES_RELATION and # REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will # link to the documentation. # The default value is: YES. REFERENCES_LINK_SOURCE = YES # If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the # source code will show a tooltip with additional information such as prototype, # brief description and links to the definition and documentation. Since this # will make the HTML file larger and loading of large files a bit slower, you # can opt to disable this feature. # The default value is: YES. # This tag requires that the tag SOURCE_BROWSER is set to YES. SOURCE_TOOLTIPS = YES # If the USE_HTAGS tag is set to YES then the references to source code will # point to the HTML generated by the htags(1) tool instead of doxygen built-in # source browser. The htags tool is part of GNU's global source tagging system # (see http://www.gnu.org/software/global/global.html). You will need version # 4.8.6 or higher. # # To use it do the following: # - Install the latest version of global # - Enable SOURCE_BROWSER and USE_HTAGS in the config file # - Make sure the INPUT points to the root of the source tree # - Run doxygen as normal # # Doxygen will invoke htags (and that will in turn invoke gtags), so these # tools must be available from the command line (i.e. in the search path). # # The result: instead of the source browser generated by doxygen, the links to # source code will now point to the output of htags. # The default value is: NO. # This tag requires that the tag SOURCE_BROWSER is set to YES. USE_HTAGS = NO # If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a # verbatim copy of the header file for each class for which an include is # specified. Set to NO to disable this. # See also: Section \class. # The default value is: YES. VERBATIM_HEADERS = YES # If the CLANG_ASSISTED_PARSING tag is set to YES then doxygen will use the # clang parser (see: http://clang.llvm.org/) for more accurate parsing at the # cost of reduced performance. This can be particularly helpful with template # rich C++ code for which doxygen's built-in parser lacks the necessary type # information. # Note: The availability of this option depends on whether or not doxygen was # generated with the -Duse-libclang=ON option for CMake. # The default value is: NO. CLANG_ASSISTED_PARSING = NO # If clang assisted parsing is enabled you can provide the compiler with command # line options that you would normally use when invoking the compiler. Note that # the include paths will already be set by doxygen for the files and directories # specified with INPUT and INCLUDE_PATH. # This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES. CLANG_OPTIONS = #--------------------------------------------------------------------------- # Configuration options related to the alphabetical class index #--------------------------------------------------------------------------- # If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all # compounds will be generated. Enable this if the project contains a lot of # classes, structs, unions or interfaces. # The default value is: YES. ALPHABETICAL_INDEX = YES # The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in # which the alphabetical index list will be split. # Minimum value: 1, maximum value: 20, default value: 5. # This tag requires that the tag ALPHABETICAL_INDEX is set to YES. COLS_IN_ALPHA_INDEX = 5 # In case all classes in a project start with a common prefix, all classes will # be put under the same header in the alphabetical index. The IGNORE_PREFIX tag # can be used to specify a prefix (or a list of prefixes) that should be ignored # while generating the index headers. # This tag requires that the tag ALPHABETICAL_INDEX is set to YES. IGNORE_PREFIX = #--------------------------------------------------------------------------- # Configuration options related to the HTML output #--------------------------------------------------------------------------- # If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output # The default value is: YES. GENERATE_HTML = NO # The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a # relative path is entered the value of OUTPUT_DIRECTORY will be put in front of # it. # The default directory is: html. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_OUTPUT = html # The HTML_FILE_EXTENSION tag can be used to specify the file extension for each # generated HTML page (for example: .htm, .php, .asp). # The default value is: .html. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_FILE_EXTENSION = .html # The HTML_HEADER tag can be used to specify a user-defined HTML header file for # each generated HTML page. If the tag is left blank doxygen will generate a # standard header. # # To get valid HTML the header file that includes any scripts and style sheets # that doxygen needs, which is dependent on the configuration options used (e.g. # the setting GENERATE_TREEVIEW). It is highly recommended to start with a # default header using # doxygen -w html new_header.html new_footer.html new_stylesheet.css # YourConfigFile # and then modify the file new_header.html. See also section "Doxygen usage" # for information on how to generate the default header that doxygen normally # uses. # Note: The header is subject to change so you typically have to regenerate the # default header when upgrading to a newer version of doxygen. For a description # of the possible markers and block names see the documentation. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_HEADER = # The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each # generated HTML page. If the tag is left blank doxygen will generate a standard # footer. See HTML_HEADER for more information on how to generate a default # footer and what special commands can be used inside the footer. See also # section "Doxygen usage" for information on how to generate the default footer # that doxygen normally uses. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_FOOTER = # The HTML_STYLESHEET tag can be used to specify a user-defined cascading style # sheet that is used by each HTML page. It can be used to fine-tune the look of # the HTML output. If left blank doxygen will generate a default style sheet. # See also section "Doxygen usage" for information on how to generate the style # sheet that doxygen normally uses. # Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as # it is more robust and this tag (HTML_STYLESHEET) will in the future become # obsolete. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_STYLESHEET = # The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined # cascading style sheets that are included after the standard style sheets # created by doxygen. Using this option one can overrule certain style aspects. # This is preferred over using HTML_STYLESHEET since it does not replace the # standard style sheet and is therefore more robust against future updates. # Doxygen will copy the style sheet files to the output directory. # Note: The order of the extra style sheet files is of importance (e.g. the last # style sheet in the list overrules the setting of the previous ones in the # list). For an example see the documentation. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_EXTRA_STYLESHEET = # The HTML_EXTRA_FILES tag can be used to specify one or more extra images or # other source files which should be copied to the HTML output directory. Note # that these files will be copied to the base HTML output directory. Use the # $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these # files. In the HTML_STYLESHEET file, use the file name only. Also note that the # files will be copied as-is; there are no commands or markers available. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_EXTRA_FILES = # The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen # will adjust the colors in the style sheet and background images according to # this color. Hue is specified as an angle on a colorwheel, see # http://en.wikipedia.org/wiki/Hue for more information. For instance the value # 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 # purple, and 360 is red again. # Minimum value: 0, maximum value: 359, default value: 220. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_COLORSTYLE_HUE = 220 # The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors # in the HTML output. For a value of 0 the output will use grayscales only. A # value of 255 will produce the most vivid colors. # Minimum value: 0, maximum value: 255, default value: 100. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_COLORSTYLE_SAT = 100 # The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the # luminance component of the colors in the HTML output. Values below 100 # gradually make the output lighter, whereas values above 100 make the output # darker. The value divided by 100 is the actual gamma applied, so 80 represents # a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not # change the gamma. # Minimum value: 40, maximum value: 240, default value: 80. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_COLORSTYLE_GAMMA = 80 # If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML # page will contain the date and time when the page was generated. Setting this # to YES can help to show when doxygen was last run and thus if the # documentation is up to date. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_TIMESTAMP = NO # If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML # documentation will contain sections that can be hidden and shown after the # page has loaded. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_DYNAMIC_SECTIONS = NO # With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries # shown in the various tree structured indices initially; the user can expand # and collapse entries dynamically later on. Doxygen will expand the tree to # such a level that at most the specified number of entries are visible (unless # a fully collapsed tree already exceeds this amount). So setting the number of # entries 1 will produce a full collapsed tree by default. 0 is a special value # representing an infinite number of entries and will result in a full expanded # tree by default. # Minimum value: 0, maximum value: 9999, default value: 100. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_INDEX_NUM_ENTRIES = 100 # If the GENERATE_DOCSET tag is set to YES, additional index files will be # generated that can be used as input for Apple's Xcode 3 integrated development # environment (see: http://developer.apple.com/tools/xcode/), introduced with # OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a # Makefile in the HTML output directory. Running make will produce the docset in # that directory and running make install will install the docset in # ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at # startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html # for more information. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. GENERATE_DOCSET = NO # This tag determines the name of the docset feed. A documentation feed provides # an umbrella under which multiple documentation sets from a single provider # (such as a company or product suite) can be grouped. # The default value is: Doxygen generated docs. # This tag requires that the tag GENERATE_DOCSET is set to YES. DOCSET_FEEDNAME = "Doxygen generated docs" # This tag specifies a string that should uniquely identify the documentation # set bundle. This should be a reverse domain-name style string, e.g. # com.mycompany.MyDocSet. Doxygen will append .docset to the name. # The default value is: org.doxygen.Project. # This tag requires that the tag GENERATE_DOCSET is set to YES. DOCSET_BUNDLE_ID = org.doxygen.Project # The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify # the documentation publisher. This should be a reverse domain-name style # string, e.g. com.mycompany.MyDocSet.documentation. # The default value is: org.doxygen.Publisher. # This tag requires that the tag GENERATE_DOCSET is set to YES. DOCSET_PUBLISHER_ID = org.doxygen.Publisher # The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher. # The default value is: Publisher. # This tag requires that the tag GENERATE_DOCSET is set to YES. DOCSET_PUBLISHER_NAME = Publisher # If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three # additional HTML index files: index.hhp, index.hhc, and index.hhk. The # index.hhp is a project file that can be read by Microsoft's HTML Help Workshop # (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on # Windows. # # The HTML Help Workshop contains a compiler that can convert all HTML output # generated by doxygen into a single compiled HTML file (.chm). Compiled HTML # files are now used as the Windows 98 help format, and will replace the old # Windows help format (.hlp) on all Windows platforms in the future. Compressed # HTML files also contain an index, a table of contents, and you can search for # words in the documentation. The HTML workshop also contains a viewer for # compressed HTML files. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. GENERATE_HTMLHELP = NO # The CHM_FILE tag can be used to specify the file name of the resulting .chm # file. You can add a path in front of the file if the result should not be # written to the html output directory. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. CHM_FILE = # The HHC_LOCATION tag can be used to specify the location (absolute path # including file name) of the HTML help compiler (hhc.exe). If non-empty, # doxygen will try to run the HTML help compiler on the generated index.hhp. # The file has to be specified with full path. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. HHC_LOCATION = # The GENERATE_CHI flag controls if a separate .chi index file is generated # (YES) or that it should be included in the master .chm file (NO). # The default value is: NO. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. GENERATE_CHI = NO # The CHM_INDEX_ENCODING is used to encode HtmlHelp index (hhk), content (hhc) # and project file content. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. CHM_INDEX_ENCODING = # The BINARY_TOC flag controls whether a binary table of contents is generated # (YES) or a normal table of contents (NO) in the .chm file. Furthermore it # enables the Previous and Next buttons. # The default value is: NO. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. BINARY_TOC = NO # The TOC_EXPAND flag can be set to YES to add extra items for group members to # the table of contents of the HTML help documentation and to the tree view. # The default value is: NO. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. TOC_EXPAND = NO # If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and # QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that # can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help # (.qch) of the generated HTML documentation. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. GENERATE_QHP = NO # If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify # the file name of the resulting .qch file. The path specified is relative to # the HTML output folder. # This tag requires that the tag GENERATE_QHP is set to YES. QCH_FILE = # The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help # Project output. For more information please see Qt Help Project / Namespace # (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace). # The default value is: org.doxygen.Project. # This tag requires that the tag GENERATE_QHP is set to YES. QHP_NAMESPACE = org.doxygen.Project # The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt # Help Project output. For more information please see Qt Help Project / Virtual # Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual- # folders). # The default value is: doc. # This tag requires that the tag GENERATE_QHP is set to YES. QHP_VIRTUAL_FOLDER = doc # If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom # filter to add. For more information please see Qt Help Project / Custom # Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- # filters). # This tag requires that the tag GENERATE_QHP is set to YES. QHP_CUST_FILTER_NAME = # The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the # custom filter to add. For more information please see Qt Help Project / Custom # Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- # filters). # This tag requires that the tag GENERATE_QHP is set to YES. QHP_CUST_FILTER_ATTRS = # The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this # project's filter section matches. Qt Help Project / Filter Attributes (see: # http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes). # This tag requires that the tag GENERATE_QHP is set to YES. QHP_SECT_FILTER_ATTRS = # The QHG_LOCATION tag can be used to specify the location of Qt's # qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the # generated .qhp file. # This tag requires that the tag GENERATE_QHP is set to YES. QHG_LOCATION = # If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be # generated, together with the HTML files, they form an Eclipse help plugin. To # install this plugin and make it available under the help contents menu in # Eclipse, the contents of the directory containing the HTML and XML files needs # to be copied into the plugins directory of eclipse. The name of the directory # within the plugins directory should be the same as the ECLIPSE_DOC_ID value. # After copying Eclipse needs to be restarted before the help appears. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. GENERATE_ECLIPSEHELP = NO # A unique identifier for the Eclipse help plugin. When installing the plugin # the directory name containing the HTML and XML files should also have this # name. Each documentation set should have its own identifier. # The default value is: org.doxygen.Project. # This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES. ECLIPSE_DOC_ID = org.doxygen.Project # If you want full control over the layout of the generated HTML pages it might # be necessary to disable the index and replace it with your own. The # DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top # of each HTML page. A value of NO enables the index and the value YES disables # it. Since the tabs in the index contain the same information as the navigation # tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. DISABLE_INDEX = NO # The GENERATE_TREEVIEW tag is used to specify whether a tree-like index # structure should be generated to display hierarchical information. If the tag # value is set to YES, a side panel will be generated containing a tree-like # index structure (just like the one that is generated for HTML Help). For this # to work a browser that supports JavaScript, DHTML, CSS and frames is required # (i.e. any modern browser). Windows users are probably better off using the # HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can # further fine-tune the look of the index. As an example, the default style # sheet generated by doxygen has an example that shows how to put an image at # the root of the tree instead of the PROJECT_NAME. Since the tree basically has # the same information as the tab index, you could consider setting # DISABLE_INDEX to YES when enabling this option. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. GENERATE_TREEVIEW = NO # The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that # doxygen will group on one line in the generated HTML documentation. # # Note that a value of 0 will completely suppress the enum values from appearing # in the overview section. # Minimum value: 0, maximum value: 20, default value: 4. # This tag requires that the tag GENERATE_HTML is set to YES. ENUM_VALUES_PER_LINE = 4 # If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used # to set the initial width (in pixels) of the frame in which the tree is shown. # Minimum value: 0, maximum value: 1500, default value: 250. # This tag requires that the tag GENERATE_HTML is set to YES. TREEVIEW_WIDTH = 250 # If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to # external symbols imported via tag files in a separate window. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. EXT_LINKS_IN_WINDOW = NO # Use this tag to change the font size of LaTeX formulas included as images in # the HTML documentation. When you change the font size after a successful # doxygen run you need to manually remove any form_*.png images from the HTML # output directory to force them to be regenerated. # Minimum value: 8, maximum value: 50, default value: 10. # This tag requires that the tag GENERATE_HTML is set to YES. FORMULA_FONTSIZE = 10 # Use the FORMULA_TRANPARENT tag to determine whether or not the images # generated for formulas are transparent PNGs. Transparent PNGs are not # supported properly for IE 6.0, but are supported on all modern browsers. # # Note that when changing this option you need to delete any form_*.png files in # the HTML output directory before the changes have effect. # The default value is: YES. # This tag requires that the tag GENERATE_HTML is set to YES. FORMULA_TRANSPARENT = YES # Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see # http://www.mathjax.org) which uses client side Javascript for the rendering # instead of using pre-rendered bitmaps. Use this if you do not have LaTeX # installed or if you want to formulas look prettier in the HTML output. When # enabled you may also need to install MathJax separately and configure the path # to it using the MATHJAX_RELPATH option. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. USE_MATHJAX = NO # When MathJax is enabled you can set the default output format to be used for # the MathJax output. See the MathJax site (see: # http://docs.mathjax.org/en/latest/output.html) for more details. # Possible values are: HTML-CSS (which is slower, but has the best # compatibility), NativeMML (i.e. MathML) and SVG. # The default value is: HTML-CSS. # This tag requires that the tag USE_MATHJAX is set to YES. MATHJAX_FORMAT = HTML-CSS # When MathJax is enabled you need to specify the location relative to the HTML # output directory using the MATHJAX_RELPATH option. The destination directory # should contain the MathJax.js script. For instance, if the mathjax directory # is located at the same level as the HTML output directory, then # MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax # Content Delivery Network so you can quickly see the result without installing # MathJax. However, it is strongly recommended to install a local copy of # MathJax from http://www.mathjax.org before deployment. # The default value is: http://cdn.mathjax.org/mathjax/latest. # This tag requires that the tag USE_MATHJAX is set to YES. MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest # The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax # extension names that should be enabled during MathJax rendering. For example # MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols # This tag requires that the tag USE_MATHJAX is set to YES. MATHJAX_EXTENSIONS = # The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces # of code that will be used on startup of the MathJax code. See the MathJax site # (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an # example see the documentation. # This tag requires that the tag USE_MATHJAX is set to YES. MATHJAX_CODEFILE = # When the SEARCHENGINE tag is enabled doxygen will generate a search box for # the HTML output. The underlying search engine uses javascript and DHTML and # should work on any modern browser. Note that when using HTML help # (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET) # there is already a search function so this one should typically be disabled. # For large projects the javascript based search engine can be slow, then # enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to # search using the keyboard; to jump to the search box use <access key> + S # (what the <access key> is depends on the OS and browser, but it is typically # <CTRL>, <ALT>/<option>, or both). Inside the search box use the <cursor down # key> to jump into the search results window, the results can be navigated # using the <cursor keys>. Press <Enter> to select an item or <escape> to cancel # the search. The filter options can be selected when the cursor is inside the # search box by pressing <Shift>+<cursor down>. Also here use the <cursor keys> # to select a filter and <Enter> or <escape> to activate or cancel the filter # option. # The default value is: YES. # This tag requires that the tag GENERATE_HTML is set to YES. SEARCHENGINE = YES # When the SERVER_BASED_SEARCH tag is enabled the search engine will be # implemented using a web server instead of a web client using Javascript. There # are two flavors of web server based searching depending on the EXTERNAL_SEARCH # setting. When disabled, doxygen will generate a PHP script for searching and # an index file used by the script. When EXTERNAL_SEARCH is enabled the indexing # and searching needs to be provided by external tools. See the section # "External Indexing and Searching" for details. # The default value is: NO. # This tag requires that the tag SEARCHENGINE is set to YES. SERVER_BASED_SEARCH = NO # When EXTERNAL_SEARCH tag is enabled doxygen will no longer generate the PHP # script for searching. Instead the search results are written to an XML file # which needs to be processed by an external indexer. Doxygen will invoke an # external search engine pointed to by the SEARCHENGINE_URL option to obtain the # search results. # # Doxygen ships with an example indexer (doxyindexer) and search engine # (doxysearch.cgi) which are based on the open source search engine library # Xapian (see: http://xapian.org/). # # See the section "External Indexing and Searching" for details. # The default value is: NO. # This tag requires that the tag SEARCHENGINE is set to YES. EXTERNAL_SEARCH = NO # The SEARCHENGINE_URL should point to a search engine hosted by a web server # which will return the search results when EXTERNAL_SEARCH is enabled. # # Doxygen ships with an example indexer (doxyindexer) and search engine # (doxysearch.cgi) which are based on the open source search engine library # Xapian (see: http://xapian.org/). See the section "External Indexing and # Searching" for details. # This tag requires that the tag SEARCHENGINE is set to YES. SEARCHENGINE_URL = # When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the unindexed # search data is written to a file for indexing by an external tool. With the # SEARCHDATA_FILE tag the name of this file can be specified. # The default file is: searchdata.xml. # This tag requires that the tag SEARCHENGINE is set to YES. SEARCHDATA_FILE = searchdata.xml # When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the # EXTERNAL_SEARCH_ID tag can be used as an identifier for the project. This is # useful in combination with EXTRA_SEARCH_MAPPINGS to search through multiple # projects and redirect the results back to the right project. # This tag requires that the tag SEARCHENGINE is set to YES. EXTERNAL_SEARCH_ID = # The EXTRA_SEARCH_MAPPINGS tag can be used to enable searching through doxygen # projects other than the one defined by this configuration file, but that are # all added to the same external search index. Each project needs to have a # unique id set via EXTERNAL_SEARCH_ID. The search mapping then maps the id of # to a relative location where the documentation can be found. The format is: # EXTRA_SEARCH_MAPPINGS = tagname1=loc1 tagname2=loc2 ... # This tag requires that the tag SEARCHENGINE is set to YES. EXTRA_SEARCH_MAPPINGS = #--------------------------------------------------------------------------- # Configuration options related to the LaTeX output #--------------------------------------------------------------------------- # If the GENERATE_LATEX tag is set to YES, doxygen will generate LaTeX output. # The default value is: YES. GENERATE_LATEX = NO # The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. If a # relative path is entered the value of OUTPUT_DIRECTORY will be put in front of # it. # The default directory is: latex. # This tag requires that the tag GENERATE_LATEX is set to YES. LATEX_OUTPUT = latex # The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be # invoked. # # Note that when enabling USE_PDFLATEX this option is only used for generating # bitmaps for formulas in the HTML output, but not in the Makefile that is # written to the output directory. # The default file is: latex. # This tag requires that the tag GENERATE_LATEX is set to YES. LATEX_CMD_NAME = latex # The MAKEINDEX_CMD_NAME tag can be used to specify the command name to generate # index for LaTeX. # The default file is: makeindex. # This tag requires that the tag GENERATE_LATEX is set to YES. MAKEINDEX_CMD_NAME = makeindex # If the COMPACT_LATEX tag is set to YES, doxygen generates more compact LaTeX # documents. This may be useful for small projects and may help to save some # trees in general. # The default value is: NO. # This tag requires that the tag GENERATE_LATEX is set to YES. COMPACT_LATEX = NO # The PAPER_TYPE tag can be used to set the paper type that is used by the # printer. # Possible values are: a4 (210 x 297 mm), letter (8.5 x 11 inches), legal (8.5 x # 14 inches) and executive (7.25 x 10.5 inches). # The default value is: a4. # This tag requires that the tag GENERATE_LATEX is set to YES. PAPER_TYPE = a4 # The EXTRA_PACKAGES tag can be used to specify one or more LaTeX package names # that should be included in the LaTeX output. The package can be specified just # by its name or with the correct syntax as to be used with the LaTeX # \usepackage command. To get the times font for instance you can specify : # EXTRA_PACKAGES=times or EXTRA_PACKAGES={times} # To use the option intlimits with the amsmath package you can specify: # EXTRA_PACKAGES=[intlimits]{amsmath} # If left blank no extra packages will be included. # This tag requires that the tag GENERATE_LATEX is set to YES. EXTRA_PACKAGES = # The LATEX_HEADER tag can be used to specify a personal LaTeX header for the # generated LaTeX document. The header should contain everything until the first # chapter. If it is left blank doxygen will generate a standard header. See # section "Doxygen usage" for information on how to let doxygen write the # default header to a separate file. # # Note: Only use a user-defined header if you know what you are doing! The # following commands have a special meaning inside the header: $title, # $datetime, $date, $doxygenversion, $projectname, $projectnumber, # $projectbrief, $projectlogo. Doxygen will replace $title with the empty # string, for the replacement values of the other commands the user is referred # to HTML_HEADER. # This tag requires that the tag GENERATE_LATEX is set to YES. LATEX_HEADER = # The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for the # generated LaTeX document. The footer should contain everything after the last # chapter. If it is left blank doxygen will generate a standard footer. See # LATEX_HEADER for more information on how to generate a default footer and what # special commands can be used inside the footer. # # Note: Only use a user-defined footer if you know what you are doing! # This tag requires that the tag GENERATE_LATEX is set to YES. LATEX_FOOTER = # The LATEX_EXTRA_STYLESHEET tag can be used to specify additional user-defined # LaTeX style sheets that are included after the standard style sheets created # by doxygen. Using this option one can overrule certain style aspects. Doxygen # will copy the style sheet files to the output directory. # Note: The order of the extra style sheet files is of importance (e.g. the last # style sheet in the list overrules the setting of the previous ones in the # list). # This tag requires that the tag GENERATE_LATEX is set to YES. LATEX_EXTRA_STYLESHEET = # The LATEX_EXTRA_FILES tag can be used to specify one or more extra images or # other source files which should be copied to the LATEX_OUTPUT output # directory. Note that the files will be copied as-is; there are no commands or # markers available. # This tag requires that the tag GENERATE_LATEX is set to YES. LATEX_EXTRA_FILES = # If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated is # prepared for conversion to PDF (using ps2pdf or pdflatex). The PDF file will # contain links (just like the HTML output) instead of page references. This # makes the output suitable for online browsing using a PDF viewer. # The default value is: YES. # This tag requires that the tag GENERATE_LATEX is set to YES. PDF_HYPERLINKS = YES # If the USE_PDFLATEX tag is set to YES, doxygen will use pdflatex to generate # the PDF file directly from the LaTeX files. Set this option to YES, to get a # higher quality PDF documentation. # The default value is: YES. # This tag requires that the tag GENERATE_LATEX is set to YES. USE_PDFLATEX = YES # If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \batchmode # command to the generated LaTeX files. This will instruct LaTeX to keep running # if errors occur, instead of asking the user for help. This option is also used # when generating formulas in HTML. # The default value is: NO. # This tag requires that the tag GENERATE_LATEX is set to YES. LATEX_BATCHMODE = NO # If the LATEX_HIDE_INDICES tag is set to YES then doxygen will not include the # index chapters (such as File Index, Compound Index, etc.) in the output. # The default value is: NO. # This tag requires that the tag GENERATE_LATEX is set to YES. LATEX_HIDE_INDICES = NO # If the LATEX_SOURCE_CODE tag is set to YES then doxygen will include source # code with syntax highlighting in the LaTeX output. # # Note that which sources are shown also depends on other settings such as # SOURCE_BROWSER. # The default value is: NO. # This tag requires that the tag GENERATE_LATEX is set to YES. LATEX_SOURCE_CODE = NO # The LATEX_BIB_STYLE tag can be used to specify the style to use for the # bibliography, e.g. plainnat, or ieeetr. See # http://en.wikipedia.org/wiki/BibTeX and \cite for more info. # The default value is: plain. # This tag requires that the tag GENERATE_LATEX is set to YES. LATEX_BIB_STYLE = plain # If the LATEX_TIMESTAMP tag is set to YES then the footer of each generated # page will contain the date and time when the page was generated. Setting this # to NO can help when comparing the output of multiple runs. # The default value is: NO. # This tag requires that the tag GENERATE_LATEX is set to YES. LATEX_TIMESTAMP = NO #--------------------------------------------------------------------------- # Configuration options related to the RTF output #--------------------------------------------------------------------------- # If the GENERATE_RTF tag is set to YES, doxygen will generate RTF output. The # RTF output is optimized for Word 97 and may not look too pretty with other RTF # readers/editors. # The default value is: NO. GENERATE_RTF = NO # The RTF_OUTPUT tag is used to specify where the RTF docs will be put. If a # relative path is entered the value of OUTPUT_DIRECTORY will be put in front of # it. # The default directory is: rtf. # This tag requires that the tag GENERATE_RTF is set to YES. RTF_OUTPUT = rtf # If the COMPACT_RTF tag is set to YES, doxygen generates more compact RTF # documents. This may be useful for small projects and may help to save some # trees in general. # The default value is: NO. # This tag requires that the tag GENERATE_RTF is set to YES. COMPACT_RTF = NO # If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated will # contain hyperlink fields. The RTF file will contain links (just like the HTML # output) instead of page references. This makes the output suitable for online # browsing using Word or some other Word compatible readers that support those # fields. # # Note: WordPad (write) and others do not support links. # The default value is: NO. # This tag requires that the tag GENERATE_RTF is set to YES. RTF_HYPERLINKS = NO # Load stylesheet definitions from file. Syntax is similar to doxygen's config # file, i.e. a series of assignments. You only have to provide replacements, # missing definitions are set to their default value. # # See also section "Doxygen usage" for information on how to generate the # default style sheet that doxygen normally uses. # This tag requires that the tag GENERATE_RTF is set to YES. RTF_STYLESHEET_FILE = # Set optional variables used in the generation of an RTF document. Syntax is # similar to doxygen's config file. A template extensions file can be generated # using doxygen -e rtf extensionFile. # This tag requires that the tag GENERATE_RTF is set to YES. RTF_EXTENSIONS_FILE = # If the RTF_SOURCE_CODE tag is set to YES then doxygen will include source code # with syntax highlighting in the RTF output. # # Note that which sources are shown also depends on other settings such as # SOURCE_BROWSER. # The default value is: NO. # This tag requires that the tag GENERATE_RTF is set to YES. RTF_SOURCE_CODE = NO #--------------------------------------------------------------------------- # Configuration options related to the man page output #--------------------------------------------------------------------------- # If the GENERATE_MAN tag is set to YES, doxygen will generate man pages for # classes and files. # The default value is: NO. GENERATE_MAN = NO # The MAN_OUTPUT tag is used to specify where the man pages will be put. If a # relative path is entered the value of OUTPUT_DIRECTORY will be put in front of # it. A directory man3 will be created inside the directory specified by # MAN_OUTPUT. # The default directory is: man. # This tag requires that the tag GENERATE_MAN is set to YES. MAN_OUTPUT = man # The MAN_EXTENSION tag determines the extension that is added to the generated # man pages. In case the manual section does not start with a number, the number # 3 is prepended. The dot (.) at the beginning of the MAN_EXTENSION tag is # optional. # The default value is: .3. # This tag requires that the tag GENERATE_MAN is set to YES. MAN_EXTENSION = .3 # The MAN_SUBDIR tag determines the name of the directory created within # MAN_OUTPUT in which the man pages are placed. If defaults to man followed by # MAN_EXTENSION with the initial . removed. # This tag requires that the tag GENERATE_MAN is set to YES. MAN_SUBDIR = # If the MAN_LINKS tag is set to YES and doxygen generates man output, then it # will generate one additional man file for each entity documented in the real # man page(s). These additional files only source the real man page, but without # them the man command would be unable to find the correct page. # The default value is: NO. # This tag requires that the tag GENERATE_MAN is set to YES. MAN_LINKS = NO #--------------------------------------------------------------------------- # Configuration options related to the XML output #--------------------------------------------------------------------------- # If the GENERATE_XML tag is set to YES, doxygen will generate an XML file that # captures the structure of the code including all documentation. # The default value is: NO. GENERATE_XML = YES # The XML_OUTPUT tag is used to specify where the XML pages will be put. If a # relative path is entered the value of OUTPUT_DIRECTORY will be put in front of # it. # The default directory is: xml. # This tag requires that the tag GENERATE_XML is set to YES. XML_OUTPUT = xml-java # If the XML_PROGRAMLISTING tag is set to YES, doxygen will dump the program # listings (including syntax highlighting and cross-referencing information) to # the XML output. Note that enabling this will significantly increase the size # of the XML output. # The default value is: YES. # This tag requires that the tag GENERATE_XML is set to YES. XML_PROGRAMLISTING = YES #--------------------------------------------------------------------------- # Configuration options related to the DOCBOOK output #--------------------------------------------------------------------------- # If the GENERATE_DOCBOOK tag is set to YES, doxygen will generate Docbook files # that can be used to generate PDF. # The default value is: NO. GENERATE_DOCBOOK = NO # The DOCBOOK_OUTPUT tag is used to specify where the Docbook pages will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be put in # front of it. # The default directory is: docbook. # This tag requires that the tag GENERATE_DOCBOOK is set to YES. DOCBOOK_OUTPUT = docbook # If the DOCBOOK_PROGRAMLISTING tag is set to YES, doxygen will include the # program listings (including syntax highlighting and cross-referencing # information) to the DOCBOOK output. Note that enabling this will significantly # increase the size of the DOCBOOK output. # The default value is: NO. # This tag requires that the tag GENERATE_DOCBOOK is set to YES. DOCBOOK_PROGRAMLISTING = NO #--------------------------------------------------------------------------- # Configuration options for the AutoGen Definitions output #--------------------------------------------------------------------------- # If the GENERATE_AUTOGEN_DEF tag is set to YES, doxygen will generate an # AutoGen Definitions (see http://autogen.sf.net) file that captures the # structure of the code including all documentation. Note that this feature is # still experimental and incomplete at the moment. # The default value is: NO. GENERATE_AUTOGEN_DEF = NO #--------------------------------------------------------------------------- # Configuration options related to the Perl module output #--------------------------------------------------------------------------- # If the GENERATE_PERLMOD tag is set to YES, doxygen will generate a Perl module # file that captures the structure of the code including all documentation. # # Note that this feature is still experimental and incomplete at the moment. # The default value is: NO. GENERATE_PERLMOD = NO # If the PERLMOD_LATEX tag is set to YES, doxygen will generate the necessary # Makefile rules, Perl scripts and LaTeX code to be able to generate PDF and DVI # output from the Perl module output. # The default value is: NO. # This tag requires that the tag GENERATE_PERLMOD is set to YES. PERLMOD_LATEX = NO # If the PERLMOD_PRETTY tag is set to YES, the Perl module output will be nicely # formatted so it can be parsed by a human reader. This is useful if you want to # understand what is going on. On the other hand, if this tag is set to NO, the # size of the Perl module output will be much smaller and Perl will parse it # just the same. # The default value is: YES. # This tag requires that the tag GENERATE_PERLMOD is set to YES. PERLMOD_PRETTY = YES # The names of the make variables in the generated doxyrules.make file are # prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. This is useful # so different doxyrules.make files included by the same Makefile don't # overwrite each other's variables. # This tag requires that the tag GENERATE_PERLMOD is set to YES. PERLMOD_MAKEVAR_PREFIX = #--------------------------------------------------------------------------- # Configuration options related to the preprocessor #--------------------------------------------------------------------------- # If the ENABLE_PREPROCESSING tag is set to YES, doxygen will evaluate all # C-preprocessor directives found in the sources and include files. # The default value is: YES. ENABLE_PREPROCESSING = YES # If the MACRO_EXPANSION tag is set to YES, doxygen will expand all macro names # in the source code. If set to NO, only conditional compilation will be # performed. Macro expansion can be done in a controlled way by setting # EXPAND_ONLY_PREDEF to YES. # The default value is: NO. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. MACRO_EXPANSION = NO # If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES then # the macro expansion is limited to the macros specified with the PREDEFINED and # EXPAND_AS_DEFINED tags. # The default value is: NO. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. EXPAND_ONLY_PREDEF = NO # If the SEARCH_INCLUDES tag is set to YES, the include files in the # INCLUDE_PATH will be searched if a #include is found. # The default value is: YES. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. SEARCH_INCLUDES = YES # The INCLUDE_PATH tag can be used to specify one or more directories that # contain include files that are not input files but should be processed by the # preprocessor. # This tag requires that the tag SEARCH_INCLUDES is set to YES. INCLUDE_PATH = # You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard # patterns (like *.h and *.hpp) to filter out the header-files in the # directories. If left blank, the patterns specified with FILE_PATTERNS will be # used. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. INCLUDE_FILE_PATTERNS = # The PREDEFINED tag can be used to specify one or more macro names that are # defined before the preprocessor is started (similar to the -D option of e.g. # gcc). The argument of the tag is a list of macros of the form: name or # name=definition (no spaces). If the definition and the "=" are omitted, "=1" # is assumed. To prevent a macro definition from being undefined via #undef or # recursively expanded use the := operator instead of the = operator. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. PREDEFINED = # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this # tag can be used to specify a list of macro names that should be expanded. The # macro definition that is found in the sources will be used. Use the PREDEFINED # tag if you want to use a different macro definition that overrules the # definition found in the source code. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. EXPAND_AS_DEFINED = # If the SKIP_FUNCTION_MACROS tag is set to YES then doxygen's preprocessor will # remove all references to function-like macros that are alone on a line, have # an all uppercase name, and do not end with a semicolon. Such function macros # are typically used for boiler-plate code, and will confuse the parser if not # removed. # The default value is: YES. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. SKIP_FUNCTION_MACROS = YES #--------------------------------------------------------------------------- # Configuration options related to external references #--------------------------------------------------------------------------- # The TAGFILES tag can be used to specify one or more tag files. For each tag # file the location of the external documentation should be added. The format of # a tag file without this location is as follows: # TAGFILES = file1 file2 ... # Adding location for the tag files is done as follows: # TAGFILES = file1=loc1 "file2 = loc2" ... # where loc1 and loc2 can be relative or absolute paths or URLs. See the # section "Linking to external documentation" for more information about the use # of tag files. # Note: Each tag file must have a unique name (where the name does NOT include # the path). If a tag file is not located in the directory in which doxygen is # run, you must also specify the path to the tagfile here. TAGFILES = # When a file name is specified after GENERATE_TAGFILE, doxygen will create a # tag file that is based on the input files it reads. See section "Linking to # external documentation" for more information about the usage of tag files. GENERATE_TAGFILE = # If the ALLEXTERNALS tag is set to YES, all external class will be listed in # the class index. If set to NO, only the inherited external classes will be # listed. # The default value is: NO. ALLEXTERNALS = NO # If the EXTERNAL_GROUPS tag is set to YES, all external groups will be listed # in the modules index. If set to NO, only the current project's groups will be # listed. # The default value is: YES. EXTERNAL_GROUPS = YES # If the EXTERNAL_PAGES tag is set to YES, all external pages will be listed in # the related pages index. If set to NO, only the current project's pages will # be listed. # The default value is: YES. EXTERNAL_PAGES = YES # The PERL_PATH should be the absolute path and name of the perl script # interpreter (i.e. the result of 'which perl'). # The default file (with absolute path) is: /usr/bin/perl. PERL_PATH = /usr/bin/perl #--------------------------------------------------------------------------- # Configuration options related to the dot tool #--------------------------------------------------------------------------- # If the CLASS_DIAGRAMS tag is set to YES, doxygen will generate a class diagram # (in HTML and LaTeX) for classes with base or super classes. Setting the tag to # NO turns the diagrams off. Note that this option also works with HAVE_DOT # disabled, but it is recommended to install and use dot, since it yields more # powerful graphs. # The default value is: YES. CLASS_DIAGRAMS = YES # You can define message sequence charts within doxygen comments using the \msc # command. Doxygen will then run the mscgen tool (see: # http://www.mcternan.me.uk/mscgen/)) to produce the chart and insert it in the # documentation. The MSCGEN_PATH tag allows you to specify the directory where # the mscgen tool resides. If left empty the tool is assumed to be found in the # default search path. MSCGEN_PATH = # You can include diagrams made with dia in doxygen documentation. Doxygen will # then run dia to produce the diagram and insert it in the documentation. The # DIA_PATH tag allows you to specify the directory where the dia binary resides. # If left empty dia is assumed to be found in the default search path. DIA_PATH = # If set to YES the inheritance and collaboration graphs will hide inheritance # and usage relations if the target is undocumented or is not a class. # The default value is: YES. HIDE_UNDOC_RELATIONS = YES # If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is # available from the path. This tool is part of Graphviz (see: # http://www.graphviz.org/), a graph visualization toolkit from AT&T and Lucent # Bell Labs. The other options in this section have no effect if this option is # set to NO # The default value is: YES. HAVE_DOT = YES # The DOT_NUM_THREADS specifies the number of dot invocations doxygen is allowed # to run in parallel. When set to 0 doxygen will base this on the number of # processors available in the system. You can set it explicitly to a value # larger than 0 to get control over the balance between CPU load and processing # speed. # Minimum value: 0, maximum value: 32, default value: 0. # This tag requires that the tag HAVE_DOT is set to YES. DOT_NUM_THREADS = 0 # When you want a differently looking font in the dot files that doxygen # generates you can specify the font name using DOT_FONTNAME. You need to make # sure dot is able to find the font, which can be done by putting it in a # standard location or by setting the DOTFONTPATH environment variable or by # setting DOT_FONTPATH to the directory containing the font. # The default value is: Helvetica. # This tag requires that the tag HAVE_DOT is set to YES. DOT_FONTNAME = Helvetica # The DOT_FONTSIZE tag can be used to set the size (in points) of the font of # dot graphs. # Minimum value: 4, maximum value: 24, default value: 10. # This tag requires that the tag HAVE_DOT is set to YES. DOT_FONTSIZE = 10 # By default doxygen will tell dot to use the default font as specified with # DOT_FONTNAME. If you specify a different font using DOT_FONTNAME you can set # the path where dot can find it using this tag. # This tag requires that the tag HAVE_DOT is set to YES. DOT_FONTPATH = # If the CLASS_GRAPH tag is set to YES then doxygen will generate a graph for # each documented class showing the direct and indirect inheritance relations. # Setting this tag to YES will force the CLASS_DIAGRAMS tag to NO. # The default value is: YES. # This tag requires that the tag HAVE_DOT is set to YES. CLASS_GRAPH = YES # If the COLLABORATION_GRAPH tag is set to YES then doxygen will generate a # graph for each documented class showing the direct and indirect implementation # dependencies (inheritance, containment, and class references variables) of the # class with other documented classes. # The default value is: YES. # This tag requires that the tag HAVE_DOT is set to YES. COLLABORATION_GRAPH = YES # If the GROUP_GRAPHS tag is set to YES then doxygen will generate a graph for # groups, showing the direct groups dependencies. # The default value is: YES. # This tag requires that the tag HAVE_DOT is set to YES. GROUP_GRAPHS = YES # If the UML_LOOK tag is set to YES, doxygen will generate inheritance and # collaboration diagrams in a style similar to the OMG's Unified Modeling # Language. # The default value is: NO. # This tag requires that the tag HAVE_DOT is set to YES. UML_LOOK = NO # If the UML_LOOK tag is enabled, the fields and methods are shown inside the # class node. If there are many fields or methods and many nodes the graph may # become too big to be useful. The UML_LIMIT_NUM_FIELDS threshold limits the # number of items for each type to make the size more manageable. Set this to 0 # for no limit. Note that the threshold may be exceeded by 50% before the limit # is enforced. So when you set the threshold to 10, up to 15 fields may appear, # but if the number exceeds 15, the total amount of fields shown is limited to # 10. # Minimum value: 0, maximum value: 100, default value: 10. # This tag requires that the tag HAVE_DOT is set to YES. UML_LIMIT_NUM_FIELDS = 10 # If the TEMPLATE_RELATIONS tag is set to YES then the inheritance and # collaboration graphs will show the relations between templates and their # instances. # The default value is: NO. # This tag requires that the tag HAVE_DOT is set to YES. TEMPLATE_RELATIONS = NO # If the INCLUDE_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are set to # YES then doxygen will generate a graph for each documented file showing the # direct and indirect include dependencies of the file with other documented # files. # The default value is: YES. # This tag requires that the tag HAVE_DOT is set to YES. INCLUDE_GRAPH = YES # If the INCLUDED_BY_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are # set to YES then doxygen will generate a graph for each documented file showing # the direct and indirect include dependencies of the file with other documented # files. # The default value is: YES. # This tag requires that the tag HAVE_DOT is set to YES. INCLUDED_BY_GRAPH = YES # If the CALL_GRAPH tag is set to YES then doxygen will generate a call # dependency graph for every global function or class method. # # Note that enabling this option will significantly increase the time of a run. # So in most cases it will be better to enable call graphs for selected # functions only using the \callgraph command. Disabling a call graph can be # accomplished by means of the command \hidecallgraph. # The default value is: NO. # This tag requires that the tag HAVE_DOT is set to YES. CALL_GRAPH = NO # If the CALLER_GRAPH tag is set to YES then doxygen will generate a caller # dependency graph for every global function or class method. # # Note that enabling this option will significantly increase the time of a run. # So in most cases it will be better to enable caller graphs for selected # functions only using the \callergraph command. Disabling a caller graph can be # accomplished by means of the command \hidecallergraph. # The default value is: NO. # This tag requires that the tag HAVE_DOT is set to YES. CALLER_GRAPH = NO # If the GRAPHICAL_HIERARCHY tag is set to YES then doxygen will graphical # hierarchy of all classes instead of a textual one. # The default value is: YES. # This tag requires that the tag HAVE_DOT is set to YES. GRAPHICAL_HIERARCHY = YES # If the DIRECTORY_GRAPH tag is set to YES then doxygen will show the # dependencies a directory has on other directories in a graphical way. The # dependency relations are determined by the #include relations between the # files in the directories. # The default value is: YES. # This tag requires that the tag HAVE_DOT is set to YES. DIRECTORY_GRAPH = YES # The DOT_IMAGE_FORMAT tag can be used to set the image format of the images # generated by dot. For an explanation of the image formats see the section # output formats in the documentation of the dot tool (Graphviz (see: # http://www.graphviz.org/)). # Note: If you choose svg you need to set HTML_FILE_EXTENSION to xhtml in order # to make the SVG files visible in IE 9+ (other browsers do not have this # requirement). # Possible values are: png, png:cairo, png:cairo:cairo, png:cairo:gd, png:gd, # png:gd:gd, jpg, jpg:cairo, jpg:cairo:gd, jpg:gd, jpg:gd:gd, gif, gif:cairo, # gif:cairo:gd, gif:gd, gif:gd:gd, svg, png:gd, png:gd:gd, png:cairo, # png:cairo:gd, png:cairo:cairo, png:cairo:gdiplus, png:gdiplus and # png:gdiplus:gdiplus. # The default value is: png. # This tag requires that the tag HAVE_DOT is set to YES. DOT_IMAGE_FORMAT = png # If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to # enable generation of interactive SVG images that allow zooming and panning. # # Note that this requires a modern browser other than Internet Explorer. Tested # and working are Firefox, Chrome, Safari, and Opera. # Note: For IE 9+ you need to set HTML_FILE_EXTENSION to xhtml in order to make # the SVG files visible. Older versions of IE do not have SVG support. # The default value is: NO. # This tag requires that the tag HAVE_DOT is set to YES. INTERACTIVE_SVG = NO # The DOT_PATH tag can be used to specify the path where the dot tool can be # found. If left blank, it is assumed the dot tool can be found in the path. # This tag requires that the tag HAVE_DOT is set to YES. DOT_PATH = # The DOTFILE_DIRS tag can be used to specify one or more directories that # contain dot files that are included in the documentation (see the \dotfile # command). # This tag requires that the tag HAVE_DOT is set to YES. DOTFILE_DIRS = # The MSCFILE_DIRS tag can be used to specify one or more directories that # contain msc files that are included in the documentation (see the \mscfile # command). MSCFILE_DIRS = # The DIAFILE_DIRS tag can be used to specify one or more directories that # contain dia files that are included in the documentation (see the \diafile # command). DIAFILE_DIRS = # When using plantuml, the PLANTUML_JAR_PATH tag should be used to specify the # path where java can find the plantuml.jar file. If left blank, it is assumed # PlantUML is not used or called during a preprocessing step. Doxygen will # generate a warning when it encounters a \startuml command in this case and # will not generate output for the diagram. PLANTUML_JAR_PATH = # When using plantuml, the PLANTUML_CFG_FILE tag can be used to specify a # configuration file for plantuml. PLANTUML_CFG_FILE = # When using plantuml, the specified paths are searched for files specified by # the !include statement in a plantuml block. PLANTUML_INCLUDE_PATH = # The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of nodes # that will be shown in the graph. If the number of nodes in a graph becomes # larger than this value, doxygen will truncate the graph, which is visualized # by representing a node as a red box. Note that doxygen if the number of direct # children of the root node in a graph is already larger than # DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note that # the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. # Minimum value: 0, maximum value: 10000, default value: 50. # This tag requires that the tag HAVE_DOT is set to YES. DOT_GRAPH_MAX_NODES = 50 # The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the graphs # generated by dot. A depth value of 3 means that only nodes reachable from the # root by following a path via at most 3 edges will be shown. Nodes that lay # further from the root node will be omitted. Note that setting this option to 1 # or 2 may greatly reduce the computation time needed for large code bases. Also # note that the size of a graph can be further restricted by # DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. # Minimum value: 0, maximum value: 1000, default value: 0. # This tag requires that the tag HAVE_DOT is set to YES. MAX_DOT_GRAPH_DEPTH = 0 # Set the DOT_TRANSPARENT tag to YES to generate images with a transparent # background. This is disabled by default, because dot on Windows does not seem # to support this out of the box. # # Warning: Depending on the platform used, enabling this option may lead to # badly anti-aliased labels on the edges of a graph (i.e. they become hard to # read). # The default value is: NO. # This tag requires that the tag HAVE_DOT is set to YES. DOT_TRANSPARENT = NO # Set the DOT_MULTI_TARGETS tag to YES to allow dot to generate multiple output # files in one run (i.e. multiple -o and -T options on the command line). This # makes dot run faster, but since only newer versions of dot (>1.8.10) support # this, this feature is disabled by default. # The default value is: NO. # This tag requires that the tag HAVE_DOT is set to YES. DOT_MULTI_TARGETS = NO # If the GENERATE_LEGEND tag is set to YES doxygen will generate a legend page # explaining the meaning of the various boxes and arrows in the dot generated # graphs. # The default value is: YES. # This tag requires that the tag HAVE_DOT is set to YES. GENERATE_LEGEND = YES # If the DOT_CLEANUP tag is set to YES, doxygen will remove the intermediate dot # files that are used to generate the various graphs. # The default value is: YES. # This tag requires that the tag HAVE_DOT is set to YES. DOT_CLEANUP = YES
0
coqui_public_repos/STT/data
coqui_public_repos/STT/data/smoke_test/LDC93S1.txt
0 46797 She had your dark suit in greasy wash water all year.
0
coqui_public_repos/STT/native_client/ctcdecode/third_party/openfst-1.6.9-win/src/include
coqui_public_repos/STT/native_client/ctcdecode/third_party/openfst-1.6.9-win/src/include/fst/arc-arena.h
#ifndef FST_ARC_ARENA_H_ #define FST_ARC_ARENA_H_ #include <deque> #include <memory> #include <utility> #include <fst/fst.h> #include <fst/memory.h> #include <unordered_map> namespace fst { // ArcArena is used for fast allocation of contiguous arrays of arcs. // // To create an arc array: // for each state: // for each arc: // arena.PushArc(); // // Commits these arcs and returns pointer to them. // Arc *arcs = arena.GetArcs(); // // OR // // arena.DropArcs(); // Throws away current arcs, reuse the space. // // The arcs returned are guaranteed to be contiguous and the pointer returned // will never be invalidated until the arena is cleared for reuse. // // The contents of the arena can be released with a call to arena.Clear() after // which the arena will restart with an initial allocation capable of holding at // least all of the arcs requested in the last usage before Clear() making // subsequent uses of the Arena more efficient. // // The max_retained_size option can limit the amount of arc space requested on // Clear() to avoid excess growth from intermittent high usage. template <typename Arc> class ArcArena { public: explicit ArcArena(size_t block_size = 256, size_t max_retained_size = 1e6) : block_size_(block_size), max_retained_size_(max_retained_size) { blocks_.emplace_back(MakeSharedBlock(block_size_)); first_block_size_ = block_size_; total_size_ = block_size_; arcs_ = blocks_.back().get(); end_ = arcs_ + block_size_; next_ = arcs_; } ArcArena(const ArcArena& copy) : arcs_(copy.arcs_), next_(copy.next_), end_(copy.end_), block_size_(copy.block_size_), first_block_size_(copy.first_block_size_), total_size_(copy.total_size_), max_retained_size_(copy.max_retained_size_), blocks_(copy.blocks_) { NewBlock(block_size_); } void ReserveArcs(size_t n) { if (next_ + n < end_) return; NewBlock(n); } void PushArc(const Arc& arc) { if (next_ == end_) { size_t length = next_ - arcs_; NewBlock(length * 2); } *next_ = arc; ++next_; } const Arc* GetArcs() { const auto *arcs = arcs_; arcs_ = next_; return arcs; } void DropArcs() { next_ = arcs_; } size_t Size() { return total_size_; } void Clear() { blocks_.resize(1); if (total_size_ > first_block_size_) { first_block_size_ = std::min(max_retained_size_, total_size_); blocks_.back() = MakeSharedBlock(first_block_size_); } total_size_ = first_block_size_; arcs_ = blocks_.back().get(); end_ = arcs_ + first_block_size_; next_ = arcs_; } private: // Allocates a new block with capacity of at least n or block_size, // copying incomplete arc sequence from old block to new block. void NewBlock(size_t n) { const auto length = next_ - arcs_; const auto new_block_size = std::max(n, block_size_); total_size_ += new_block_size; blocks_.emplace_back(MakeSharedBlock(new_block_size)); std::copy(arcs_, next_, blocks_.back().get()); arcs_ = blocks_.back().get(); next_ = arcs_ + length; end_ = arcs_ + new_block_size; } std::shared_ptr<Arc> MakeSharedBlock(size_t size) { return std::shared_ptr<Arc>(new Arc[size], std::default_delete<Arc[]>()); } Arc *arcs_; Arc *next_; const Arc *end_; size_t block_size_; size_t first_block_size_; size_t total_size_; size_t max_retained_size_; std::list<std::shared_ptr<Arc>> blocks_; }; // ArcArenaStateStore uses a resusable ArcArena to store arc arrays and does not // require that the Expander call ReserveArcs first. // // TODO(tombagby): Make cache type configurable. // TODO(tombagby): Provide ThreadLocal/Concurrent configuration. template <class A> class ArcArenaStateStore { public: using Arc = A; using Weight = typename Arc::Weight; using StateId = typename Arc::StateId; ArcArenaStateStore() : arena_(64 * 1024) { } class State { public: Weight Final() const { return final_; } size_t NumInputEpsilons() const { return niepsilons_; } size_t NumOutputEpsilons() const { return noepsilons_; } size_t NumArcs() const { return narcs_; } const Arc &GetArc(size_t n) const { return arcs_[n]; } const Arc *Arcs() const { return arcs_; } int* MutableRefCount() const { return nullptr; } private: State(Weight weight, int32_t niepsilons, int32_t noepsilons, int32_t narcs, const Arc *arcs) : final_(std::move(weight)), niepsilons_(niepsilons), noepsilons_(noepsilons), narcs_(narcs), arcs_(arcs) {} Weight final_; size_t niepsilons_; size_t noepsilons_; size_t narcs_; const Arc *arcs_; friend class ArcArenaStateStore<Arc>; }; template <class Expander> State *FindOrExpand(Expander &expander, StateId state_id) { // NOLINT auto it = cache_.insert(std::pair<StateId, State*>(state_id, nullptr)); if (!it.second) return it.first->second; // Needs a new state. StateBuilder builder(&arena_); expander.Expand(state_id, &builder); const auto arcs = arena_.GetArcs(); size_t narcs = builder.narcs_; size_t niepsilons = 0; size_t noepsilons = 0; for (size_t i = 0; i < narcs; ++i) { if (arcs[i].ilabel == 0) ++niepsilons; if (arcs[i].olabel == 0) ++noepsilons; } states_.emplace_back( State(builder.final_, niepsilons, noepsilons, narcs, arcs)); // Places it in the cache. auto state = &states_.back(); it.first->second = state; return state; } State *Find(StateId state_id) const { auto it = cache_.find(state_id); return (it == cache_.end()) ? nullptr : it->second; } private: class StateBuilder { public: explicit StateBuilder(ArcArena<Arc>* arena) : arena_(arena), final_(Weight::Zero()), narcs_(0) {} void SetFinal(Weight weight) { final_ = std::move(weight); } void ReserveArcs(size_t n) { arena_->ReserveArcs(n); } void AddArc(const Arc &arc) { ++narcs_; arena_->PushArc(arc); } private: friend class ArcArenaStateStore<Arc>; ArcArena<Arc> *arena_; Weight final_; size_t narcs_; }; std::unordered_map<StateId, State *> cache_; std::deque<State> states_; ArcArena<Arc> arena_; }; } // namespace fst #endif // FST_ARC_ARENA_H_
0
coqui_public_repos/inference-engine/third_party/openfst-1.6.9-win/src/include/fst
coqui_public_repos/inference-engine/third_party/openfst-1.6.9-win/src/include/fst/script/map.h
// See www.openfst.org for extensive documentation on this weighted // finite-state transducer library. #ifndef FST_SCRIPT_MAP_H_ #define FST_SCRIPT_MAP_H_ #include <memory> #include <tuple> #include <fst/arc-map.h> #include <fst/state-map.h> #include <fst/script/arg-packs.h> #include <fst/script/fst-class.h> #include <fst/script/weight-class.h> namespace fst { namespace script { template <class M> Fst<typename M::ToArc> *ArcMap(const Fst<typename M::FromArc> &fst, const M &mapper) { using ToArc = typename M::ToArc; auto *ofst = new VectorFst<ToArc>; ArcMap(fst, ofst, mapper); return ofst; } template <class M> Fst<typename M::ToArc> *StateMap(const Fst<typename M::FromArc> &fst, const M &mapper) { using ToArc = typename M::ToArc; auto *ofst = new VectorFst<ToArc>; StateMap(fst, ofst, mapper); return ofst; } enum MapType { ARC_SUM_MAPPER, ARC_UNIQUE_MAPPER, IDENTITY_MAPPER, INPUT_EPSILON_MAPPER, INVERT_MAPPER, OUTPUT_EPSILON_MAPPER, PLUS_MAPPER, POWER_MAPPER, QUANTIZE_MAPPER, RMWEIGHT_MAPPER, SUPERFINAL_MAPPER, TIMES_MAPPER, TO_LOG_MAPPER, TO_LOG64_MAPPER, TO_STD_MAPPER }; using MapInnerArgs = std::tuple<const FstClass &, MapType, float, double, const WeightClass &>; using MapArgs = WithReturnValue<FstClass *, MapInnerArgs>; template <class Arc> void Map(MapArgs *args) { using Weight = typename Arc::Weight; const Fst<Arc> &ifst = *(std::get<0>(args->args).GetFst<Arc>()); const auto map_type = std::get<1>(args->args); switch (map_type) { case ARC_SUM_MAPPER: { std::unique_ptr<Fst<Arc>> ofst(StateMap(ifst, ArcSumMapper<Arc>(ifst))); args->retval = new FstClass(*ofst); return; } case ARC_UNIQUE_MAPPER: { std::unique_ptr<Fst<Arc>> ofst( StateMap(ifst, ArcUniqueMapper<Arc>(ifst))); args->retval = new FstClass(*ofst); return; } case IDENTITY_MAPPER: { std::unique_ptr<Fst<Arc>> ofst(ArcMap(ifst, IdentityArcMapper<Arc>())); args->retval = new FstClass(*ofst); return; } case INPUT_EPSILON_MAPPER: { std::unique_ptr<Fst<Arc>> ofst(ArcMap(ifst, InputEpsilonMapper<Arc>())); args->retval = new FstClass(*ofst); return; } case INVERT_MAPPER: { std::unique_ptr<Fst<Arc>> ofst(ArcMap(ifst, InvertWeightMapper<Arc>())); args->retval = new FstClass(*ofst); return; } case OUTPUT_EPSILON_MAPPER: { std::unique_ptr<Fst<Arc>> ofst(ArcMap(ifst, OutputEpsilonMapper<Arc>())); args->retval = new FstClass(*ofst); return; } case PLUS_MAPPER: { const auto weight = *(std::get<4>(args->args).GetWeight<Weight>()); std::unique_ptr<Fst<Arc>> ofst(ArcMap(ifst, PlusMapper<Arc>(weight))); args->retval = new FstClass(*ofst); return; } case POWER_MAPPER: { const auto power = std::get<3>(args->args); std::unique_ptr<Fst<Arc>> ofst(ArcMap(ifst, PowerMapper<Arc>(power))); args->retval = new FstClass(*ofst); return; } case QUANTIZE_MAPPER: { const auto delta = std::get<2>(args->args); std::unique_ptr<Fst<Arc>> ofst(ArcMap(ifst, QuantizeMapper<Arc>(delta))); args->retval = new FstClass(*ofst); return; } case RMWEIGHT_MAPPER: { std::unique_ptr<Fst<Arc>> ofst(ArcMap(ifst, RmWeightMapper<Arc>())); args->retval = new FstClass(*ofst); return; } case SUPERFINAL_MAPPER: { std::unique_ptr<Fst<Arc>> ofst(ArcMap(ifst, SuperFinalMapper<Arc>())); args->retval = new FstClass(*ofst); return; } case TIMES_MAPPER: { const auto weight = *(std::get<4>(args->args).GetWeight<Weight>()); std::unique_ptr<Fst<Arc>> ofst(ArcMap(ifst, TimesMapper<Arc>(weight))); args->retval = new FstClass(*ofst); return; } case TO_LOG_MAPPER: { std::unique_ptr<Fst<LogArc>> ofst( ArcMap(ifst, WeightConvertMapper<Arc, LogArc>())); args->retval = new FstClass(*ofst); return; } case TO_LOG64_MAPPER: { std::unique_ptr<Fst<Log64Arc>> ofst( ArcMap(ifst, WeightConvertMapper<Arc, Log64Arc>())); args->retval = new FstClass(*ofst); return; } case TO_STD_MAPPER: { std::unique_ptr<Fst<StdArc>> ofst( ArcMap(ifst, WeightConvertMapper<Arc, StdArc>())); args->retval = new FstClass(*ofst); return; } } } FstClass *Map(const FstClass &ifst, MapType map_type, float delta, double power, const WeightClass &weight); } // namespace script } // namespace fst #endif // FST_SCRIPT_MAP_H_
0
coqui_public_repos/STT-models/komi/itml
coqui_public_repos/STT-models/komi/itml/v0.0.1/MODEL_CARD.md
# Model card for Komi-Zyrian STT Jump to section: - [Model details](#model-details) - [Intended use](#intended-use) - [Performance Factors](#performance-factors) - [Metrics](#metrics) - [Training data](#training-data) - [Evaluation data](#evaluation-data) - [Ethical considerations](#ethical-considerations) - [Caveats and recommendations](#caveats-and-recommendations) ## Model details - Person or organization developing model: Originally trained by [Nils Hjortnæs](https://github.com/hjortnaes) and the [Inclusive Technology for Marginalised Languages](https://itml.cl.indiana.edu/) group. - Model date: March 31, 2021 - Model type: `Speech-to-Text` - Model version: `v0.0.1` - Compatible with 🐸 STT version: `v0.9.3` - License: AGPL - Citation details: `@inproceedings{hjortnaes-etal-2020-towards, title = "Towards a Speech Recognizer for {K}omi, an Endangered and Low-Resource Uralic Language", author = "Hjortnaes, Nils and Partanen, Niko and Rie{\ss}ler, Michael and M. Tyers, Francis", booktitle = "Proceedings of the Sixth International Workshop on Computational Linguistics of Uralic Languages", month = "1", year = "2020", address = "Wien, Austria", publisher = "Association for Computational Linguistics", url = "https://www.aclweb.org/anthology/2020.iwclul-1.5", pages = "31--37" }` - Where to send questions or comments about the model: You can leave an issue on [`STT-model` issues](https://github.com/coqui-ai/STT-models/issues), open a new discussion on [`STT-model` discussions](https://github.com/coqui-ai/STT-models/discussions), or chat with us on [Gitter](https://gitter.im/coqui-ai/). ## Intended use Speech-to-Text for the [Komi-Zyryan Language](https://en.wikipedia.org/wiki/Komi_language) on 16kHz, mono-channel audio. ## Performance Factors Factors relevant to Speech-to-Text performance include but are not limited to speaker demographics, recording quality, and background noise. Read more about STT performance factors [here](https://stt.readthedocs.io/en/latest/DEPLOYMENT.html#how-will-a-model-perform-on-my-data). ## Metrics STT models are usually evaluated in terms of their transcription accuracy, deployment Real-Time Factor, and model size on disk. #### Transcription Accuracy The following Word Error Rates and Character Error Rates are reported in the [paper](https://www.aclweb.org/anthology/2020.iwclul-1.5.pdf). |Test Corpus|WER|CER| |-----------|---|---| |Common Voice|70.9\%|100\%| #### Real-Time Factor Real-Time Factor (RTF) is defined as `processing-time / length-of-audio`. The exact real-time factor of an STT model will depend on the hardware setup, so you may experience a different RTF. Recorded average RTF on laptop CPU: `.95` #### Model Size `model.pbmm`: 181M `model.tflite`: 46M ### Approaches to uncertainty and variability Confidence scores and multiple paths from the decoding beam can be used to measure model uncertainty and provide multiple, variable transcripts for any processed audio. ## Training data This model was trained on the following corpora: BasFormtask, BasSprecherinnen, Common Voice, CssTen, Gothic, LinguaLibre, Kurzgesagt, Mailabs, MussteWissen, PulsReportage, SWC, Tatoeba, TerraX, Tuda, Voxforge, YKollektiv, ZamiaSpeech, and Common Voice Single Words. Read more about training [here](https://gitlab.com/Jaco-Assistant/Scribosermo/-/tree/master#old-experiments). ## Evaluation data The Model was evaluated on Tuda and Common Voice. Read more about evaluation [here](https://gitlab.com/Jaco-Assistant/Scribosermo/-/tree/master#old-experiments). ## Ethical considerations Deploying a Speech-to-Text model into any production setting has ethical implications. You should consider these implications before use. ### Demographic Bias You should assume every machine learning model has demographic bias unless proven otherwise. For STT models, it is often the case that transcription accuracy is better for men than it is for women. If you are using this model in production, you should acknowledge this as a potential issue. ### Surveillance Speech-to-Text may be mis-used to invade the privacy of others by recording and mining information from private conversations. This kind of individual privacy is protected by law in may countries. You should not assume consent to record and analyze private speech. ## Caveats and recommendations Machine learning models (like this STT model) perform best on data that is similar to the data on which they were trained. Read about what to expect from an STT model with regard to your data [here](https://stt.readthedocs.io/en/latest/DEPLOYMENT.html#how-will-a-model-perform-on-my-data). In most applications, it is recommended that you [train your own language model](https://stt.readthedocs.io/en/latest/LANGUAGE_MODEL.html) to improve transcription accuracy on your speech data.
0
coqui_public_repos/STT
coqui_public_repos/STT/taskcluster/test-electronjs_v8.0_8k-linux-amd64-opt.yml
build: template_file: test-linux-opt-base.tyml docker_image: "ubuntu:16.04" dependencies: - "linux-amd64-cpu-opt" - "test-training_8k-linux-amd64-py36m-opt" test_model_task: "test-training_8k-linux-amd64-py36m-opt" system_setup: > ${nodejs.packages_xenial.prep_12} && ${nodejs.packages_xenial.apt_pinning} && apt-get -qq update && apt-get -qq -y install ${nodejs.packages_xenial.apt} ${electronjs.packages_xenial.apt} args: tests_cmdline: "${system.homedir.linux}/DeepSpeech/ds/taskcluster/tc-electron-tests.sh 12.x 8.0.1 8k" workerType: "${docker.dsTests}" metadata: name: "DeepSpeech Linux AMD64 CPU ElectronJS v8.0 tests (8kHz)" description: "Testing DeepSpeech for Linux/AMD64 on ElectronJS v8.0, CPU only, optimized version (8kHz)"
0
coqui_public_repos/STT-models/polish/jaco-assistant
coqui_public_repos/STT-models/polish/jaco-assistant/v0.0.1/LICENSE
GNU LESSER GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/> Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. This version of the GNU Lesser General Public License incorporates the terms and conditions of version 3 of the GNU General Public License, supplemented by the additional permissions listed below. 0. Additional Definitions. As used herein, "this License" refers to version 3 of the GNU Lesser General Public License, and the "GNU GPL" refers to version 3 of the GNU General Public License. "The Library" refers to a covered work governed by this License, other than an Application or a Combined Work as defined below. An "Application" is any work that makes use of an interface provided by the Library, but which is not otherwise based on the Library. Defining a subclass of a class defined by the Library is deemed a mode of using an interface provided by the Library. A "Combined Work" is a work produced by combining or linking an Application with the Library. The particular version of the Library with which the Combined Work was made is also called the "Linked Version". The "Minimal Corresponding Source" for a Combined Work means the Corresponding Source for the Combined Work, excluding any source code for portions of the Combined Work that, considered in isolation, are based on the Application, and not on the Linked Version. The "Corresponding Application Code" for a Combined Work means the object code and/or source code for the Application, including any data and utility programs needed for reproducing the Combined Work from the Application, but excluding the System Libraries of the Combined Work. 1. Exception to Section 3 of the GNU GPL. You may convey a covered work under sections 3 and 4 of this License without being bound by section 3 of the GNU GPL. 2. Conveying Modified Versions. If you modify a copy of the Library, and, in your modifications, a facility refers to a function or data to be supplied by an Application that uses the facility (other than as an argument passed when the facility is invoked), then you may convey a copy of the modified version: a) under this License, provided that you make a good faith effort to ensure that, in the event an Application does not supply the function or data, the facility still operates, and performs whatever part of its purpose remains meaningful, or b) under the GNU GPL, with none of the additional permissions of this License applicable to that copy. 3. Object Code Incorporating Material from Library Header Files. The object code form of an Application may incorporate material from a header file that is part of the Library. You may convey such object code under terms of your choice, provided that, if the incorporated material is not limited to numerical parameters, data structure layouts and accessors, or small macros, inline functions and templates (ten or fewer lines in length), you do both of the following: a) Give prominent notice with each copy of the object code that the Library is used in it and that the Library and its use are covered by this License. b) Accompany the object code with a copy of the GNU GPL and this license document. 4. Combined Works. You may convey a Combined Work under terms of your choice that, taken together, effectively do not restrict modification of the portions of the Library contained in the Combined Work and reverse engineering for debugging such modifications, if you also do each of the following: a) Give prominent notice with each copy of the Combined Work that the Library is used in it and that the Library and its use are covered by this License. b) Accompany the Combined Work with a copy of the GNU GPL and this license document. c) For a Combined Work that displays copyright notices during execution, include the copyright notice for the Library among these notices, as well as a reference directing the user to the copies of the GNU GPL and this license document. d) Do one of the following: 0) Convey the Minimal Corresponding Source under the terms of this License, and the Corresponding Application Code in a form suitable for, and under terms that permit, the user to recombine or relink the Application with a modified version of the Linked Version to produce a modified Combined Work, in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source. 1) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (a) uses at run time a copy of the Library already present on the user's computer system, and (b) will operate properly with a modified version of the Library that is interface-compatible with the Linked Version. e) Provide Installation Information, but only if you would otherwise be required to provide such information under section 6 of the GNU GPL, and only to the extent that such information is necessary to install and execute a modified version of the Combined Work produced by recombining or relinking the Application with a modified version of the Linked Version. (If you use option 4d0, the Installation Information must accompany the Minimal Corresponding Source and Corresponding Application Code. If you use option 4d1, you must provide the Installation Information in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.) 5. Combined Libraries. You may place library facilities that are a work based on the Library side by side in a single library together with other library facilities that are not Applications and are not covered by this License, and convey such a combined library under terms of your choice, if you do both of the following: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities, conveyed under the terms of this License. b) Give prominent notice with the combined library that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 6. Revised Versions of the GNU Lesser General Public License. The Free Software Foundation may publish revised and/or new versions of the GNU Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library as you received it specifies that a certain numbered version of the GNU Lesser General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that published version or of any later version published by the Free Software Foundation. If the Library as you received it does not specify a version number of the GNU Lesser General Public License, you may choose any version of the GNU Lesser General Public License ever published by the Free Software Foundation. If the Library as you received it specifies that a proxy can decide whether future versions of the GNU Lesser General Public License shall apply, that proxy's public statement of acceptance of any version is permanent authorization for you to choose that version for the Library.
0
coqui_public_repos/inference-engine/third_party/openfst-1.6.9-win/src
coqui_public_repos/inference-engine/third_party/openfst-1.6.9-win/src/extensions/Makefile.am
if HAVE_COMPACT compactdir = compact endif if HAVE_COMPRESS compressdir = compress endif if HAVE_CONST constdir = const endif if HAVE_FAR fardir = far endif if HAVE_GRM fardir = far pdtdir = pdt mpdtdir = mpdt endif if HAVE_LINEAR lineardir = linear endif if HAVE_LOOKAHEAD lookaheaddir = lookahead endif if HAVE_MPDT pdtdir = pdt mpdtdir = mpdt endif if HAVE_NGRAM ngramdir = ngram endif if HAVE_PYTHON fardir = far pywrapfstdir = python endif if HAVE_PDT pdtdir = pdt endif if HAVE_SPECIAL specialdir = special endif SUBDIRS = $(compactdir) $(compressdir) $(constdir) $(fardir) $(lineardir) \ $(lookaheaddir) $(pdtdir) $(mpdtdir) $(ngramdir) $(pywrapfstdir) \ $(specialdir)
0
coqui_public_repos
coqui_public_repos/coqui-voice-pack/LICENSE.md
MIT License Copyright (c) 2023 Coqui.ai Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
0
coqui_public_repos/STT
coqui_public_repos/STT/taskcluster/tf_ios-arm64-opt.yml
build: template_file: generic_tc_caching-darwin-opt-base.tyml cache: artifact_url: ${system.tensorflow.ios_arm64.url} artifact_namespace: ${system.tensorflow.ios_arm64.namespace} workerType: ${macOS.tfBuild} scripts: setup: "taskcluster/tf_tc-setup.sh" build: "taskcluster/tf_tc-build.sh --ios-arm64" package: "taskcluster/tf_tc-package.sh" maxRunTime: 28800 metadata: name: "TensorFlow iOS ARM64 TFLite" description: "Building TensorFlow for iOS ARM64, TFLite, optimized version"
0
coqui_public_repos/open-bible-scripts
coqui_public_repos/open-bible-scripts/extra-preprocess/luo.sh
#!/bin/bash echo 'I: No extra preprocessing needed for Luo.'
0
coqui_public_repos/TTS/TTS
coqui_public_repos/TTS/TTS/bin/compute_embeddings.py
import argparse import os from argparse import RawTextHelpFormatter import torch from tqdm import tqdm from TTS.config import load_config from TTS.config.shared_configs import BaseDatasetConfig from TTS.tts.datasets import load_tts_samples from TTS.tts.utils.managers import save_file from TTS.tts.utils.speakers import SpeakerManager def compute_embeddings( model_path, config_path, output_path, old_speakers_file=None, old_append=False, config_dataset_path=None, formatter_name=None, dataset_name=None, dataset_path=None, meta_file_train=None, meta_file_val=None, disable_cuda=False, no_eval=False, ): use_cuda = torch.cuda.is_available() and not disable_cuda if config_dataset_path is not None: c_dataset = load_config(config_dataset_path) meta_data_train, meta_data_eval = load_tts_samples(c_dataset.datasets, eval_split=not no_eval) else: c_dataset = BaseDatasetConfig() c_dataset.formatter = formatter_name c_dataset.dataset_name = dataset_name c_dataset.path = dataset_path if meta_file_train is not None: c_dataset.meta_file_train = meta_file_train if meta_file_val is not None: c_dataset.meta_file_val = meta_file_val meta_data_train, meta_data_eval = load_tts_samples(c_dataset, eval_split=not no_eval) if meta_data_eval is None: samples = meta_data_train else: samples = meta_data_train + meta_data_eval encoder_manager = SpeakerManager( encoder_model_path=model_path, encoder_config_path=config_path, d_vectors_file_path=old_speakers_file, use_cuda=use_cuda, ) class_name_key = encoder_manager.encoder_config.class_name_key # compute speaker embeddings if old_speakers_file is not None and old_append: speaker_mapping = encoder_manager.embeddings else: speaker_mapping = {} for fields in tqdm(samples): class_name = fields[class_name_key] audio_file = fields["audio_file"] embedding_key = fields["audio_unique_name"] # Only update the speaker name when the embedding is already in the old file. if embedding_key in speaker_mapping: speaker_mapping[embedding_key]["name"] = class_name continue if old_speakers_file is not None and embedding_key in encoder_manager.clip_ids: # get the embedding from the old file embedd = encoder_manager.get_embedding_by_clip(embedding_key) else: # extract the embedding embedd = encoder_manager.compute_embedding_from_clip(audio_file) # create speaker_mapping if target dataset is defined speaker_mapping[embedding_key] = {} speaker_mapping[embedding_key]["name"] = class_name speaker_mapping[embedding_key]["embedding"] = embedd if speaker_mapping: # save speaker_mapping if target dataset is defined if os.path.isdir(output_path): mapping_file_path = os.path.join(output_path, "speakers.pth") else: mapping_file_path = output_path if os.path.dirname(mapping_file_path) != "": os.makedirs(os.path.dirname(mapping_file_path), exist_ok=True) save_file(speaker_mapping, mapping_file_path) print("Speaker embeddings saved at:", mapping_file_path) if __name__ == "__main__": parser = argparse.ArgumentParser( description="""Compute embedding vectors for each audio file in a dataset and store them keyed by `{dataset_name}#{file_path}` in a .pth file\n\n""" """ Example runs: python TTS/bin/compute_embeddings.py --model_path speaker_encoder_model.pth --config_path speaker_encoder_config.json --config_dataset_path dataset_config.json python TTS/bin/compute_embeddings.py --model_path speaker_encoder_model.pth --config_path speaker_encoder_config.json --formatter_name coqui --dataset_path /path/to/vctk/dataset --dataset_name my_vctk --meta_file_train /path/to/vctk/metafile_train.csv --meta_file_val /path/to/vctk/metafile_eval.csv """, formatter_class=RawTextHelpFormatter, ) parser.add_argument( "--model_path", type=str, help="Path to model checkpoint file. It defaults to the released speaker encoder.", default="https://github.com/coqui-ai/TTS/releases/download/speaker_encoder_model/model_se.pth.tar", ) parser.add_argument( "--config_path", type=str, help="Path to model config file. It defaults to the released speaker encoder config.", default="https://github.com/coqui-ai/TTS/releases/download/speaker_encoder_model/config_se.json", ) parser.add_argument( "--config_dataset_path", type=str, help="Path to dataset config file. You either need to provide this or `formatter_name`, `dataset_name` and `dataset_path` arguments.", default=None, ) parser.add_argument( "--output_path", type=str, help="Path for output `pth` or `json` file.", default="speakers.pth", ) parser.add_argument( "--old_file", type=str, help="The old existing embedding file, from which the embeddings will be directly loaded for already computed audio clips.", default=None, ) parser.add_argument( "--old_append", help="Append new audio clip embeddings to the old embedding file, generate a new non-duplicated merged embedding file. Default False", default=False, action="store_true", ) parser.add_argument("--disable_cuda", type=bool, help="Flag to disable cuda.", default=False) parser.add_argument("--no_eval", help="Do not compute eval?. Default False", default=False, action="store_true") parser.add_argument( "--formatter_name", type=str, help="Name of the formatter to use. You either need to provide this or `config_dataset_path`", default=None, ) parser.add_argument( "--dataset_name", type=str, help="Name of the dataset to use. You either need to provide this or `config_dataset_path`", default=None, ) parser.add_argument( "--dataset_path", type=str, help="Path to the dataset. You either need to provide this or `config_dataset_path`", default=None, ) parser.add_argument( "--meta_file_train", type=str, help="Path to the train meta file. If not set, dataset formatter uses the default metafile if it is defined in the formatter. You either need to provide this or `config_dataset_path`", default=None, ) parser.add_argument( "--meta_file_val", type=str, help="Path to the evaluation meta file. If not set, dataset formatter uses the default metafile if it is defined in the formatter. You either need to provide this or `config_dataset_path`", default=None, ) args = parser.parse_args() compute_embeddings( args.model_path, args.config_path, args.output_path, old_speakers_file=args.old_file, old_append=args.old_append, config_dataset_path=args.config_dataset_path, formatter_name=args.formatter_name, dataset_name=args.dataset_name, dataset_path=args.dataset_path, meta_file_train=args.meta_file_train, meta_file_val=args.meta_file_val, disable_cuda=args.disable_cuda, no_eval=args.no_eval, )
0
coqui_public_repos/STT-examples/electron
coqui_public_repos/STT-examples/electron/public/create-window.js
const electron = require('electron'); const Path = require('path'); const app = electron.app; const ipcMain = electron.ipcMain; const BrowserWindow = electron.BrowserWindow; const isDev = require('electron-is-dev'); if (isDev) process.env.NODE_ENV = 'dev'; const {recognizeWav} = require('./recognize-wav'); const fs = require('fs'); const path = require('path'); let mainWindow; function createWindow(model) { mainWindow = new BrowserWindow({ width: 480, height: 480, webPreferences: { nodeIntegration: true, nodeIntegrationInWorker: false, preload: __dirname + '/preload.js' } }); mainWindow.loadURL(isDev ? 'http://localhost:3000' : `file://${Path.join(__dirname, '../build/index.html')}`); if (isDev) { // open Chrome Development Console // mainWindow.webContents.openDevTools(); } mainWindow.on('closed', () => mainWindow = null); app.on('window-all-closed', () => { app.quit() }); // message from front-end App.js, request that this file be processed by STT ipcMain.handle('recognize-wav', async function (event, file) { const filePath = path.resolve(__dirname, 'audio', file); const results = await recognizeWav(filePath, model); if (results) checkDone(file, results); return results; }); let count = 0; function checkDone(file, results) { if (process.argv.indexOf('STT_TEST') > -1) { // setup a timeout of 10 minutes and return failed test // in case it cannot really do test setTimeout(() => { console.log('test fail'); app.quit(1); process.exit(1); }, 10*60*1000); count++ console.log('test:', count, file, results); if (count === 3) { console.log('test done'); app.quit(0); process.exit(0); } } } // message from front-end App.js, retrieve list of .wav files in /public/audio ipcMain.handle('load-files', function (event) { return new Promise(function (resolve, reject) { try { let audioPath = path.resolve(__dirname, 'audio'); fs.exists(audioPath, function(exists) { if (exists) { fs.readdir(audioPath, function (err, files) { files = files.filter(function (file) { return file.endsWith('.wav'); }); resolve(files); }); } else { console.log('audio files path does not exist: ', audioPath); console.log('See Readme.md'); process.exit(); } }); } catch (e) { reject(e.toString()) } }); }); return mainWindow; } module.exports = createWindow;
0
coqui_public_repos/STT
coqui_public_repos/STT/doc/Python-API.rst
.. _python-api: Python ====== .. automodule:: native_client.python Model ----- .. autoclass:: Model :members: Stream ------ .. autoclass:: Stream :members: Metadata -------- .. autoclass:: Metadata :members: CandidateTranscript ------------------- .. autoclass:: CandidateTranscript :members: TokenMetadata ------------- .. autoclass:: TokenMetadata :members:
0
coqui_public_repos/open-bible-scripts
coqui_public_repos/open-bible-scripts/data/kurdi-sorani.txt
https://ebible.org/Scriptures/ckb_readaloud.zip https://downloads.open.bible/audio/ck/ckbOKS20/ckbOKS20_gen_wav.zip https://downloads.open.bible/audio/ck/ckbOKS20/ckbOKS20_exo_wav.zip https://downloads.open.bible/audio/ck/ckbOKS20/ckbOKS20_lev_wav.zip https://downloads.open.bible/audio/ck/ckbOKS20/ckbOKS20_num_wav.zip https://downloads.open.bible/audio/ck/ckbOKS20/ckbOKS20_deu_wav.zip https://downloads.open.bible/audio/ck/ckbOKS20/ckbOKS20_jos_wav.zip https://downloads.open.bible/audio/ck/ckbOKS20/ckbOKS20_jdg_wav.zip https://downloads.open.bible/audio/ck/ckbOKS20/ckbOKS20_rut_wav.zip https://downloads.open.bible/audio/ck/ckbOKS20/ckbOKS20_1sa_wav.zip https://downloads.open.bible/audio/ck/ckbOKS20/ckbOKS20_2sa_wav.zip https://downloads.open.bible/audio/ck/ckbOKS20/ckbOKS20_1ki_wav.zip https://downloads.open.bible/audio/ck/ckbOKS20/ckbOKS20_2ki_wav.zip https://downloads.open.bible/audio/ck/ckbOKS20/ckbOKS20_1ch_wav.zip https://downloads.open.bible/audio/ck/ckbOKS20/ckbOKS20_2ch_wav.zip https://downloads.open.bible/audio/ck/ckbOKS20/ckbOKS20_ezr_wav.zip https://downloads.open.bible/audio/ck/ckbOKS20/ckbOKS20_neh_wav.zip https://downloads.open.bible/audio/ck/ckbOKS20/ckbOKS20_est_wav.zip https://downloads.open.bible/audio/ck/ckbOKS20/ckbOKS20_job_wav.zip https://downloads.open.bible/audio/ck/ckbOKS20/ckbOKS20_psa_wav.zip https://downloads.open.bible/audio/ck/ckbOKS20/ckbOKS20_pro_wav.zip https://downloads.open.bible/audio/ck/ckbOKS20/ckbOKS20_ecc_wav.zip https://downloads.open.bible/audio/ck/ckbOKS20/ckbOKS20_sng_wav.zip https://downloads.open.bible/audio/ck/ckbOKS20/ckbOKS20_isa_wav.zip https://downloads.open.bible/audio/ck/ckbOKS20/ckbOKS20_jer_wav.zip https://downloads.open.bible/audio/ck/ckbOKS20/ckbOKS20_lam_wav.zip https://downloads.open.bible/audio/ck/ckbOKS20/ckbOKS20_ezk_wav.zip https://downloads.open.bible/audio/ck/ckbOKS20/ckbOKS20_dan_wav.zip https://downloads.open.bible/audio/ck/ckbOKS20/ckbOKS20_hos_wav.zip https://downloads.open.bible/audio/ck/ckbOKS20/ckbOKS20_jol_wav.zip https://downloads.open.bible/audio/ck/ckbOKS20/ckbOKS20_amo_wav.zip https://downloads.open.bible/audio/ck/ckbOKS20/ckbOKS20_oba_wav.zip https://downloads.open.bible/audio/ck/ckbOKS20/ckbOKS20_jon_wav.zip https://downloads.open.bible/audio/ck/ckbOKS20/ckbOKS20_mic_wav.zip https://downloads.open.bible/audio/ck/ckbOKS20/ckbOKS20_nam_wav.zip https://downloads.open.bible/audio/ck/ckbOKS20/ckbOKS20_hab_wav.zip https://downloads.open.bible/audio/ck/ckbOKS20/ckbOKS20_zep_wav.zip https://downloads.open.bible/audio/ck/ckbOKS20/ckbOKS20_hag_wav.zip https://downloads.open.bible/audio/ck/ckbOKS20/ckbOKS20_zec_wav.zip https://downloads.open.bible/audio/ck/ckbOKS20/ckbOKS20_mal_wav.zip https://downloads.open.bible/audio/ck/ckbOKS20/ckbOKS20_mat_wav.zip https://downloads.open.bible/audio/ck/ckbOKS20/ckbOKS20_mrk_wav.zip https://downloads.open.bible/audio/ck/ckbOKS20/ckbOKS20_luk_wav.zip https://downloads.open.bible/audio/ck/ckbOKS20/ckbOKS20_jhn_wav.zip https://downloads.open.bible/audio/ck/ckbOKS20/ckbOKS20_act_wav.zip https://downloads.open.bible/audio/ck/ckbOKS20/ckbOKS20_rom_wav.zip https://downloads.open.bible/audio/ck/ckbOKS20/ckbOKS20_1co_wav.zip https://downloads.open.bible/audio/ck/ckbOKS20/ckbOKS20_2co_wav.zip https://downloads.open.bible/audio/ck/ckbOKS20/ckbOKS20_gal_wav.zip https://downloads.open.bible/audio/ck/ckbOKS20/ckbOKS20_eph_wav.zip https://downloads.open.bible/audio/ck/ckbOKS20/ckbOKS20_php_wav.zip https://downloads.open.bible/audio/ck/ckbOKS20/ckbOKS20_col_wav.zip https://downloads.open.bible/audio/ck/ckbOKS20/ckbOKS20_1th_wav.zip https://downloads.open.bible/audio/ck/ckbOKS20/ckbOKS20_2th_wav.zip https://downloads.open.bible/audio/ck/ckbOKS20/ckbOKS20_1ti_wav.zip https://downloads.open.bible/audio/ck/ckbOKS20/ckbOKS20_2ti_wav.zip https://downloads.open.bible/audio/ck/ckbOKS20/ckbOKS20_tit_wav.zip https://downloads.open.bible/audio/ck/ckbOKS20/ckbOKS20_phm_wav.zip https://downloads.open.bible/audio/ck/ckbOKS20/ckbOKS20_heb_wav.zip https://downloads.open.bible/audio/ck/ckbOKS20/ckbOKS20_jas_wav.zip https://downloads.open.bible/audio/ck/ckbOKS20/ckbOKS20_1pe_wav.zip https://downloads.open.bible/audio/ck/ckbOKS20/ckbOKS20_2pe_wav.zip https://downloads.open.bible/audio/ck/ckbOKS20/ckbOKS20_1jn_wav.zip https://downloads.open.bible/audio/ck/ckbOKS20/ckbOKS20_2jn_wav.zip https://downloads.open.bible/audio/ck/ckbOKS20/ckbOKS20_3jn_wav.zip https://downloads.open.bible/audio/ck/ckbOKS20/ckbOKS20_jud_wav.zip https://downloads.open.bible/audio/ck/ckbOKS20/ckbOKS20_rev_wav.zip
0
coqui_public_repos/inference-engine/third_party/openfst-1.6.7/src/extensions
coqui_public_repos/inference-engine/third_party/openfst-1.6.7/src/extensions/const/Makefile.am
AM_CPPFLAGS = -I$(srcdir)/../../include $(ICU_CPPFLAGS) libfstdir = @libfstdir@ libfst_LTLIBRARIES = const8-fst.la const16-fst.la const64-fst.la lib_LTLIBRARIES = libfstconst.la libfstconst_la_SOURCES = const8-fst.cc const16-fst.cc const64-fst.cc libfstconst_la_LDFLAGS = -version-info 10:0:0 -lm $(DL_LIBS) libfstconst_la_LIBADD = ../../lib/libfst.la -lm $(DL_LIBS) const8_fst_la_SOURCES = const8-fst.cc const8_fst_la_LDFLAGS = -module const16_fst_la_SOURCES = const16-fst.cc const16_fst_la_LDFLAGS = -module const64_fst_la_SOURCES = const64-fst.cc const64_fst_la_LDFLAGS = -module
0
coqui_public_repos/STT-models/french/commonvoice-fr
coqui_public_repos/STT-models/french/commonvoice-fr/v0.9/LICENSE
Mozilla Public License Version 2.0 ================================== 1. Definitions -------------- 1.1. "Contributor" means each individual or legal entity that creates, contributes to the creation of, or owns Covered Software. 1.2. "Contributor Version" means the combination of the Contributions of others (if any) used by a Contributor and that particular Contributor's Contribution. 1.3. "Contribution" means Covered Software of a particular Contributor. 1.4. "Covered Software" means Source Code Form to which the initial Contributor has attached the notice in Exhibit A, the Executable Form of such Source Code Form, and Modifications of such Source Code Form, in each case including portions thereof. 1.5. "Incompatible With Secondary Licenses" means (a) that the initial Contributor has attached the notice described in Exhibit B to the Covered Software; or (b) that the Covered Software was made available under the terms of version 1.1 or earlier of the License, but not also under the terms of a Secondary License. 1.6. "Executable Form" means any form of the work other than Source Code Form. 1.7. "Larger Work" means a work that combines Covered Software with other material, in a separate file or files, that is not Covered Software. 1.8. "License" means this document. 1.9. "Licensable" means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently, any and all of the rights conveyed by this License. 1.10. "Modifications" means any of the following: (a) any file in Source Code Form that results from an addition to, deletion from, or modification of the contents of Covered Software; or (b) any new file in Source Code Form that contains any Covered Software. 1.11. "Patent Claims" of a Contributor means any patent claim(s), including without limitation, method, process, and apparatus claims, in any patent Licensable by such Contributor that would be infringed, but for the grant of the License, by the making, using, selling, offering for sale, having made, import, or transfer of either its Contributions or its Contributor Version. 1.12. "Secondary License" means either the GNU General Public License, Version 2.0, the GNU Lesser General Public License, Version 2.1, the GNU Affero General Public License, Version 3.0, or any later versions of those licenses. 1.13. "Source Code Form" means the form of the work preferred for making modifications. 1.14. "You" (or "Your") means an individual or a legal entity exercising rights under this License. For legal entities, "You" includes any entity that controls, is controlled by, or is under common control with You. For purposes of this definition, "control" means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity. 2. License Grants and Conditions -------------------------------- 2.1. Grants Each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license: (a) under intellectual property rights (other than patent or trademark) Licensable by such Contributor to use, reproduce, make available, modify, display, perform, distribute, and otherwise exploit its Contributions, either on an unmodified basis, with Modifications, or as part of a Larger Work; and (b) under Patent Claims of such Contributor to make, use, sell, offer for sale, have made, import, and otherwise transfer either its Contributions or its Contributor Version. 2.2. Effective Date The licenses granted in Section 2.1 with respect to any Contribution become effective for each Contribution on the date the Contributor first distributes such Contribution. 2.3. Limitations on Grant Scope The licenses granted in this Section 2 are the only rights granted under this License. No additional rights or licenses will be implied from the distribution or licensing of Covered Software under this License. Notwithstanding Section 2.1(b) above, no patent license is granted by a Contributor: (a) for any code that a Contributor has removed from Covered Software; or (b) for infringements caused by: (i) Your and any other third party's modifications of Covered Software, or (ii) the combination of its Contributions with other software (except as part of its Contributor Version); or (c) under Patent Claims infringed by Covered Software in the absence of its Contributions. This License does not grant any rights in the trademarks, service marks, or logos of any Contributor (except as may be necessary to comply with the notice requirements in Section 3.4). 2.4. Subsequent Licenses No Contributor makes additional grants as a result of Your choice to distribute the Covered Software under a subsequent version of this License (see Section 10.2) or under the terms of a Secondary License (if permitted under the terms of Section 3.3). 2.5. Representation Each Contributor represents that the Contributor believes its Contributions are its original creation(s) or it has sufficient rights to grant the rights to its Contributions conveyed by this License. 2.6. Fair Use This License is not intended to limit any rights You have under applicable copyright doctrines of fair use, fair dealing, or other equivalents. 2.7. Conditions Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in Section 2.1. 3. Responsibilities ------------------- 3.1. Distribution of Source Form All distribution of Covered Software in Source Code Form, including any Modifications that You create or to which You contribute, must be under the terms of this License. You must inform recipients that the Source Code Form of the Covered Software is governed by the terms of this License, and how they can obtain a copy of this License. You may not attempt to alter or restrict the recipients' rights in the Source Code Form. 3.2. Distribution of Executable Form If You distribute Covered Software in Executable Form then: (a) such Covered Software must also be made available in Source Code Form, as described in Section 3.1, and You must inform recipients of the Executable Form how they can obtain a copy of such Source Code Form by reasonable means in a timely manner, at a charge no more than the cost of distribution to the recipient; and (b) You may distribute such Executable Form under the terms of this License, or sublicense it under different terms, provided that the license for the Executable Form does not attempt to limit or alter the recipients' rights in the Source Code Form under this License. 3.3. Distribution of a Larger Work You may create and distribute a Larger Work under terms of Your choice, provided that You also comply with the requirements of this License for the Covered Software. If the Larger Work is a combination of Covered Software with a work governed by one or more Secondary Licenses, and the Covered Software is not Incompatible With Secondary Licenses, this License permits You to additionally distribute such Covered Software under the terms of such Secondary License(s), so that the recipient of the Larger Work may, at their option, further distribute the Covered Software under the terms of either this License or such Secondary License(s). 3.4. Notices You may not remove or alter the substance of any license notices (including copyright notices, patent notices, disclaimers of warranty, or limitations of liability) contained within the Source Code Form of the Covered Software, except that You may alter any license notices to the extent required to remedy known factual inaccuracies. 3.5. Application of Additional Terms You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Software. However, You may do so only on Your own behalf, and not on behalf of any Contributor. You must make it absolutely clear that any such warranty, support, indemnity, or liability obligation is offered by You alone, and You hereby agree to indemnify every Contributor for any liability incurred by such Contributor as a result of warranty, support, indemnity or liability terms You offer. You may include additional disclaimers of warranty and limitations of liability specific to any jurisdiction. 4. Inability to Comply Due to Statute or Regulation --------------------------------------------------- If it is impossible for You to comply with any of the terms of this License with respect to some or all of the Covered Software due to statute, judicial order, or regulation then You must: (a) comply with the terms of this License to the maximum extent possible; and (b) describe the limitations and the code they affect. Such description must be placed in a text file included with all distributions of the Covered Software under this License. Except to the extent prohibited by statute or regulation, such description must be sufficiently detailed for a recipient of ordinary skill to be able to understand it. 5. Termination -------------- 5.1. The rights granted under this License will terminate automatically if You fail to comply with any of its terms. However, if You become compliant, then the rights granted under this License from a particular Contributor are reinstated (a) provisionally, unless and until such Contributor explicitly and finally terminates Your grants, and (b) on an ongoing basis, if such Contributor fails to notify You of the non-compliance by some reasonable means prior to 60 days after You have come back into compliance. Moreover, Your grants from a particular Contributor are reinstated on an ongoing basis if such Contributor notifies You of the non-compliance by some reasonable means, this is the first time You have received notice of non-compliance with this License from such Contributor, and You become compliant prior to 30 days after Your receipt of the notice. 5.2. If You initiate litigation against any entity by asserting a patent infringement claim (excluding declaratory judgment actions, counter-claims, and cross-claims) alleging that a Contributor Version directly or indirectly infringes any patent, then the rights granted to You by any and all Contributors for the Covered Software under Section 2.1 of this License shall terminate. 5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user license agreements (excluding distributors and resellers) which have been validly granted by You or Your distributors under this License prior to termination shall survive termination. ************************************************************************ * * * 6. Disclaimer of Warranty * * ------------------------- * * * * Covered Software is provided under this License on an "as is" * * basis, without warranty of any kind, either expressed, implied, or * * statutory, including, without limitation, warranties that the * * Covered Software is free of defects, merchantable, fit for a * * particular purpose or non-infringing. The entire risk as to the * * quality and performance of the Covered Software is with You. * * Should any Covered Software prove defective in any respect, You * * (not any Contributor) assume the cost of any necessary servicing, * * repair, or correction. This disclaimer of warranty constitutes an * * essential part of this License. No use of any Covered Software is * * authorized under this License except under this disclaimer. * * * ************************************************************************ ************************************************************************ * * * 7. Limitation of Liability * * -------------------------- * * * * Under no circumstances and under no legal theory, whether tort * * (including negligence), contract, or otherwise, shall any * * Contributor, or anyone who distributes Covered Software as * * permitted above, be liable to You for any direct, indirect, * * special, incidental, or consequential damages of any character * * including, without limitation, damages for lost profits, loss of * * goodwill, work stoppage, computer failure or malfunction, or any * * and all other commercial damages or losses, even if such party * * shall have been informed of the possibility of such damages. This * * limitation of liability shall not apply to liability for death or * * personal injury resulting from such party's negligence to the * * extent applicable law prohibits such limitation. Some * * jurisdictions do not allow the exclusion or limitation of * * incidental or consequential damages, so this exclusion and * * limitation may not apply to You. * * * ************************************************************************ 8. Litigation ------------- Any litigation relating to this License may be brought only in the courts of a jurisdiction where the defendant maintains its principal place of business and such litigation shall be governed by laws of that jurisdiction, without reference to its conflict-of-law provisions. Nothing in this Section shall prevent a party's ability to bring cross-claims or counter-claims. 9. Miscellaneous ---------------- This License represents the complete agreement concerning the subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not be used to construe this License against a Contributor. 10. Versions of the License --------------------------- 10.1. New Versions Mozilla Foundation is the license steward. Except as provided in Section 10.3, no one other than the license steward has the right to modify or publish new versions of this License. Each version will be given a distinguishing version number. 10.2. Effect of New Versions You may distribute the Covered Software under the terms of the version of the License under which You originally received the Covered Software, or under the terms of any subsequent version published by the license steward. 10.3. Modified Versions If you create software not governed by this License, and you want to create a new license for such software, you may create and use a modified version of this License if you rename the license and remove any references to the name of the license steward (except to note that such modified license differs from this License). 10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses If You choose to distribute Source Code Form that is Incompatible With Secondary Licenses under the terms of this version of the License, the notice described in Exhibit B of this License must be attached. Exhibit A - Source Code Form License Notice ------------------------------------------- This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. If it is not possible or desirable to put the notice in a particular file, then You may include the notice in a location (such as a LICENSE file in a relevant directory) where a recipient would be likely to look for such a notice. You may add additional accurate notices of copyright ownership. Exhibit B - "Incompatible With Secondary Licenses" Notice --------------------------------------------------------- This Source Code Form is "Incompatible With Secondary Licenses", as defined by the Mozilla Public License, v. 2.0.
0
coqui_public_repos/inference-engine/third_party/kenlm/lm
coqui_public_repos/inference-engine/third_party/kenlm/lm/interpolate/split_worker.hh
#ifndef KENLM_INTERPOLATE_SPLIT_WORKER_H_ #define KENLM_INTERPOLATE_SPLIT_WORKER_H_ #include "util/stream/chain.hh" #include "util/stream/stream.hh" namespace lm { namespace interpolate { class SplitWorker { public: /** * Constructs a split worker for a particular order. It writes the * split-off backoff values to the backoff chain and the ngram id and * probability to the sort chain for each ngram in the input. */ SplitWorker(std::size_t order, util::stream::Chain &backoff_chain, util::stream::Chain &sort_chain); /** * The callback invoked to handle the input from the ngram intermediate * files. */ void Run(const util::stream::ChainPosition& position); private: /** * The ngram order we are reading/writing for. */ std::size_t order_; /** * The stream to write to for the backoff values. */ util::stream::Stream backoff_input_; /** * The stream to write to for the ngram id + probability values. */ util::stream::Stream sort_input_; }; } } #endif
0
coqui_public_repos/STT
coqui_public_repos/STT/taskcluster/docker-image-train.yml
build: template_file: docker-build-base.tyml dockerfile: "Dockerfile.train" workerType: "${docker.tfBuild}" metadata: name: "DeepSpeech Docker train" description: "Testing |docker build| of DeepSpeech train image"
0
coqui_public_repos/STT-examples/android_mic_streaming/app/src/main/res
coqui_public_repos/STT-examples/android_mic_streaming/app/src/main/res/values/strings.xml
<resources> <string name="app_name">STT Demo</string> </resources>
0
coqui_public_repos/STT
coqui_public_repos/STT/taskcluster/test-nodejs_10x_16k-linux-amd64-opt.yml
build: template_file: test-linux-opt-base.tyml docker_image: "ubuntu:16.04" dependencies: - "linux-amd64-cpu-opt" - "test-training_16k-linux-amd64-py36m-opt" test_model_task: "test-training_16k-linux-amd64-py36m-opt" system_setup: > ${nodejs.packages_xenial.prep_10} && ${nodejs.packages_xenial.apt_pinning} && apt-get -qq update && apt-get -qq -y install ${nodejs.packages_xenial.apt} args: tests_cmdline: "${system.homedir.linux}/DeepSpeech/ds/taskcluster/tc-node-tests.sh 10.x 16k" workerType: "${docker.dsTests}" metadata: name: "DeepSpeech Linux AMD64 CPU NodeJS 10.x tests (16kHz)" description: "Testing DeepSpeech for Linux/AMD64 on NodeJS v10.x, CPU only, optimized version (16kHz)"
0
coqui_public_repos/inference-engine/third_party/openfst-1.6.7/src/extensions
coqui_public_repos/inference-engine/third_party/openfst-1.6.7/src/extensions/linear/Makefile.am
AM_CPPFLAGS = -I$(srcdir)/../../include $(ICU_CPPFLAGS) if HAVE_BIN bin_PROGRAMS = fstlinear fstloglinearapply LDADD = libfstlinearscript.la ../../script/libfstscript.la \ ../../lib/libfst.la -lm $(DL_LIBS) fstlinear_SOURCES = fstlinear.cc fstloglinearapply_SOURCES = fstloglinearapply.cc endif if HAVE_SCRIPT libfstlinearscript_la_SOURCES = linearscript.cc libfstlinearscript_la_LDFLAGS = -version-info 10:0:0 -lm $(DL_LIBS) libfstlinearscript_la_LIBADD = ../../script/libfstscript.la \ ../../lib/libfst.la -lm $(DL_LIBS) endif if HAVE_SCRIPT libfst_LTLIBRARIES = linear_tagger-fst.la \ linear_classifier-fst.la lib_LTLIBRARIES = libfstlinearscript.la else libfst_LTLIBRARIES = linear_tagger-fst.la linear_classifier-fst.la endif libfstdir = @libfstdir@ linear_tagger_fst_la_SOURCES = linear-tagger-fst.cc linear_tagger_fst_la_LDFLAGS = -module linear_classifier_fst_la_SOURCES = linear-classifier-fst.cc linear_classifier_fst_la_LDFLAGS = -module
0
coqui_public_repos/inference-engine/third_party/openfst-1.6.9-win/src
coqui_public_repos/inference-engine/third_party/openfst-1.6.9-win/src/bin/fstminimize-main.cc
// See www.openfst.org for extensive documentation on this weighted // finite-state transducer library. // // Minimizes a deterministic FST. #include <cstring> #include <memory> #include <string> #include <fst/flags.h> #include <fst/log.h> #include <fst/script/minimize.h> DECLARE_double(delta); DECLARE_bool(allow_nondet); int fstminimize_main(int argc, char **argv) { namespace s = fst::script; using fst::script::MutableFstClass; using fst::script::VectorFstClass; string usage = "Minimizes a deterministic FST.\n\n Usage: "; usage += argv[0]; usage += " [in.fst [out1.fst [out2.fst]]]\n"; std::set_new_handler(FailedNewHandler); SET_FLAGS(usage.c_str(), &argc, &argv, true); if (argc > 4) { ShowUsage(); return 1; } const string in_name = (argc > 1 && strcmp(argv[1], "-") != 0) ? argv[1] : ""; const string out1_name = (argc > 2 && strcmp(argv[2], "-") != 0) ? argv[2] : ""; const string out2_name = (argc > 3 && strcmp(argv[3], "-") != 0) ? argv[3] : ""; if (out1_name.empty() && out2_name.empty() && argc > 3) { LOG(ERROR) << argv[0] << ": Both outputs can't be standard output."; return 1; } std::unique_ptr<MutableFstClass> fst1(MutableFstClass::Read(in_name, true)); if (!fst1) return 1; if (argc > 3) { std::unique_ptr<MutableFstClass> fst2(new VectorFstClass(fst1->ArcType())); s::Minimize(fst1.get(), fst2.get(), FLAGS_delta, FLAGS_allow_nondet); if (!fst2->Write(out2_name)) return 1; } else { s::Minimize(fst1.get(), nullptr, FLAGS_delta, FLAGS_allow_nondet); } return !fst1->Write(out1_name); }
0
coqui_public_repos/inference-engine/src
coqui_public_repos/inference-engine/src/ctcdecode/numpy.i
/* -*- C -*- (not really, but good for syntax highlighting) */ /* * Copyright (c) 2005-2015, NumPy Developers. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. * * * Neither the name of the NumPy Developers nor the names of any * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifdef SWIGPYTHON %{ #ifndef SWIG_FILE_WITH_INIT #define NO_IMPORT_ARRAY #endif #include "stdio.h" #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION #include <numpy/arrayobject.h> %} /**********************************************************************/ %fragment("NumPy_Backward_Compatibility", "header") { %#if NPY_API_VERSION < 0x00000007 %#define NPY_ARRAY_DEFAULT NPY_DEFAULT %#define NPY_ARRAY_FARRAY NPY_FARRAY %#define NPY_FORTRANORDER NPY_FORTRAN %#endif } /**********************************************************************/ /* The following code originally appeared in * enthought/kiva/agg/src/numeric.i written by Eric Jones. It was * translated from C++ to C by John Hunter. Bill Spotz has modified * it to fix some minor bugs, upgrade from Numeric to numpy (all * versions), add some comments and functionality, and convert from * direct code insertion to SWIG fragments. */ %fragment("NumPy_Macros", "header") { /* Macros to extract array attributes. */ %#if NPY_API_VERSION < 0x00000007 %#define is_array(a) ((a) && PyArray_Check((PyArrayObject*)a)) %#define array_type(a) (int)(PyArray_TYPE((PyArrayObject*)a)) %#define array_numdims(a) (((PyArrayObject*)a)->nd) %#define array_dimensions(a) (((PyArrayObject*)a)->dimensions) %#define array_size(a,i) (((PyArrayObject*)a)->dimensions[i]) %#define array_strides(a) (((PyArrayObject*)a)->strides) %#define array_stride(a,i) (((PyArrayObject*)a)->strides[i]) %#define array_data(a) (((PyArrayObject*)a)->data) %#define array_descr(a) (((PyArrayObject*)a)->descr) %#define array_flags(a) (((PyArrayObject*)a)->flags) %#define array_clearflags(a,f) (((PyArrayObject*)a)->flags) &= ~f %#define array_enableflags(a,f) (((PyArrayObject*)a)->flags) = f %#define array_is_fortran(a) (PyArray_ISFORTRAN((PyArrayObject*)a)) %#else %#define is_array(a) ((a) && PyArray_Check(a)) %#define array_type(a) PyArray_TYPE((PyArrayObject*)a) %#define array_numdims(a) PyArray_NDIM((PyArrayObject*)a) %#define array_dimensions(a) PyArray_DIMS((PyArrayObject*)a) %#define array_strides(a) PyArray_STRIDES((PyArrayObject*)a) %#define array_stride(a,i) PyArray_STRIDE((PyArrayObject*)a,i) %#define array_size(a,i) PyArray_DIM((PyArrayObject*)a,i) %#define array_data(a) PyArray_DATA((PyArrayObject*)a) %#define array_descr(a) PyArray_DESCR((PyArrayObject*)a) %#define array_flags(a) PyArray_FLAGS((PyArrayObject*)a) %#define array_enableflags(a,f) PyArray_ENABLEFLAGS((PyArrayObject*)a,f) %#define array_clearflags(a,f) PyArray_CLEARFLAGS((PyArrayObject*)a,f) %#define array_is_fortran(a) (PyArray_IS_F_CONTIGUOUS((PyArrayObject*)a)) %#endif %#define array_is_contiguous(a) (PyArray_ISCONTIGUOUS((PyArrayObject*)a)) %#define array_is_native(a) (PyArray_ISNOTSWAPPED((PyArrayObject*)a)) } /**********************************************************************/ %fragment("NumPy_Utilities", "header") { /* Given a PyObject, return a string describing its type. */ const char* pytype_string(PyObject* py_obj) { if (py_obj == NULL ) return "C NULL value"; if (py_obj == Py_None ) return "Python None" ; if (PyCallable_Check(py_obj)) return "callable" ; if (PyString_Check( py_obj)) return "string" ; if (PyInt_Check( py_obj)) return "int" ; if (PyFloat_Check( py_obj)) return "float" ; if (PyDict_Check( py_obj)) return "dict" ; if (PyList_Check( py_obj)) return "list" ; if (PyTuple_Check( py_obj)) return "tuple" ; %#if PY_MAJOR_VERSION < 3 if (PyFile_Check( py_obj)) return "file" ; if (PyModule_Check( py_obj)) return "module" ; if (PyInstance_Check(py_obj)) return "instance" ; %#endif return "unknown type"; } /* Given a NumPy typecode, return a string describing the type. */ const char* typecode_string(int typecode) { static const char* type_names[25] = {"bool", "byte", "unsigned byte", "short", "unsigned short", "int", "unsigned int", "long", "unsigned long", "long long", "unsigned long long", "float", "double", "long double", "complex float", "complex double", "complex long double", "object", "string", "unicode", "void", "ntypes", "notype", "char", "unknown"}; return typecode < 24 ? type_names[typecode] : type_names[24]; } /* Make sure input has correct numpy type. This now just calls PyArray_EquivTypenums(). */ int type_match(int actual_type, int desired_type) { return PyArray_EquivTypenums(actual_type, desired_type); } %#ifdef SWIGPY_USE_CAPSULE void free_cap(PyObject * cap) { void* array = (void*) PyCapsule_GetPointer(cap,SWIGPY_CAPSULE_NAME); if (array != NULL) free(array); } %#endif } /**********************************************************************/ %fragment("NumPy_Object_to_Array", "header", fragment="NumPy_Backward_Compatibility", fragment="NumPy_Macros", fragment="NumPy_Utilities") { /* Given a PyObject pointer, cast it to a PyArrayObject pointer if * legal. If not, set the python error string appropriately and * return NULL. */ PyArrayObject* obj_to_array_no_conversion(PyObject* input, int typecode) { PyArrayObject* ary = NULL; if (is_array(input) && (typecode == NPY_NOTYPE || PyArray_EquivTypenums(array_type(input), typecode))) { ary = (PyArrayObject*) input; } else if is_array(input) { const char* desired_type = typecode_string(typecode); const char* actual_type = typecode_string(array_type(input)); PyErr_Format(PyExc_TypeError, "Array of type '%s' required. Array of type '%s' given", desired_type, actual_type); ary = NULL; } else { const char* desired_type = typecode_string(typecode); const char* actual_type = pytype_string(input); PyErr_Format(PyExc_TypeError, "Array of type '%s' required. A '%s' was given", desired_type, actual_type); ary = NULL; } return ary; } /* Convert the given PyObject to a NumPy array with the given * typecode. On success, return a valid PyArrayObject* with the * correct type. On failure, the python error string will be set and * the routine returns NULL. */ PyArrayObject* obj_to_array_allow_conversion(PyObject* input, int typecode, int* is_new_object) { PyArrayObject* ary = NULL; PyObject* py_obj; if (is_array(input) && (typecode == NPY_NOTYPE || PyArray_EquivTypenums(array_type(input),typecode))) { ary = (PyArrayObject*) input; *is_new_object = 0; } else { py_obj = PyArray_FROMANY(input, typecode, 0, 0, NPY_ARRAY_DEFAULT); /* If NULL, PyArray_FromObject will have set python error value.*/ ary = (PyArrayObject*) py_obj; *is_new_object = 1; } return ary; } /* Given a PyArrayObject, check to see if it is contiguous. If so, * return the input pointer and flag it as not a new object. If it is * not contiguous, create a new PyArrayObject using the original data, * flag it as a new object and return the pointer. */ PyArrayObject* make_contiguous(PyArrayObject* ary, int* is_new_object, int min_dims, int max_dims) { PyArrayObject* result; if (array_is_contiguous(ary)) { result = ary; *is_new_object = 0; } else { result = (PyArrayObject*) PyArray_ContiguousFromObject((PyObject*)ary, array_type(ary), min_dims, max_dims); *is_new_object = 1; } return result; } /* Given a PyArrayObject, check to see if it is Fortran-contiguous. * If so, return the input pointer, but do not flag it as not a new * object. If it is not Fortran-contiguous, create a new * PyArrayObject using the original data, flag it as a new object * and return the pointer. */ PyArrayObject* make_fortran(PyArrayObject* ary, int* is_new_object) { PyArrayObject* result; if (array_is_fortran(ary)) { result = ary; *is_new_object = 0; } else { Py_INCREF(array_descr(ary)); result = (PyArrayObject*) PyArray_FromArray(ary, array_descr(ary), %#if NPY_API_VERSION < 0x00000007 NPY_FORTRANORDER); %#else NPY_ARRAY_F_CONTIGUOUS); %#endif *is_new_object = 1; } return result; } /* Convert a given PyObject to a contiguous PyArrayObject of the * specified type. If the input object is not a contiguous * PyArrayObject, a new one will be created and the new object flag * will be set. */ PyArrayObject* obj_to_array_contiguous_allow_conversion(PyObject* input, int typecode, int* is_new_object) { int is_new1 = 0; int is_new2 = 0; PyArrayObject* ary2; PyArrayObject* ary1 = obj_to_array_allow_conversion(input, typecode, &is_new1); if (ary1) { ary2 = make_contiguous(ary1, &is_new2, 0, 0); if ( is_new1 && is_new2) { Py_DECREF(ary1); } ary1 = ary2; } *is_new_object = is_new1 || is_new2; return ary1; } /* Convert a given PyObject to a Fortran-ordered PyArrayObject of the * specified type. If the input object is not a Fortran-ordered * PyArrayObject, a new one will be created and the new object flag * will be set. */ PyArrayObject* obj_to_array_fortran_allow_conversion(PyObject* input, int typecode, int* is_new_object) { int is_new1 = 0; int is_new2 = 0; PyArrayObject* ary2; PyArrayObject* ary1 = obj_to_array_allow_conversion(input, typecode, &is_new1); if (ary1) { ary2 = make_fortran(ary1, &is_new2); if (is_new1 && is_new2) { Py_DECREF(ary1); } ary1 = ary2; } *is_new_object = is_new1 || is_new2; return ary1; } } /* end fragment */ /**********************************************************************/ %fragment("NumPy_Array_Requirements", "header", fragment="NumPy_Backward_Compatibility", fragment="NumPy_Macros") { /* Test whether a python object is contiguous. If array is * contiguous, return 1. Otherwise, set the python error string and * return 0. */ int require_contiguous(PyArrayObject* ary) { int contiguous = 1; if (!array_is_contiguous(ary)) { PyErr_SetString(PyExc_TypeError, "Array must be contiguous. A non-contiguous array was given"); contiguous = 0; } return contiguous; } /* Test whether a python object is (C_ or F_) contiguous. If array is * contiguous, return 1. Otherwise, set the python error string and * return 0. */ int require_c_or_f_contiguous(PyArrayObject* ary) { int contiguous = 1; if (!(array_is_contiguous(ary) || array_is_fortran(ary))) { PyErr_SetString(PyExc_TypeError, "Array must be contiguous (C_ or F_). A non-contiguous array was given"); contiguous = 0; } return contiguous; } /* Require that a numpy array is not byte-swapped. If the array is * not byte-swapped, return 1. Otherwise, set the python error string * and return 0. */ int require_native(PyArrayObject* ary) { int native = 1; if (!array_is_native(ary)) { PyErr_SetString(PyExc_TypeError, "Array must have native byteorder. " "A byte-swapped array was given"); native = 0; } return native; } /* Require the given PyArrayObject to have a specified number of * dimensions. If the array has the specified number of dimensions, * return 1. Otherwise, set the python error string and return 0. */ int require_dimensions(PyArrayObject* ary, int exact_dimensions) { int success = 1; if (array_numdims(ary) != exact_dimensions) { PyErr_Format(PyExc_TypeError, "Array must have %d dimensions. Given array has %d dimensions", exact_dimensions, array_numdims(ary)); success = 0; } return success; } /* Require the given PyArrayObject to have one of a list of specified * number of dimensions. If the array has one of the specified number * of dimensions, return 1. Otherwise, set the python error string * and return 0. */ int require_dimensions_n(PyArrayObject* ary, int* exact_dimensions, int n) { int success = 0; int i; char dims_str[255] = ""; char s[255]; for (i = 0; i < n && !success; i++) { if (array_numdims(ary) == exact_dimensions[i]) { success = 1; } } if (!success) { for (i = 0; i < n-1; i++) { sprintf(s, "%d, ", exact_dimensions[i]); strcat(dims_str,s); } sprintf(s, " or %d", exact_dimensions[n-1]); strcat(dims_str,s); PyErr_Format(PyExc_TypeError, "Array must have %s dimensions. Given array has %d dimensions", dims_str, array_numdims(ary)); } return success; } /* Require the given PyArrayObject to have a specified shape. If the * array has the specified shape, return 1. Otherwise, set the python * error string and return 0. */ int require_size(PyArrayObject* ary, npy_intp* size, int n) { int i; int success = 1; size_t len; char desired_dims[255] = "["; char s[255]; char actual_dims[255] = "["; for(i=0; i < n;i++) { if (size[i] != -1 && size[i] != array_size(ary,i)) { success = 0; } } if (!success) { for (i = 0; i < n; i++) { if (size[i] == -1) { sprintf(s, "*,"); } else { sprintf(s, "%ld,", (long int)size[i]); } strcat(desired_dims,s); } len = strlen(desired_dims); desired_dims[len-1] = ']'; for (i = 0; i < n; i++) { sprintf(s, "%ld,", (long int)array_size(ary,i)); strcat(actual_dims,s); } len = strlen(actual_dims); actual_dims[len-1] = ']'; PyErr_Format(PyExc_TypeError, "Array must have shape of %s. Given array has shape of %s", desired_dims, actual_dims); } return success; } /* Require the given PyArrayObject to to be Fortran ordered. If the * the PyArrayObject is already Fortran ordered, do nothing. Else, * set the Fortran ordering flag and recompute the strides. */ int require_fortran(PyArrayObject* ary) { int success = 1; int nd = array_numdims(ary); int i; npy_intp * strides = array_strides(ary); if (array_is_fortran(ary)) return success; int n_non_one = 0; /* Set the Fortran ordered flag */ const npy_intp *dims = array_dimensions(ary); for (i=0; i < nd; ++i) n_non_one += (dims[i] != 1) ? 1 : 0; if (n_non_one > 1) array_clearflags(ary,NPY_ARRAY_CARRAY); array_enableflags(ary,NPY_ARRAY_FARRAY); /* Recompute the strides */ strides[0] = strides[nd-1]; for (i=1; i < nd; ++i) strides[i] = strides[i-1] * array_size(ary,i-1); return success; } } /* Combine all NumPy fragments into one for convenience */ %fragment("NumPy_Fragments", "header", fragment="NumPy_Backward_Compatibility", fragment="NumPy_Macros", fragment="NumPy_Utilities", fragment="NumPy_Object_to_Array", fragment="NumPy_Array_Requirements") { } /* End John Hunter translation (with modifications by Bill Spotz) */ /* %numpy_typemaps() macro * * This macro defines a family of 75 typemaps that allow C arguments * of the form * * 1. (DATA_TYPE IN_ARRAY1[ANY]) * 2. (DATA_TYPE* IN_ARRAY1, DIM_TYPE DIM1) * 3. (DIM_TYPE DIM1, DATA_TYPE* IN_ARRAY1) * * 4. (DATA_TYPE IN_ARRAY2[ANY][ANY]) * 5. (DATA_TYPE* IN_ARRAY2, DIM_TYPE DIM1, DIM_TYPE DIM2) * 6. (DIM_TYPE DIM1, DIM_TYPE DIM2, DATA_TYPE* IN_ARRAY2) * 7. (DATA_TYPE* IN_FARRAY2, DIM_TYPE DIM1, DIM_TYPE DIM2) * 8. (DIM_TYPE DIM1, DIM_TYPE DIM2, DATA_TYPE* IN_FARRAY2) * * 9. (DATA_TYPE IN_ARRAY3[ANY][ANY][ANY]) * 10. (DATA_TYPE* IN_ARRAY3, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3) * 11. (DATA_TYPE** IN_ARRAY3, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3) * 12. (DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DATA_TYPE* IN_ARRAY3) * 13. (DATA_TYPE* IN_FARRAY3, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3) * 14. (DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DATA_TYPE* IN_FARRAY3) * * 15. (DATA_TYPE IN_ARRAY4[ANY][ANY][ANY][ANY]) * 16. (DATA_TYPE* IN_ARRAY4, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DIM_TYPE DIM4) * 17. (DATA_TYPE** IN_ARRAY4, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DIM_TYPE DIM4) * 18. (DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, , DIM_TYPE DIM4, DATA_TYPE* IN_ARRAY4) * 19. (DATA_TYPE* IN_FARRAY4, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DIM_TYPE DIM4) * 20. (DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DIM_TYPE DIM4, DATA_TYPE* IN_FARRAY4) * * 21. (DATA_TYPE INPLACE_ARRAY1[ANY]) * 22. (DATA_TYPE* INPLACE_ARRAY1, DIM_TYPE DIM1) * 23. (DIM_TYPE DIM1, DATA_TYPE* INPLACE_ARRAY1) * * 24. (DATA_TYPE INPLACE_ARRAY2[ANY][ANY]) * 25. (DATA_TYPE* INPLACE_ARRAY2, DIM_TYPE DIM1, DIM_TYPE DIM2) * 26. (DIM_TYPE DIM1, DIM_TYPE DIM2, DATA_TYPE* INPLACE_ARRAY2) * 27. (DATA_TYPE* INPLACE_FARRAY2, DIM_TYPE DIM1, DIM_TYPE DIM2) * 28. (DIM_TYPE DIM1, DIM_TYPE DIM2, DATA_TYPE* INPLACE_FARRAY2) * * 29. (DATA_TYPE INPLACE_ARRAY3[ANY][ANY][ANY]) * 30. (DATA_TYPE* INPLACE_ARRAY3, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3) * 31. (DATA_TYPE** INPLACE_ARRAY3, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3) * 32. (DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DATA_TYPE* INPLACE_ARRAY3) * 33. (DATA_TYPE* INPLACE_FARRAY3, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3) * 34. (DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DATA_TYPE* INPLACE_FARRAY3) * * 35. (DATA_TYPE INPLACE_ARRAY4[ANY][ANY][ANY][ANY]) * 36. (DATA_TYPE* INPLACE_ARRAY4, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DIM_TYPE DIM4) * 37. (DATA_TYPE** INPLACE_ARRAY4, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DIM_TYPE DIM4) * 38. (DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DIM_TYPE DIM4, DATA_TYPE* INPLACE_ARRAY4) * 39. (DATA_TYPE* INPLACE_FARRAY4, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DIM_TYPE DIM4) * 40. (DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DIM_TYPE DIM4, DATA_TYPE* INPLACE_FARRAY4) * * 41. (DATA_TYPE ARGOUT_ARRAY1[ANY]) * 42. (DATA_TYPE* ARGOUT_ARRAY1, DIM_TYPE DIM1) * 43. (DIM_TYPE DIM1, DATA_TYPE* ARGOUT_ARRAY1) * * 44. (DATA_TYPE ARGOUT_ARRAY2[ANY][ANY]) * * 45. (DATA_TYPE ARGOUT_ARRAY3[ANY][ANY][ANY]) * * 46. (DATA_TYPE ARGOUT_ARRAY4[ANY][ANY][ANY][ANY]) * * 47. (DATA_TYPE** ARGOUTVIEW_ARRAY1, DIM_TYPE* DIM1) * 48. (DIM_TYPE* DIM1, DATA_TYPE** ARGOUTVIEW_ARRAY1) * * 49. (DATA_TYPE** ARGOUTVIEW_ARRAY2, DIM_TYPE* DIM1, DIM_TYPE* DIM2) * 50. (DIM_TYPE* DIM1, DIM_TYPE* DIM2, DATA_TYPE** ARGOUTVIEW_ARRAY2) * 51. (DATA_TYPE** ARGOUTVIEW_FARRAY2, DIM_TYPE* DIM1, DIM_TYPE* DIM2) * 52. (DIM_TYPE* DIM1, DIM_TYPE* DIM2, DATA_TYPE** ARGOUTVIEW_FARRAY2) * * 53. (DATA_TYPE** ARGOUTVIEW_ARRAY3, DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3) * 54. (DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3, DATA_TYPE** ARGOUTVIEW_ARRAY3) * 55. (DATA_TYPE** ARGOUTVIEW_FARRAY3, DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3) * 56. (DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3, DATA_TYPE** ARGOUTVIEW_FARRAY3) * * 57. (DATA_TYPE** ARGOUTVIEW_ARRAY4, DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3, DIM_TYPE* DIM4) * 58. (DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3, DIM_TYPE* DIM4, DATA_TYPE** ARGOUTVIEW_ARRAY4) * 59. (DATA_TYPE** ARGOUTVIEW_FARRAY4, DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3, DIM_TYPE* DIM4) * 60. (DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3, DIM_TYPE* DIM4, DATA_TYPE** ARGOUTVIEW_FARRAY4) * * 61. (DATA_TYPE** ARGOUTVIEWM_ARRAY1, DIM_TYPE* DIM1) * 62. (DIM_TYPE* DIM1, DATA_TYPE** ARGOUTVIEWM_ARRAY1) * * 63. (DATA_TYPE** ARGOUTVIEWM_ARRAY2, DIM_TYPE* DIM1, DIM_TYPE* DIM2) * 64. (DIM_TYPE* DIM1, DIM_TYPE* DIM2, DATA_TYPE** ARGOUTVIEWM_ARRAY2) * 65. (DATA_TYPE** ARGOUTVIEWM_FARRAY2, DIM_TYPE* DIM1, DIM_TYPE* DIM2) * 66. (DIM_TYPE* DIM1, DIM_TYPE* DIM2, DATA_TYPE** ARGOUTVIEWM_FARRAY2) * * 67. (DATA_TYPE** ARGOUTVIEWM_ARRAY3, DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3) * 68. (DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3, DATA_TYPE** ARGOUTVIEWM_ARRAY3) * 69. (DATA_TYPE** ARGOUTVIEWM_FARRAY3, DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3) * 70. (DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3, DATA_TYPE** ARGOUTVIEWM_FARRAY3) * * 71. (DATA_TYPE** ARGOUTVIEWM_ARRAY4, DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3, DIM_TYPE* DIM4) * 72. (DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3, DIM_TYPE* DIM4, DATA_TYPE** ARGOUTVIEWM_ARRAY4) * 73. (DATA_TYPE** ARGOUTVIEWM_FARRAY4, DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3, DIM_TYPE* DIM4) * 74. (DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3, DIM_TYPE* DIM4, DATA_TYPE** ARGOUTVIEWM_FARRAY4) * * 75. (DATA_TYPE* INPLACE_ARRAY_FLAT, DIM_TYPE DIM_FLAT) * * where "DATA_TYPE" is any type supported by the NumPy module, and * "DIM_TYPE" is any int-like type suitable for specifying dimensions. * The difference between "ARRAY" typemaps and "FARRAY" typemaps is * that the "FARRAY" typemaps expect Fortran ordering of * multidimensional arrays. In python, the dimensions will not need * to be specified (except for the "DATA_TYPE* ARGOUT_ARRAY1" * typemaps). The IN_ARRAYs can be a numpy array or any sequence that * can be converted to a numpy array of the specified type. The * INPLACE_ARRAYs must be numpy arrays of the appropriate type. The * ARGOUT_ARRAYs will be returned as new numpy arrays of the * appropriate type. * * These typemaps can be applied to existing functions using the * %apply directive. For example: * * %apply (double* IN_ARRAY1, int DIM1) {(double* series, int length)}; * double prod(double* series, int length); * * %apply (int DIM1, int DIM2, double* INPLACE_ARRAY2) * {(int rows, int cols, double* matrix )}; * void floor(int rows, int cols, double* matrix, double f); * * %apply (double IN_ARRAY3[ANY][ANY][ANY]) * {(double tensor[2][2][2] )}; * %apply (double ARGOUT_ARRAY3[ANY][ANY][ANY]) * {(double low[2][2][2] )}; * %apply (double ARGOUT_ARRAY3[ANY][ANY][ANY]) * {(double upp[2][2][2] )}; * void luSplit(double tensor[2][2][2], * double low[2][2][2], * double upp[2][2][2] ); * * or directly with * * double prod(double* IN_ARRAY1, int DIM1); * * void floor(int DIM1, int DIM2, double* INPLACE_ARRAY2, double f); * * void luSplit(double IN_ARRAY3[ANY][ANY][ANY], * double ARGOUT_ARRAY3[ANY][ANY][ANY], * double ARGOUT_ARRAY3[ANY][ANY][ANY]); */ %define %numpy_typemaps(DATA_TYPE, DATA_TYPECODE, DIM_TYPE) /************************/ /* Input Array Typemaps */ /************************/ /* Typemap suite for (DATA_TYPE IN_ARRAY1[ANY]) */ %typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY, fragment="NumPy_Macros") (DATA_TYPE IN_ARRAY1[ANY]) { $1 = is_array($input) || PySequence_Check($input); } %typemap(in, fragment="NumPy_Fragments") (DATA_TYPE IN_ARRAY1[ANY]) (PyArrayObject* array=NULL, int is_new_object=0) { npy_intp size[1] = { $1_dim0 }; array = obj_to_array_contiguous_allow_conversion($input, DATA_TYPECODE, &is_new_object); if (!array || !require_dimensions(array, 1) || !require_size(array, size, 1)) SWIG_fail; $1 = ($1_ltype) array_data(array); } %typemap(freearg) (DATA_TYPE IN_ARRAY1[ANY]) { if (is_new_object$argnum && array$argnum) { Py_DECREF(array$argnum); } } /* Typemap suite for (DATA_TYPE* IN_ARRAY1, DIM_TYPE DIM1) */ %typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY, fragment="NumPy_Macros") (DATA_TYPE* IN_ARRAY1, DIM_TYPE DIM1) { $1 = is_array($input) || PySequence_Check($input); } %typemap(in, fragment="NumPy_Fragments") (DATA_TYPE* IN_ARRAY1, DIM_TYPE DIM1) (PyArrayObject* array=NULL, int is_new_object=0) { npy_intp size[1] = { -1 }; array = obj_to_array_contiguous_allow_conversion($input, DATA_TYPECODE, &is_new_object); if (!array || !require_dimensions(array, 1) || !require_size(array, size, 1)) SWIG_fail; $1 = (DATA_TYPE*) array_data(array); $2 = (DIM_TYPE) array_size(array,0); } %typemap(freearg) (DATA_TYPE* IN_ARRAY1, DIM_TYPE DIM1) { if (is_new_object$argnum && array$argnum) { Py_DECREF(array$argnum); } } /* Typemap suite for (DIM_TYPE DIM1, DATA_TYPE* IN_ARRAY1) */ %typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY, fragment="NumPy_Macros") (DIM_TYPE DIM1, DATA_TYPE* IN_ARRAY1) { $1 = is_array($input) || PySequence_Check($input); } %typemap(in, fragment="NumPy_Fragments") (DIM_TYPE DIM1, DATA_TYPE* IN_ARRAY1) (PyArrayObject* array=NULL, int is_new_object=0) { npy_intp size[1] = {-1}; array = obj_to_array_contiguous_allow_conversion($input, DATA_TYPECODE, &is_new_object); if (!array || !require_dimensions(array, 1) || !require_size(array, size, 1)) SWIG_fail; $1 = (DIM_TYPE) array_size(array,0); $2 = (DATA_TYPE*) array_data(array); } %typemap(freearg) (DIM_TYPE DIM1, DATA_TYPE* IN_ARRAY1) { if (is_new_object$argnum && array$argnum) { Py_DECREF(array$argnum); } } /* Typemap suite for (DATA_TYPE IN_ARRAY2[ANY][ANY]) */ %typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY, fragment="NumPy_Macros") (DATA_TYPE IN_ARRAY2[ANY][ANY]) { $1 = is_array($input) || PySequence_Check($input); } %typemap(in, fragment="NumPy_Fragments") (DATA_TYPE IN_ARRAY2[ANY][ANY]) (PyArrayObject* array=NULL, int is_new_object=0) { npy_intp size[2] = { $1_dim0, $1_dim1 }; array = obj_to_array_contiguous_allow_conversion($input, DATA_TYPECODE, &is_new_object); if (!array || !require_dimensions(array, 2) || !require_size(array, size, 2)) SWIG_fail; $1 = ($1_ltype) array_data(array); } %typemap(freearg) (DATA_TYPE IN_ARRAY2[ANY][ANY]) { if (is_new_object$argnum && array$argnum) { Py_DECREF(array$argnum); } } /* Typemap suite for (DATA_TYPE* IN_ARRAY2, DIM_TYPE DIM1, DIM_TYPE DIM2) */ %typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY, fragment="NumPy_Macros") (DATA_TYPE* IN_ARRAY2, DIM_TYPE DIM1, DIM_TYPE DIM2) { $1 = is_array($input) || PySequence_Check($input); } %typemap(in, fragment="NumPy_Fragments") (DATA_TYPE* IN_ARRAY2, DIM_TYPE DIM1, DIM_TYPE DIM2) (PyArrayObject* array=NULL, int is_new_object=0) { npy_intp size[2] = { -1, -1 }; array = obj_to_array_contiguous_allow_conversion($input, DATA_TYPECODE, &is_new_object); if (!array || !require_dimensions(array, 2) || !require_size(array, size, 2)) SWIG_fail; $1 = (DATA_TYPE*) array_data(array); $2 = (DIM_TYPE) array_size(array,0); $3 = (DIM_TYPE) array_size(array,1); } %typemap(freearg) (DATA_TYPE* IN_ARRAY2, DIM_TYPE DIM1, DIM_TYPE DIM2) { if (is_new_object$argnum && array$argnum) { Py_DECREF(array$argnum); } } /* Typemap suite for (DIM_TYPE DIM1, DIM_TYPE DIM2, DATA_TYPE* IN_ARRAY2) */ %typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY, fragment="NumPy_Macros") (DIM_TYPE DIM1, DIM_TYPE DIM2, DATA_TYPE* IN_ARRAY2) { $1 = is_array($input) || PySequence_Check($input); } %typemap(in, fragment="NumPy_Fragments") (DIM_TYPE DIM1, DIM_TYPE DIM2, DATA_TYPE* IN_ARRAY2) (PyArrayObject* array=NULL, int is_new_object=0) { npy_intp size[2] = { -1, -1 }; array = obj_to_array_contiguous_allow_conversion($input, DATA_TYPECODE, &is_new_object); if (!array || !require_dimensions(array, 2) || !require_size(array, size, 2)) SWIG_fail; $1 = (DIM_TYPE) array_size(array,0); $2 = (DIM_TYPE) array_size(array,1); $3 = (DATA_TYPE*) array_data(array); } %typemap(freearg) (DIM_TYPE DIM1, DIM_TYPE DIM2, DATA_TYPE* IN_ARRAY2) { if (is_new_object$argnum && array$argnum) { Py_DECREF(array$argnum); } } /* Typemap suite for (DATA_TYPE* IN_FARRAY2, DIM_TYPE DIM1, DIM_TYPE DIM2) */ %typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY, fragment="NumPy_Macros") (DATA_TYPE* IN_FARRAY2, DIM_TYPE DIM1, DIM_TYPE DIM2) { $1 = is_array($input) || PySequence_Check($input); } %typemap(in, fragment="NumPy_Fragments") (DATA_TYPE* IN_FARRAY2, DIM_TYPE DIM1, DIM_TYPE DIM2) (PyArrayObject* array=NULL, int is_new_object=0) { npy_intp size[2] = { -1, -1 }; array = obj_to_array_fortran_allow_conversion($input, DATA_TYPECODE, &is_new_object); if (!array || !require_dimensions(array, 2) || !require_size(array, size, 2) || !require_fortran(array)) SWIG_fail; $1 = (DATA_TYPE*) array_data(array); $2 = (DIM_TYPE) array_size(array,0); $3 = (DIM_TYPE) array_size(array,1); } %typemap(freearg) (DATA_TYPE* IN_FARRAY2, DIM_TYPE DIM1, DIM_TYPE DIM2) { if (is_new_object$argnum && array$argnum) { Py_DECREF(array$argnum); } } /* Typemap suite for (DIM_TYPE DIM1, DIM_TYPE DIM2, DATA_TYPE* IN_FARRAY2) */ %typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY, fragment="NumPy_Macros") (DIM_TYPE DIM1, DIM_TYPE DIM2, DATA_TYPE* IN_FARRAY2) { $1 = is_array($input) || PySequence_Check($input); } %typemap(in, fragment="NumPy_Fragments") (DIM_TYPE DIM1, DIM_TYPE DIM2, DATA_TYPE* IN_FARRAY2) (PyArrayObject* array=NULL, int is_new_object=0) { npy_intp size[2] = { -1, -1 }; array = obj_to_array_fortran_allow_conversion($input, DATA_TYPECODE, &is_new_object); if (!array || !require_dimensions(array, 2) || !require_size(array, size, 2) || !require_fortran(array)) SWIG_fail; $1 = (DIM_TYPE) array_size(array,0); $2 = (DIM_TYPE) array_size(array,1); $3 = (DATA_TYPE*) array_data(array); } %typemap(freearg) (DIM_TYPE DIM1, DIM_TYPE DIM2, DATA_TYPE* IN_FARRAY2) { if (is_new_object$argnum && array$argnum) { Py_DECREF(array$argnum); } } /* Typemap suite for (DATA_TYPE IN_ARRAY3[ANY][ANY][ANY]) */ %typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY, fragment="NumPy_Macros") (DATA_TYPE IN_ARRAY3[ANY][ANY][ANY]) { $1 = is_array($input) || PySequence_Check($input); } %typemap(in, fragment="NumPy_Fragments") (DATA_TYPE IN_ARRAY3[ANY][ANY][ANY]) (PyArrayObject* array=NULL, int is_new_object=0) { npy_intp size[3] = { $1_dim0, $1_dim1, $1_dim2 }; array = obj_to_array_contiguous_allow_conversion($input, DATA_TYPECODE, &is_new_object); if (!array || !require_dimensions(array, 3) || !require_size(array, size, 3)) SWIG_fail; $1 = ($1_ltype) array_data(array); } %typemap(freearg) (DATA_TYPE IN_ARRAY3[ANY][ANY][ANY]) { if (is_new_object$argnum && array$argnum) { Py_DECREF(array$argnum); } } /* Typemap suite for (DATA_TYPE* IN_ARRAY3, DIM_TYPE DIM1, DIM_TYPE DIM2, * DIM_TYPE DIM3) */ %typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY, fragment="NumPy_Macros") (DATA_TYPE* IN_ARRAY3, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3) { $1 = is_array($input) || PySequence_Check($input); } %typemap(in, fragment="NumPy_Fragments") (DATA_TYPE* IN_ARRAY3, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3) (PyArrayObject* array=NULL, int is_new_object=0) { npy_intp size[3] = { -1, -1, -1 }; array = obj_to_array_contiguous_allow_conversion($input, DATA_TYPECODE, &is_new_object); if (!array || !require_dimensions(array, 3) || !require_size(array, size, 3)) SWIG_fail; $1 = (DATA_TYPE*) array_data(array); $2 = (DIM_TYPE) array_size(array,0); $3 = (DIM_TYPE) array_size(array,1); $4 = (DIM_TYPE) array_size(array,2); } %typemap(freearg) (DATA_TYPE* IN_ARRAY3, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3) { if (is_new_object$argnum && array$argnum) { Py_DECREF(array$argnum); } } /* Typemap suite for (DATA_TYPE** IN_ARRAY3, DIM_TYPE DIM1, DIM_TYPE DIM2, * DIM_TYPE DIM3) */ %typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY, fragment="NumPy_Macros") (DATA_TYPE** IN_ARRAY3, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3) { /* for now, only concerned with lists */ $1 = PySequence_Check($input); } %typemap(in, fragment="NumPy_Fragments") (DATA_TYPE** IN_ARRAY3, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3) (DATA_TYPE** array=NULL, PyArrayObject** object_array=NULL, int* is_new_object_array=NULL) { npy_intp size[2] = { -1, -1 }; PyArrayObject* temp_array; Py_ssize_t i; int is_new_object; /* length of the list */ $2 = PyList_Size($input); /* the arrays */ array = (DATA_TYPE **)malloc($2*sizeof(DATA_TYPE *)); object_array = (PyArrayObject **)calloc($2,sizeof(PyArrayObject *)); is_new_object_array = (int *)calloc($2,sizeof(int)); if (array == NULL || object_array == NULL || is_new_object_array == NULL) { SWIG_fail; } for (i=0; i<$2; i++) { temp_array = obj_to_array_contiguous_allow_conversion(PySequence_GetItem($input,i), DATA_TYPECODE, &is_new_object); /* the new array must be stored so that it can be destroyed in freearg */ object_array[i] = temp_array; is_new_object_array[i] = is_new_object; if (!temp_array || !require_dimensions(temp_array, 2)) SWIG_fail; /* store the size of the first array in the list, then use that for comparison. */ if (i == 0) { size[0] = array_size(temp_array,0); size[1] = array_size(temp_array,1); } if (!require_size(temp_array, size, 2)) SWIG_fail; array[i] = (DATA_TYPE*) array_data(temp_array); } $1 = (DATA_TYPE**) array; $3 = (DIM_TYPE) size[0]; $4 = (DIM_TYPE) size[1]; } %typemap(freearg) (DATA_TYPE** IN_ARRAY3, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3) { Py_ssize_t i; if (array$argnum!=NULL) free(array$argnum); /*freeing the individual arrays if needed */ if (object_array$argnum!=NULL) { if (is_new_object_array$argnum!=NULL) { for (i=0; i<$2; i++) { if (object_array$argnum[i] != NULL && is_new_object_array$argnum[i]) { Py_DECREF(object_array$argnum[i]); } } free(is_new_object_array$argnum); } free(object_array$argnum); } } /* Typemap suite for (DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, * DATA_TYPE* IN_ARRAY3) */ %typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY, fragment="NumPy_Macros") (DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DATA_TYPE* IN_ARRAY3) { $1 = is_array($input) || PySequence_Check($input); } %typemap(in, fragment="NumPy_Fragments") (DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DATA_TYPE* IN_ARRAY3) (PyArrayObject* array=NULL, int is_new_object=0) { npy_intp size[3] = { -1, -1, -1 }; array = obj_to_array_contiguous_allow_conversion($input, DATA_TYPECODE, &is_new_object); if (!array || !require_dimensions(array, 3) || !require_size(array, size, 3)) SWIG_fail; $1 = (DIM_TYPE) array_size(array,0); $2 = (DIM_TYPE) array_size(array,1); $3 = (DIM_TYPE) array_size(array,2); $4 = (DATA_TYPE*) array_data(array); } %typemap(freearg) (DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DATA_TYPE* IN_ARRAY3) { if (is_new_object$argnum && array$argnum) { Py_DECREF(array$argnum); } } /* Typemap suite for (DATA_TYPE* IN_FARRAY3, DIM_TYPE DIM1, DIM_TYPE DIM2, * DIM_TYPE DIM3) */ %typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY, fragment="NumPy_Macros") (DATA_TYPE* IN_FARRAY3, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3) { $1 = is_array($input) || PySequence_Check($input); } %typemap(in, fragment="NumPy_Fragments") (DATA_TYPE* IN_FARRAY3, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3) (PyArrayObject* array=NULL, int is_new_object=0) { npy_intp size[3] = { -1, -1, -1 }; array = obj_to_array_fortran_allow_conversion($input, DATA_TYPECODE, &is_new_object); if (!array || !require_dimensions(array, 3) || !require_size(array, size, 3) | !require_fortran(array)) SWIG_fail; $1 = (DATA_TYPE*) array_data(array); $2 = (DIM_TYPE) array_size(array,0); $3 = (DIM_TYPE) array_size(array,1); $4 = (DIM_TYPE) array_size(array,2); } %typemap(freearg) (DATA_TYPE* IN_FARRAY3, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3) { if (is_new_object$argnum && array$argnum) { Py_DECREF(array$argnum); } } /* Typemap suite for (DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, * DATA_TYPE* IN_FARRAY3) */ %typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY, fragment="NumPy_Macros") (DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DATA_TYPE* IN_FARRAY3) { $1 = is_array($input) || PySequence_Check($input); } %typemap(in, fragment="NumPy_Fragments") (DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DATA_TYPE* IN_FARRAY3) (PyArrayObject* array=NULL, int is_new_object=0) { npy_intp size[3] = { -1, -1, -1 }; array = obj_to_array_fortran_allow_conversion($input, DATA_TYPECODE, &is_new_object); if (!array || !require_dimensions(array, 3) || !require_size(array, size, 3) || !require_fortran(array)) SWIG_fail; $1 = (DIM_TYPE) array_size(array,0); $2 = (DIM_TYPE) array_size(array,1); $3 = (DIM_TYPE) array_size(array,2); $4 = (DATA_TYPE*) array_data(array); } %typemap(freearg) (DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DATA_TYPE* IN_FARRAY3) { if (is_new_object$argnum && array$argnum) { Py_DECREF(array$argnum); } } /* Typemap suite for (DATA_TYPE IN_ARRAY4[ANY][ANY][ANY][ANY]) */ %typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY, fragment="NumPy_Macros") (DATA_TYPE IN_ARRAY4[ANY][ANY][ANY][ANY]) { $1 = is_array($input) || PySequence_Check($input); } %typemap(in, fragment="NumPy_Fragments") (DATA_TYPE IN_ARRAY4[ANY][ANY][ANY][ANY]) (PyArrayObject* array=NULL, int is_new_object=0) { npy_intp size[4] = { $1_dim0, $1_dim1, $1_dim2 , $1_dim3}; array = obj_to_array_contiguous_allow_conversion($input, DATA_TYPECODE, &is_new_object); if (!array || !require_dimensions(array, 4) || !require_size(array, size, 4)) SWIG_fail; $1 = ($1_ltype) array_data(array); } %typemap(freearg) (DATA_TYPE IN_ARRAY4[ANY][ANY][ANY][ANY]) { if (is_new_object$argnum && array$argnum) { Py_DECREF(array$argnum); } } /* Typemap suite for (DATA_TYPE* IN_ARRAY4, DIM_TYPE DIM1, DIM_TYPE DIM2, * DIM_TYPE DIM3, DIM_TYPE DIM4) */ %typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY, fragment="NumPy_Macros") (DATA_TYPE* IN_ARRAY4, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DIM_TYPE DIM4) { $1 = is_array($input) || PySequence_Check($input); } %typemap(in, fragment="NumPy_Fragments") (DATA_TYPE* IN_ARRAY4, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DIM_TYPE DIM4) (PyArrayObject* array=NULL, int is_new_object=0) { npy_intp size[4] = { -1, -1, -1, -1 }; array = obj_to_array_contiguous_allow_conversion($input, DATA_TYPECODE, &is_new_object); if (!array || !require_dimensions(array, 4) || !require_size(array, size, 4)) SWIG_fail; $1 = (DATA_TYPE*) array_data(array); $2 = (DIM_TYPE) array_size(array,0); $3 = (DIM_TYPE) array_size(array,1); $4 = (DIM_TYPE) array_size(array,2); $5 = (DIM_TYPE) array_size(array,3); } %typemap(freearg) (DATA_TYPE* IN_ARRAY4, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DIM_TYPE DIM4) { if (is_new_object$argnum && array$argnum) { Py_DECREF(array$argnum); } } /* Typemap suite for (DATA_TYPE** IN_ARRAY4, DIM_TYPE DIM1, DIM_TYPE DIM2, * DIM_TYPE DIM3, DIM_TYPE DIM4) */ %typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY, fragment="NumPy_Macros") (DATA_TYPE** IN_ARRAY4, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DIM_TYPE DIM4) { /* for now, only concerned with lists */ $1 = PySequence_Check($input); } %typemap(in, fragment="NumPy_Fragments") (DATA_TYPE** IN_ARRAY4, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DIM_TYPE DIM4) (DATA_TYPE** array=NULL, PyArrayObject** object_array=NULL, int* is_new_object_array=NULL) { npy_intp size[3] = { -1, -1, -1 }; PyArrayObject* temp_array; Py_ssize_t i; int is_new_object; /* length of the list */ $2 = PyList_Size($input); /* the arrays */ array = (DATA_TYPE **)malloc($2*sizeof(DATA_TYPE *)); object_array = (PyArrayObject **)calloc($2,sizeof(PyArrayObject *)); is_new_object_array = (int *)calloc($2,sizeof(int)); if (array == NULL || object_array == NULL || is_new_object_array == NULL) { SWIG_fail; } for (i=0; i<$2; i++) { temp_array = obj_to_array_contiguous_allow_conversion(PySequence_GetItem($input,i), DATA_TYPECODE, &is_new_object); /* the new array must be stored so that it can be destroyed in freearg */ object_array[i] = temp_array; is_new_object_array[i] = is_new_object; if (!temp_array || !require_dimensions(temp_array, 3)) SWIG_fail; /* store the size of the first array in the list, then use that for comparison. */ if (i == 0) { size[0] = array_size(temp_array,0); size[1] = array_size(temp_array,1); size[2] = array_size(temp_array,2); } if (!require_size(temp_array, size, 3)) SWIG_fail; array[i] = (DATA_TYPE*) array_data(temp_array); } $1 = (DATA_TYPE**) array; $3 = (DIM_TYPE) size[0]; $4 = (DIM_TYPE) size[1]; $5 = (DIM_TYPE) size[2]; } %typemap(freearg) (DATA_TYPE** IN_ARRAY4, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DIM_TYPE DIM4) { Py_ssize_t i; if (array$argnum!=NULL) free(array$argnum); /*freeing the individual arrays if needed */ if (object_array$argnum!=NULL) { if (is_new_object_array$argnum!=NULL) { for (i=0; i<$2; i++) { if (object_array$argnum[i] != NULL && is_new_object_array$argnum[i]) { Py_DECREF(object_array$argnum[i]); } } free(is_new_object_array$argnum); } free(object_array$argnum); } } /* Typemap suite for (DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DIM_TYPE DIM4, * DATA_TYPE* IN_ARRAY4) */ %typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY, fragment="NumPy_Macros") (DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DIM_TYPE DIM4, DATA_TYPE* IN_ARRAY4) { $1 = is_array($input) || PySequence_Check($input); } %typemap(in, fragment="NumPy_Fragments") (DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DIM_TYPE DIM4, DATA_TYPE* IN_ARRAY4) (PyArrayObject* array=NULL, int is_new_object=0) { npy_intp size[4] = { -1, -1, -1 , -1}; array = obj_to_array_contiguous_allow_conversion($input, DATA_TYPECODE, &is_new_object); if (!array || !require_dimensions(array, 4) || !require_size(array, size, 4)) SWIG_fail; $1 = (DIM_TYPE) array_size(array,0); $2 = (DIM_TYPE) array_size(array,1); $3 = (DIM_TYPE) array_size(array,2); $4 = (DIM_TYPE) array_size(array,3); $5 = (DATA_TYPE*) array_data(array); } %typemap(freearg) (DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DIM_TYPE DIM4, DATA_TYPE* IN_ARRAY4) { if (is_new_object$argnum && array$argnum) { Py_DECREF(array$argnum); } } /* Typemap suite for (DATA_TYPE* IN_FARRAY4, DIM_TYPE DIM1, DIM_TYPE DIM2, * DIM_TYPE DIM3, DIM_TYPE DIM4) */ %typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY, fragment="NumPy_Macros") (DATA_TYPE* IN_FARRAY4, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DIM_TYPE DIM4) { $1 = is_array($input) || PySequence_Check($input); } %typemap(in, fragment="NumPy_Fragments") (DATA_TYPE* IN_FARRAY4, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DIM_TYPE DIM4) (PyArrayObject* array=NULL, int is_new_object=0) { npy_intp size[4] = { -1, -1, -1, -1 }; array = obj_to_array_fortran_allow_conversion($input, DATA_TYPECODE, &is_new_object); if (!array || !require_dimensions(array, 4) || !require_size(array, size, 4) | !require_fortran(array)) SWIG_fail; $1 = (DATA_TYPE*) array_data(array); $2 = (DIM_TYPE) array_size(array,0); $3 = (DIM_TYPE) array_size(array,1); $4 = (DIM_TYPE) array_size(array,2); $5 = (DIM_TYPE) array_size(array,3); } %typemap(freearg) (DATA_TYPE* IN_FARRAY4, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DIM_TYPE DIM4) { if (is_new_object$argnum && array$argnum) { Py_DECREF(array$argnum); } } /* Typemap suite for (DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DIM_TYPE DIM4, * DATA_TYPE* IN_FARRAY4) */ %typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY, fragment="NumPy_Macros") (DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DIM_TYPE DIM4, DATA_TYPE* IN_FARRAY4) { $1 = is_array($input) || PySequence_Check($input); } %typemap(in, fragment="NumPy_Fragments") (DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DIM_TYPE DIM4, DATA_TYPE* IN_FARRAY4) (PyArrayObject* array=NULL, int is_new_object=0) { npy_intp size[4] = { -1, -1, -1 , -1 }; array = obj_to_array_fortran_allow_conversion($input, DATA_TYPECODE, &is_new_object); if (!array || !require_dimensions(array, 4) || !require_size(array, size, 4) || !require_fortran(array)) SWIG_fail; $1 = (DIM_TYPE) array_size(array,0); $2 = (DIM_TYPE) array_size(array,1); $3 = (DIM_TYPE) array_size(array,2); $4 = (DIM_TYPE) array_size(array,3); $5 = (DATA_TYPE*) array_data(array); } %typemap(freearg) (DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DIM_TYPE DIM4, DATA_TYPE* IN_FARRAY4) { if (is_new_object$argnum && array$argnum) { Py_DECREF(array$argnum); } } /***************************/ /* In-Place Array Typemaps */ /***************************/ /* Typemap suite for (DATA_TYPE INPLACE_ARRAY1[ANY]) */ %typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY, fragment="NumPy_Macros") (DATA_TYPE INPLACE_ARRAY1[ANY]) { $1 = is_array($input) && PyArray_EquivTypenums(array_type($input), DATA_TYPECODE); } %typemap(in, fragment="NumPy_Fragments") (DATA_TYPE INPLACE_ARRAY1[ANY]) (PyArrayObject* array=NULL) { npy_intp size[1] = { $1_dim0 }; array = obj_to_array_no_conversion($input, DATA_TYPECODE); if (!array || !require_dimensions(array,1) || !require_size(array, size, 1) || !require_contiguous(array) || !require_native(array)) SWIG_fail; $1 = ($1_ltype) array_data(array); } /* Typemap suite for (DATA_TYPE* INPLACE_ARRAY1, DIM_TYPE DIM1) */ %typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY, fragment="NumPy_Macros") (DATA_TYPE* INPLACE_ARRAY1, DIM_TYPE DIM1) { $1 = is_array($input) && PyArray_EquivTypenums(array_type($input), DATA_TYPECODE); } %typemap(in, fragment="NumPy_Fragments") (DATA_TYPE* INPLACE_ARRAY1, DIM_TYPE DIM1) (PyArrayObject* array=NULL, int i=1) { array = obj_to_array_no_conversion($input, DATA_TYPECODE); if (!array || !require_dimensions(array,1) || !require_contiguous(array) || !require_native(array)) SWIG_fail; $1 = (DATA_TYPE*) array_data(array); $2 = 1; for (i=0; i < array_numdims(array); ++i) $2 *= array_size(array,i); } /* Typemap suite for (DIM_TYPE DIM1, DATA_TYPE* INPLACE_ARRAY1) */ %typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY, fragment="NumPy_Macros") (DIM_TYPE DIM1, DATA_TYPE* INPLACE_ARRAY1) { $1 = is_array($input) && PyArray_EquivTypenums(array_type($input), DATA_TYPECODE); } %typemap(in, fragment="NumPy_Fragments") (DIM_TYPE DIM1, DATA_TYPE* INPLACE_ARRAY1) (PyArrayObject* array=NULL, int i=0) { array = obj_to_array_no_conversion($input, DATA_TYPECODE); if (!array || !require_dimensions(array,1) || !require_contiguous(array) || !require_native(array)) SWIG_fail; $1 = 1; for (i=0; i < array_numdims(array); ++i) $1 *= array_size(array,i); $2 = (DATA_TYPE*) array_data(array); } /* Typemap suite for (DATA_TYPE INPLACE_ARRAY2[ANY][ANY]) */ %typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY, fragment="NumPy_Macros") (DATA_TYPE INPLACE_ARRAY2[ANY][ANY]) { $1 = is_array($input) && PyArray_EquivTypenums(array_type($input), DATA_TYPECODE); } %typemap(in, fragment="NumPy_Fragments") (DATA_TYPE INPLACE_ARRAY2[ANY][ANY]) (PyArrayObject* array=NULL) { npy_intp size[2] = { $1_dim0, $1_dim1 }; array = obj_to_array_no_conversion($input, DATA_TYPECODE); if (!array || !require_dimensions(array,2) || !require_size(array, size, 2) || !require_contiguous(array) || !require_native(array)) SWIG_fail; $1 = ($1_ltype) array_data(array); } /* Typemap suite for (DATA_TYPE* INPLACE_ARRAY2, DIM_TYPE DIM1, DIM_TYPE DIM2) */ %typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY, fragment="NumPy_Macros") (DATA_TYPE* INPLACE_ARRAY2, DIM_TYPE DIM1, DIM_TYPE DIM2) { $1 = is_array($input) && PyArray_EquivTypenums(array_type($input), DATA_TYPECODE); } %typemap(in, fragment="NumPy_Fragments") (DATA_TYPE* INPLACE_ARRAY2, DIM_TYPE DIM1, DIM_TYPE DIM2) (PyArrayObject* array=NULL) { array = obj_to_array_no_conversion($input, DATA_TYPECODE); if (!array || !require_dimensions(array,2) || !require_contiguous(array) || !require_native(array)) SWIG_fail; $1 = (DATA_TYPE*) array_data(array); $2 = (DIM_TYPE) array_size(array,0); $3 = (DIM_TYPE) array_size(array,1); } /* Typemap suite for (DIM_TYPE DIM1, DIM_TYPE DIM2, DATA_TYPE* INPLACE_ARRAY2) */ %typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY, fragment="NumPy_Macros") (DIM_TYPE DIM1, DIM_TYPE DIM2, DATA_TYPE* INPLACE_ARRAY2) { $1 = is_array($input) && PyArray_EquivTypenums(array_type($input), DATA_TYPECODE); } %typemap(in, fragment="NumPy_Fragments") (DIM_TYPE DIM1, DIM_TYPE DIM2, DATA_TYPE* INPLACE_ARRAY2) (PyArrayObject* array=NULL) { array = obj_to_array_no_conversion($input, DATA_TYPECODE); if (!array || !require_dimensions(array,2) || !require_contiguous(array) || !require_native(array)) SWIG_fail; $1 = (DIM_TYPE) array_size(array,0); $2 = (DIM_TYPE) array_size(array,1); $3 = (DATA_TYPE*) array_data(array); } /* Typemap suite for (DATA_TYPE* INPLACE_FARRAY2, DIM_TYPE DIM1, DIM_TYPE DIM2) */ %typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY, fragment="NumPy_Macros") (DATA_TYPE* INPLACE_FARRAY2, DIM_TYPE DIM1, DIM_TYPE DIM2) { $1 = is_array($input) && PyArray_EquivTypenums(array_type($input), DATA_TYPECODE); } %typemap(in, fragment="NumPy_Fragments") (DATA_TYPE* INPLACE_FARRAY2, DIM_TYPE DIM1, DIM_TYPE DIM2) (PyArrayObject* array=NULL) { array = obj_to_array_no_conversion($input, DATA_TYPECODE); if (!array || !require_dimensions(array,2) || !require_contiguous(array) || !require_native(array) || !require_fortran(array)) SWIG_fail; $1 = (DATA_TYPE*) array_data(array); $2 = (DIM_TYPE) array_size(array,0); $3 = (DIM_TYPE) array_size(array,1); } /* Typemap suite for (DIM_TYPE DIM1, DIM_TYPE DIM2, DATA_TYPE* INPLACE_FARRAY2) */ %typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY, fragment="NumPy_Macros") (DIM_TYPE DIM1, DIM_TYPE DIM2, DATA_TYPE* INPLACE_FARRAY2) { $1 = is_array($input) && PyArray_EquivTypenums(array_type($input), DATA_TYPECODE); } %typemap(in, fragment="NumPy_Fragments") (DIM_TYPE DIM1, DIM_TYPE DIM2, DATA_TYPE* INPLACE_FARRAY2) (PyArrayObject* array=NULL) { array = obj_to_array_no_conversion($input, DATA_TYPECODE); if (!array || !require_dimensions(array,2) || !require_contiguous(array) || !require_native(array) || !require_fortran(array)) SWIG_fail; $1 = (DIM_TYPE) array_size(array,0); $2 = (DIM_TYPE) array_size(array,1); $3 = (DATA_TYPE*) array_data(array); } /* Typemap suite for (DATA_TYPE INPLACE_ARRAY3[ANY][ANY][ANY]) */ %typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY, fragment="NumPy_Macros") (DATA_TYPE INPLACE_ARRAY3[ANY][ANY][ANY]) { $1 = is_array($input) && PyArray_EquivTypenums(array_type($input), DATA_TYPECODE); } %typemap(in, fragment="NumPy_Fragments") (DATA_TYPE INPLACE_ARRAY3[ANY][ANY][ANY]) (PyArrayObject* array=NULL) { npy_intp size[3] = { $1_dim0, $1_dim1, $1_dim2 }; array = obj_to_array_no_conversion($input, DATA_TYPECODE); if (!array || !require_dimensions(array,3) || !require_size(array, size, 3) || !require_contiguous(array) || !require_native(array)) SWIG_fail; $1 = ($1_ltype) array_data(array); } /* Typemap suite for (DATA_TYPE* INPLACE_ARRAY3, DIM_TYPE DIM1, DIM_TYPE DIM2, * DIM_TYPE DIM3) */ %typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY, fragment="NumPy_Macros") (DATA_TYPE* INPLACE_ARRAY3, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3) { $1 = is_array($input) && PyArray_EquivTypenums(array_type($input), DATA_TYPECODE); } %typemap(in, fragment="NumPy_Fragments") (DATA_TYPE* INPLACE_ARRAY3, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3) (PyArrayObject* array=NULL) { array = obj_to_array_no_conversion($input, DATA_TYPECODE); if (!array || !require_dimensions(array,3) || !require_contiguous(array) || !require_native(array)) SWIG_fail; $1 = (DATA_TYPE*) array_data(array); $2 = (DIM_TYPE) array_size(array,0); $3 = (DIM_TYPE) array_size(array,1); $4 = (DIM_TYPE) array_size(array,2); } /* Typemap suite for (DATA_TYPE** INPLACE_ARRAY3, DIM_TYPE DIM1, DIM_TYPE DIM2, * DIM_TYPE DIM3) */ %typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY, fragment="NumPy_Macros") (DATA_TYPE** INPLACE_ARRAY3, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3) { $1 = PySequence_Check($input); } %typemap(in, fragment="NumPy_Fragments") (DATA_TYPE** INPLACE_ARRAY3, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3) (DATA_TYPE** array=NULL, PyArrayObject** object_array=NULL) { npy_intp size[2] = { -1, -1 }; PyArrayObject* temp_array; Py_ssize_t i; /* length of the list */ $2 = PyList_Size($input); /* the arrays */ array = (DATA_TYPE **)malloc($2*sizeof(DATA_TYPE *)); object_array = (PyArrayObject **)calloc($2,sizeof(PyArrayObject *)); if (array == NULL || object_array == NULL) { SWIG_fail; } for (i=0; i<$2; i++) { temp_array = obj_to_array_no_conversion(PySequence_GetItem($input,i), DATA_TYPECODE); /* the new array must be stored so that it can be destroyed in freearg */ object_array[i] = temp_array; if ( !temp_array || !require_dimensions(temp_array, 2) || !require_contiguous(temp_array) || !require_native(temp_array) || !PyArray_EquivTypenums(array_type(temp_array), DATA_TYPECODE) ) SWIG_fail; /* store the size of the first array in the list, then use that for comparison. */ if (i == 0) { size[0] = array_size(temp_array,0); size[1] = array_size(temp_array,1); } if (!require_size(temp_array, size, 2)) SWIG_fail; array[i] = (DATA_TYPE*) array_data(temp_array); } $1 = (DATA_TYPE**) array; $3 = (DIM_TYPE) size[0]; $4 = (DIM_TYPE) size[1]; } %typemap(freearg) (DATA_TYPE** INPLACE_ARRAY3, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3) { if (array$argnum!=NULL) free(array$argnum); if (object_array$argnum!=NULL) free(object_array$argnum); } /* Typemap suite for (DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, * DATA_TYPE* INPLACE_ARRAY3) */ %typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY, fragment="NumPy_Macros") (DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DATA_TYPE* INPLACE_ARRAY3) { $1 = is_array($input) && PyArray_EquivTypenums(array_type($input), DATA_TYPECODE); } %typemap(in, fragment="NumPy_Fragments") (DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DATA_TYPE* INPLACE_ARRAY3) (PyArrayObject* array=NULL) { array = obj_to_array_no_conversion($input, DATA_TYPECODE); if (!array || !require_dimensions(array,3) || !require_contiguous(array) || !require_native(array)) SWIG_fail; $1 = (DIM_TYPE) array_size(array,0); $2 = (DIM_TYPE) array_size(array,1); $3 = (DIM_TYPE) array_size(array,2); $4 = (DATA_TYPE*) array_data(array); } /* Typemap suite for (DATA_TYPE* INPLACE_FARRAY3, DIM_TYPE DIM1, DIM_TYPE DIM2, * DIM_TYPE DIM3) */ %typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY, fragment="NumPy_Macros") (DATA_TYPE* INPLACE_FARRAY3, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3) { $1 = is_array($input) && PyArray_EquivTypenums(array_type($input), DATA_TYPECODE); } %typemap(in, fragment="NumPy_Fragments") (DATA_TYPE* INPLACE_FARRAY3, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3) (PyArrayObject* array=NULL) { array = obj_to_array_no_conversion($input, DATA_TYPECODE); if (!array || !require_dimensions(array,3) || !require_contiguous(array) || !require_native(array) || !require_fortran(array)) SWIG_fail; $1 = (DATA_TYPE*) array_data(array); $2 = (DIM_TYPE) array_size(array,0); $3 = (DIM_TYPE) array_size(array,1); $4 = (DIM_TYPE) array_size(array,2); } /* Typemap suite for (DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, * DATA_TYPE* INPLACE_FARRAY3) */ %typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY, fragment="NumPy_Macros") (DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DATA_TYPE* INPLACE_FARRAY3) { $1 = is_array($input) && PyArray_EquivTypenums(array_type($input), DATA_TYPECODE); } %typemap(in, fragment="NumPy_Fragments") (DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DATA_TYPE* INPLACE_FARRAY3) (PyArrayObject* array=NULL) { array = obj_to_array_no_conversion($input, DATA_TYPECODE); if (!array || !require_dimensions(array,3) || !require_contiguous(array) || !require_native(array) || !require_fortran(array)) SWIG_fail; $1 = (DIM_TYPE) array_size(array,0); $2 = (DIM_TYPE) array_size(array,1); $3 = (DIM_TYPE) array_size(array,2); $4 = (DATA_TYPE*) array_data(array); } /* Typemap suite for (DATA_TYPE INPLACE_ARRAY4[ANY][ANY][ANY][ANY]) */ %typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY, fragment="NumPy_Macros") (DATA_TYPE INPLACE_ARRAY4[ANY][ANY][ANY][ANY]) { $1 = is_array($input) && PyArray_EquivTypenums(array_type($input), DATA_TYPECODE); } %typemap(in, fragment="NumPy_Fragments") (DATA_TYPE INPLACE_ARRAY4[ANY][ANY][ANY][ANY]) (PyArrayObject* array=NULL) { npy_intp size[4] = { $1_dim0, $1_dim1, $1_dim2 , $1_dim3 }; array = obj_to_array_no_conversion($input, DATA_TYPECODE); if (!array || !require_dimensions(array,4) || !require_size(array, size, 4) || !require_contiguous(array) || !require_native(array)) SWIG_fail; $1 = ($1_ltype) array_data(array); } /* Typemap suite for (DATA_TYPE* INPLACE_ARRAY4, DIM_TYPE DIM1, DIM_TYPE DIM2, * DIM_TYPE DIM3, DIM_TYPE DIM4) */ %typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY, fragment="NumPy_Macros") (DATA_TYPE* INPLACE_ARRAY4, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DIM_TYPE DIM4) { $1 = is_array($input) && PyArray_EquivTypenums(array_type($input), DATA_TYPECODE); } %typemap(in, fragment="NumPy_Fragments") (DATA_TYPE* INPLACE_ARRAY4, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DIM_TYPE DIM4) (PyArrayObject* array=NULL) { array = obj_to_array_no_conversion($input, DATA_TYPECODE); if (!array || !require_dimensions(array,4) || !require_contiguous(array) || !require_native(array)) SWIG_fail; $1 = (DATA_TYPE*) array_data(array); $2 = (DIM_TYPE) array_size(array,0); $3 = (DIM_TYPE) array_size(array,1); $4 = (DIM_TYPE) array_size(array,2); $5 = (DIM_TYPE) array_size(array,3); } /* Typemap suite for (DATA_TYPE** INPLACE_ARRAY4, DIM_TYPE DIM1, DIM_TYPE DIM2, * DIM_TYPE DIM3, DIM_TYPE DIM4) */ %typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY, fragment="NumPy_Macros") (DATA_TYPE** INPLACE_ARRAY4, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DIM_TYPE DIM4) { $1 = PySequence_Check($input); } %typemap(in, fragment="NumPy_Fragments") (DATA_TYPE** INPLACE_ARRAY4, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DIM_TYPE DIM4) (DATA_TYPE** array=NULL, PyArrayObject** object_array=NULL) { npy_intp size[3] = { -1, -1, -1 }; PyArrayObject* temp_array; Py_ssize_t i; /* length of the list */ $2 = PyList_Size($input); /* the arrays */ array = (DATA_TYPE **)malloc($2*sizeof(DATA_TYPE *)); object_array = (PyArrayObject **)calloc($2,sizeof(PyArrayObject *)); if (array == NULL || object_array == NULL) { SWIG_fail; } for (i=0; i<$2; i++) { temp_array = obj_to_array_no_conversion(PySequence_GetItem($input,i), DATA_TYPECODE); /* the new array must be stored so that it can be destroyed in freearg */ object_array[i] = temp_array; if ( !temp_array || !require_dimensions(temp_array, 3) || !require_contiguous(temp_array) || !require_native(temp_array) || !PyArray_EquivTypenums(array_type(temp_array), DATA_TYPECODE) ) SWIG_fail; /* store the size of the first array in the list, then use that for comparison. */ if (i == 0) { size[0] = array_size(temp_array,0); size[1] = array_size(temp_array,1); size[2] = array_size(temp_array,2); } if (!require_size(temp_array, size, 3)) SWIG_fail; array[i] = (DATA_TYPE*) array_data(temp_array); } $1 = (DATA_TYPE**) array; $3 = (DIM_TYPE) size[0]; $4 = (DIM_TYPE) size[1]; $5 = (DIM_TYPE) size[2]; } %typemap(freearg) (DATA_TYPE** INPLACE_ARRAY4, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DIM_TYPE DIM4) { if (array$argnum!=NULL) free(array$argnum); if (object_array$argnum!=NULL) free(object_array$argnum); } /* Typemap suite for (DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DIM_TYPE DIM4, * DATA_TYPE* INPLACE_ARRAY4) */ %typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY, fragment="NumPy_Macros") (DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DIM_TYPE DIM4, DATA_TYPE* INPLACE_ARRAY4) { $1 = is_array($input) && PyArray_EquivTypenums(array_type($input), DATA_TYPECODE); } %typemap(in, fragment="NumPy_Fragments") (DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DIM_TYPE DIM4, DATA_TYPE* INPLACE_ARRAY4) (PyArrayObject* array=NULL) { array = obj_to_array_no_conversion($input, DATA_TYPECODE); if (!array || !require_dimensions(array,4) || !require_contiguous(array) || !require_native(array)) SWIG_fail; $1 = (DIM_TYPE) array_size(array,0); $2 = (DIM_TYPE) array_size(array,1); $3 = (DIM_TYPE) array_size(array,2); $4 = (DIM_TYPE) array_size(array,3); $5 = (DATA_TYPE*) array_data(array); } /* Typemap suite for (DATA_TYPE* INPLACE_FARRAY4, DIM_TYPE DIM1, DIM_TYPE DIM2, * DIM_TYPE DIM3, DIM_TYPE DIM4) */ %typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY, fragment="NumPy_Macros") (DATA_TYPE* INPLACE_FARRAY4, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DIM_TYPE DIM4) { $1 = is_array($input) && PyArray_EquivTypenums(array_type($input), DATA_TYPECODE); } %typemap(in, fragment="NumPy_Fragments") (DATA_TYPE* INPLACE_FARRAY4, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DIM_TYPE DIM4) (PyArrayObject* array=NULL) { array = obj_to_array_no_conversion($input, DATA_TYPECODE); if (!array || !require_dimensions(array,4) || !require_contiguous(array) || !require_native(array) || !require_fortran(array)) SWIG_fail; $1 = (DATA_TYPE*) array_data(array); $2 = (DIM_TYPE) array_size(array,0); $3 = (DIM_TYPE) array_size(array,1); $4 = (DIM_TYPE) array_size(array,2); $5 = (DIM_TYPE) array_size(array,3); } /* Typemap suite for (DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, * DATA_TYPE* INPLACE_FARRAY4) */ %typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY, fragment="NumPy_Macros") (DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DIM_TYPE DIM4, DATA_TYPE* INPLACE_FARRAY4) { $1 = is_array($input) && PyArray_EquivTypenums(array_type($input), DATA_TYPECODE); } %typemap(in, fragment="NumPy_Fragments") (DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DIM_TYPE DIM4, DATA_TYPE* INPLACE_FARRAY4) (PyArrayObject* array=NULL) { array = obj_to_array_no_conversion($input, DATA_TYPECODE); if (!array || !require_dimensions(array,4) || !require_contiguous(array) || !require_native(array) || !require_fortran(array)) SWIG_fail; $1 = (DIM_TYPE) array_size(array,0); $2 = (DIM_TYPE) array_size(array,1); $3 = (DIM_TYPE) array_size(array,2); $4 = (DIM_TYPE) array_size(array,3); $5 = (DATA_TYPE*) array_data(array); } /*************************/ /* Argout Array Typemaps */ /*************************/ /* Typemap suite for (DATA_TYPE ARGOUT_ARRAY1[ANY]) */ %typemap(in,numinputs=0, fragment="NumPy_Backward_Compatibility,NumPy_Macros") (DATA_TYPE ARGOUT_ARRAY1[ANY]) (PyObject* array = NULL) { npy_intp dims[1] = { $1_dim0 }; array = PyArray_SimpleNew(1, dims, DATA_TYPECODE); if (!array) SWIG_fail; $1 = ($1_ltype) array_data(array); } %typemap(argout) (DATA_TYPE ARGOUT_ARRAY1[ANY]) { $result = SWIG_Python_AppendOutput($result,(PyObject*)array$argnum); } /* Typemap suite for (DATA_TYPE* ARGOUT_ARRAY1, DIM_TYPE DIM1) */ %typemap(in,numinputs=1, fragment="NumPy_Fragments") (DATA_TYPE* ARGOUT_ARRAY1, DIM_TYPE DIM1) (PyObject* array = NULL) { npy_intp dims[1]; if (!PyInt_Check($input)) { const char* typestring = pytype_string($input); PyErr_Format(PyExc_TypeError, "Int dimension expected. '%s' given.", typestring); SWIG_fail; } $2 = (DIM_TYPE) PyInt_AsLong($input); dims[0] = (npy_intp) $2; array = PyArray_SimpleNew(1, dims, DATA_TYPECODE); if (!array) SWIG_fail; $1 = (DATA_TYPE*) array_data(array); } %typemap(argout) (DATA_TYPE* ARGOUT_ARRAY1, DIM_TYPE DIM1) { $result = SWIG_Python_AppendOutput($result,(PyObject*)array$argnum); } /* Typemap suite for (DIM_TYPE DIM1, DATA_TYPE* ARGOUT_ARRAY1) */ %typemap(in,numinputs=1, fragment="NumPy_Fragments") (DIM_TYPE DIM1, DATA_TYPE* ARGOUT_ARRAY1) (PyObject* array = NULL) { npy_intp dims[1]; if (!PyInt_Check($input)) { const char* typestring = pytype_string($input); PyErr_Format(PyExc_TypeError, "Int dimension expected. '%s' given.", typestring); SWIG_fail; } $1 = (DIM_TYPE) PyInt_AsLong($input); dims[0] = (npy_intp) $1; array = PyArray_SimpleNew(1, dims, DATA_TYPECODE); if (!array) SWIG_fail; $2 = (DATA_TYPE*) array_data(array); } %typemap(argout) (DIM_TYPE DIM1, DATA_TYPE* ARGOUT_ARRAY1) { $result = SWIG_Python_AppendOutput($result,(PyObject*)array$argnum); } /* Typemap suite for (DATA_TYPE ARGOUT_ARRAY2[ANY][ANY]) */ %typemap(in,numinputs=0, fragment="NumPy_Backward_Compatibility,NumPy_Macros") (DATA_TYPE ARGOUT_ARRAY2[ANY][ANY]) (PyObject* array = NULL) { npy_intp dims[2] = { $1_dim0, $1_dim1 }; array = PyArray_SimpleNew(2, dims, DATA_TYPECODE); if (!array) SWIG_fail; $1 = ($1_ltype) array_data(array); } %typemap(argout) (DATA_TYPE ARGOUT_ARRAY2[ANY][ANY]) { $result = SWIG_Python_AppendOutput($result,(PyObject*)array$argnum); } /* Typemap suite for (DATA_TYPE ARGOUT_ARRAY3[ANY][ANY][ANY]) */ %typemap(in,numinputs=0, fragment="NumPy_Backward_Compatibility,NumPy_Macros") (DATA_TYPE ARGOUT_ARRAY3[ANY][ANY][ANY]) (PyObject* array = NULL) { npy_intp dims[3] = { $1_dim0, $1_dim1, $1_dim2 }; array = PyArray_SimpleNew(3, dims, DATA_TYPECODE); if (!array) SWIG_fail; $1 = ($1_ltype) array_data(array); } %typemap(argout) (DATA_TYPE ARGOUT_ARRAY3[ANY][ANY][ANY]) { $result = SWIG_Python_AppendOutput($result,(PyObject*)array$argnum); } /* Typemap suite for (DATA_TYPE ARGOUT_ARRAY4[ANY][ANY][ANY][ANY]) */ %typemap(in,numinputs=0, fragment="NumPy_Backward_Compatibility,NumPy_Macros") (DATA_TYPE ARGOUT_ARRAY4[ANY][ANY][ANY][ANY]) (PyObject* array = NULL) { npy_intp dims[4] = { $1_dim0, $1_dim1, $1_dim2, $1_dim3 }; array = PyArray_SimpleNew(4, dims, DATA_TYPECODE); if (!array) SWIG_fail; $1 = ($1_ltype) array_data(array); } %typemap(argout) (DATA_TYPE ARGOUT_ARRAY4[ANY][ANY][ANY][ANY]) { $result = SWIG_Python_AppendOutput($result,(PyObject*)array$argnum); } /*****************************/ /* Argoutview Array Typemaps */ /*****************************/ /* Typemap suite for (DATA_TYPE** ARGOUTVIEW_ARRAY1, DIM_TYPE* DIM1) */ %typemap(in,numinputs=0) (DATA_TYPE** ARGOUTVIEW_ARRAY1, DIM_TYPE* DIM1 ) (DATA_TYPE* data_temp = NULL , DIM_TYPE dim_temp) { $1 = &data_temp; $2 = &dim_temp; } %typemap(argout, fragment="NumPy_Backward_Compatibility") (DATA_TYPE** ARGOUTVIEW_ARRAY1, DIM_TYPE* DIM1) { npy_intp dims[1] = { *$2 }; PyObject* obj = PyArray_SimpleNewFromData(1, dims, DATA_TYPECODE, (void*)(*$1)); PyArrayObject* array = (PyArrayObject*) obj; if (!array) SWIG_fail; $result = SWIG_Python_AppendOutput($result,obj); } /* Typemap suite for (DIM_TYPE* DIM1, DATA_TYPE** ARGOUTVIEW_ARRAY1) */ %typemap(in,numinputs=0) (DIM_TYPE* DIM1 , DATA_TYPE** ARGOUTVIEW_ARRAY1) (DIM_TYPE dim_temp, DATA_TYPE* data_temp = NULL ) { $1 = &dim_temp; $2 = &data_temp; } %typemap(argout, fragment="NumPy_Backward_Compatibility") (DIM_TYPE* DIM1, DATA_TYPE** ARGOUTVIEW_ARRAY1) { npy_intp dims[1] = { *$1 }; PyObject* obj = PyArray_SimpleNewFromData(1, dims, DATA_TYPECODE, (void*)(*$2)); PyArrayObject* array = (PyArrayObject*) obj; if (!array) SWIG_fail; $result = SWIG_Python_AppendOutput($result,obj); } /* Typemap suite for (DATA_TYPE** ARGOUTVIEW_ARRAY2, DIM_TYPE* DIM1, DIM_TYPE* DIM2) */ %typemap(in,numinputs=0) (DATA_TYPE** ARGOUTVIEW_ARRAY2, DIM_TYPE* DIM1 , DIM_TYPE* DIM2 ) (DATA_TYPE* data_temp = NULL , DIM_TYPE dim1_temp, DIM_TYPE dim2_temp) { $1 = &data_temp; $2 = &dim1_temp; $3 = &dim2_temp; } %typemap(argout, fragment="NumPy_Backward_Compatibility") (DATA_TYPE** ARGOUTVIEW_ARRAY2, DIM_TYPE* DIM1, DIM_TYPE* DIM2) { npy_intp dims[2] = { *$2, *$3 }; PyObject* obj = PyArray_SimpleNewFromData(2, dims, DATA_TYPECODE, (void*)(*$1)); PyArrayObject* array = (PyArrayObject*) obj; if (!array) SWIG_fail; $result = SWIG_Python_AppendOutput($result,obj); } /* Typemap suite for (DIM_TYPE* DIM1, DIM_TYPE* DIM2, DATA_TYPE** ARGOUTVIEW_ARRAY2) */ %typemap(in,numinputs=0) (DIM_TYPE* DIM1 , DIM_TYPE* DIM2 , DATA_TYPE** ARGOUTVIEW_ARRAY2) (DIM_TYPE dim1_temp, DIM_TYPE dim2_temp, DATA_TYPE* data_temp = NULL ) { $1 = &dim1_temp; $2 = &dim2_temp; $3 = &data_temp; } %typemap(argout, fragment="NumPy_Backward_Compatibility") (DIM_TYPE* DIM1, DIM_TYPE* DIM2, DATA_TYPE** ARGOUTVIEW_ARRAY2) { npy_intp dims[2] = { *$1, *$2 }; PyObject* obj = PyArray_SimpleNewFromData(2, dims, DATA_TYPECODE, (void*)(*$3)); PyArrayObject* array = (PyArrayObject*) obj; if (!array) SWIG_fail; $result = SWIG_Python_AppendOutput($result,obj); } /* Typemap suite for (DATA_TYPE** ARGOUTVIEW_FARRAY2, DIM_TYPE* DIM1, DIM_TYPE* DIM2) */ %typemap(in,numinputs=0) (DATA_TYPE** ARGOUTVIEW_FARRAY2, DIM_TYPE* DIM1 , DIM_TYPE* DIM2 ) (DATA_TYPE* data_temp = NULL , DIM_TYPE dim1_temp, DIM_TYPE dim2_temp) { $1 = &data_temp; $2 = &dim1_temp; $3 = &dim2_temp; } %typemap(argout, fragment="NumPy_Backward_Compatibility,NumPy_Array_Requirements") (DATA_TYPE** ARGOUTVIEW_FARRAY2, DIM_TYPE* DIM1, DIM_TYPE* DIM2) { npy_intp dims[2] = { *$2, *$3 }; PyObject* obj = PyArray_SimpleNewFromData(2, dims, DATA_TYPECODE, (void*)(*$1)); PyArrayObject* array = (PyArrayObject*) obj; if (!array || !require_fortran(array)) SWIG_fail; $result = SWIG_Python_AppendOutput($result,obj); } /* Typemap suite for (DIM_TYPE* DIM1, DIM_TYPE* DIM2, DATA_TYPE** ARGOUTVIEW_FARRAY2) */ %typemap(in,numinputs=0) (DIM_TYPE* DIM1 , DIM_TYPE* DIM2 , DATA_TYPE** ARGOUTVIEW_FARRAY2) (DIM_TYPE dim1_temp, DIM_TYPE dim2_temp, DATA_TYPE* data_temp = NULL ) { $1 = &dim1_temp; $2 = &dim2_temp; $3 = &data_temp; } %typemap(argout, fragment="NumPy_Backward_Compatibility,NumPy_Array_Requirements") (DIM_TYPE* DIM1, DIM_TYPE* DIM2, DATA_TYPE** ARGOUTVIEW_FARRAY2) { npy_intp dims[2] = { *$1, *$2 }; PyObject* obj = PyArray_SimpleNewFromData(2, dims, DATA_TYPECODE, (void*)(*$3)); PyArrayObject* array = (PyArrayObject*) obj; if (!array || !require_fortran(array)) SWIG_fail; $result = SWIG_Python_AppendOutput($result,obj); } /* Typemap suite for (DATA_TYPE** ARGOUTVIEW_ARRAY3, DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3) */ %typemap(in,numinputs=0) (DATA_TYPE** ARGOUTVIEW_ARRAY3, DIM_TYPE* DIM1 , DIM_TYPE* DIM2 , DIM_TYPE* DIM3 ) (DATA_TYPE* data_temp = NULL , DIM_TYPE dim1_temp, DIM_TYPE dim2_temp, DIM_TYPE dim3_temp) { $1 = &data_temp; $2 = &dim1_temp; $3 = &dim2_temp; $4 = &dim3_temp; } %typemap(argout, fragment="NumPy_Backward_Compatibility") (DATA_TYPE** ARGOUTVIEW_ARRAY3, DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3) { npy_intp dims[3] = { *$2, *$3, *$4 }; PyObject* obj = PyArray_SimpleNewFromData(3, dims, DATA_TYPECODE, (void*)(*$1)); PyArrayObject* array = (PyArrayObject*) obj; if (!array) SWIG_fail; $result = SWIG_Python_AppendOutput($result,obj); } /* Typemap suite for (DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3, DATA_TYPE** ARGOUTVIEW_ARRAY3) */ %typemap(in,numinputs=0) (DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3, DATA_TYPE** ARGOUTVIEW_ARRAY3) (DIM_TYPE dim1_temp, DIM_TYPE dim2_temp, DIM_TYPE dim3_temp, DATA_TYPE* data_temp = NULL) { $1 = &dim1_temp; $2 = &dim2_temp; $3 = &dim3_temp; $4 = &data_temp; } %typemap(argout, fragment="NumPy_Backward_Compatibility") (DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3, DATA_TYPE** ARGOUTVIEW_ARRAY3) { npy_intp dims[3] = { *$1, *$2, *$3 }; PyObject* obj = PyArray_SimpleNewFromData(3, dims, DATA_TYPECODE, (void*)(*$4)); PyArrayObject* array = (PyArrayObject*) obj; if (!array) SWIG_fail; $result = SWIG_Python_AppendOutput($result,obj); } /* Typemap suite for (DATA_TYPE** ARGOUTVIEW_FARRAY3, DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3) */ %typemap(in,numinputs=0) (DATA_TYPE** ARGOUTVIEW_FARRAY3, DIM_TYPE* DIM1 , DIM_TYPE* DIM2 , DIM_TYPE* DIM3 ) (DATA_TYPE* data_temp = NULL , DIM_TYPE dim1_temp, DIM_TYPE dim2_temp, DIM_TYPE dim3_temp) { $1 = &data_temp; $2 = &dim1_temp; $3 = &dim2_temp; $4 = &dim3_temp; } %typemap(argout, fragment="NumPy_Backward_Compatibility,NumPy_Array_Requirements") (DATA_TYPE** ARGOUTVIEW_FARRAY3, DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3) { npy_intp dims[3] = { *$2, *$3, *$4 }; PyObject* obj = PyArray_SimpleNewFromData(3, dims, DATA_TYPECODE, (void*)(*$1)); PyArrayObject* array = (PyArrayObject*) obj; if (!array || !require_fortran(array)) SWIG_fail; $result = SWIG_Python_AppendOutput($result,obj); } /* Typemap suite for (DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3, DATA_TYPE** ARGOUTVIEW_FARRAY3) */ %typemap(in,numinputs=0) (DIM_TYPE* DIM1 , DIM_TYPE* DIM2 , DIM_TYPE* DIM3 , DATA_TYPE** ARGOUTVIEW_FARRAY3) (DIM_TYPE dim1_temp, DIM_TYPE dim2_temp, DIM_TYPE dim3_temp, DATA_TYPE* data_temp = NULL ) { $1 = &dim1_temp; $2 = &dim2_temp; $3 = &dim3_temp; $4 = &data_temp; } %typemap(argout, fragment="NumPy_Backward_Compatibility,NumPy_Array_Requirements") (DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3, DATA_TYPE** ARGOUTVIEW_FARRAY3) { npy_intp dims[3] = { *$1, *$2, *$3 }; PyObject* obj = PyArray_SimpleNewFromData(3, dims, DATA_TYPECODE, (void*)(*$4)); PyArrayObject* array = (PyArrayObject*) obj; if (!array || !require_fortran(array)) SWIG_fail; $result = SWIG_Python_AppendOutput($result,obj); } /* Typemap suite for (DATA_TYPE** ARGOUTVIEW_ARRAY4, DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3, DIM_TYPE* DIM4) */ %typemap(in,numinputs=0) (DATA_TYPE** ARGOUTVIEW_ARRAY4, DIM_TYPE* DIM1 , DIM_TYPE* DIM2 , DIM_TYPE* DIM3 , DIM_TYPE* DIM4 ) (DATA_TYPE* data_temp = NULL , DIM_TYPE dim1_temp, DIM_TYPE dim2_temp, DIM_TYPE dim3_temp, DIM_TYPE dim4_temp) { $1 = &data_temp; $2 = &dim1_temp; $3 = &dim2_temp; $4 = &dim3_temp; $5 = &dim4_temp; } %typemap(argout, fragment="NumPy_Backward_Compatibility") (DATA_TYPE** ARGOUTVIEW_ARRAY4, DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3, DIM_TYPE* DIM4) { npy_intp dims[4] = { *$2, *$3, *$4 , *$5 }; PyObject* obj = PyArray_SimpleNewFromData(4, dims, DATA_TYPECODE, (void*)(*$1)); PyArrayObject* array = (PyArrayObject*) obj; if (!array) SWIG_fail; $result = SWIG_Python_AppendOutput($result,obj); } /* Typemap suite for (DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3, DIM_TYPE* DIM4, DATA_TYPE** ARGOUTVIEW_ARRAY4) */ %typemap(in,numinputs=0) (DIM_TYPE* DIM1 , DIM_TYPE* DIM2 , DIM_TYPE* DIM3 , DIM_TYPE* DIM4 , DATA_TYPE** ARGOUTVIEW_ARRAY4) (DIM_TYPE dim1_temp, DIM_TYPE dim2_temp, DIM_TYPE dim3_temp, DIM_TYPE dim4_temp, DATA_TYPE* data_temp = NULL ) { $1 = &dim1_temp; $2 = &dim2_temp; $3 = &dim3_temp; $4 = &dim4_temp; $5 = &data_temp; } %typemap(argout, fragment="NumPy_Backward_Compatibility") (DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3, DIM_TYPE* DIM4, DATA_TYPE** ARGOUTVIEW_ARRAY4) { npy_intp dims[4] = { *$1, *$2, *$3 , *$4 }; PyObject* obj = PyArray_SimpleNewFromData(4, dims, DATA_TYPECODE, (void*)(*$5)); PyArrayObject* array = (PyArrayObject*) obj; if (!array) SWIG_fail; $result = SWIG_Python_AppendOutput($result,obj); } /* Typemap suite for (DATA_TYPE** ARGOUTVIEW_FARRAY4, DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3, DIM_TYPE* DIM4) */ %typemap(in,numinputs=0) (DATA_TYPE** ARGOUTVIEW_FARRAY4, DIM_TYPE* DIM1 , DIM_TYPE* DIM2 , DIM_TYPE* DIM3 , DIM_TYPE* DIM4 ) (DATA_TYPE* data_temp = NULL , DIM_TYPE dim1_temp, DIM_TYPE dim2_temp, DIM_TYPE dim3_temp, DIM_TYPE dim4_temp) { $1 = &data_temp; $2 = &dim1_temp; $3 = &dim2_temp; $4 = &dim3_temp; $5 = &dim4_temp; } %typemap(argout, fragment="NumPy_Backward_Compatibility,NumPy_Array_Requirements") (DATA_TYPE** ARGOUTVIEW_FARRAY4, DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3, DIM_TYPE* DIM4) { npy_intp dims[4] = { *$2, *$3, *$4 , *$5 }; PyObject* obj = PyArray_SimpleNewFromData(4, dims, DATA_TYPECODE, (void*)(*$1)); PyArrayObject* array = (PyArrayObject*) obj; if (!array || !require_fortran(array)) SWIG_fail; $result = SWIG_Python_AppendOutput($result,obj); } /* Typemap suite for (DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3, DIM_TYPE* DIM4, DATA_TYPE** ARGOUTVIEW_FARRAY4) */ %typemap(in,numinputs=0) (DIM_TYPE* DIM1 , DIM_TYPE* DIM2 , DIM_TYPE* DIM3 , DIM_TYPE* DIM4 , DATA_TYPE** ARGOUTVIEW_FARRAY4) (DIM_TYPE dim1_temp, DIM_TYPE dim2_temp, DIM_TYPE dim3_temp, DIM_TYPE dim4_temp, DATA_TYPE* data_temp = NULL ) { $1 = &dim1_temp; $2 = &dim2_temp; $3 = &dim3_temp; $4 = &dim4_temp; $5 = &data_temp; } %typemap(argout, fragment="NumPy_Backward_Compatibility,NumPy_Array_Requirements") (DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3, DIM_TYPE* DIM4, DATA_TYPE** ARGOUTVIEW_FARRAY4) { npy_intp dims[4] = { *$1, *$2, *$3 , *$4 }; PyObject* obj = PyArray_SimpleNewFromData(4, dims, DATA_TYPECODE, (void*)(*$5)); PyArrayObject* array = (PyArrayObject*) obj; if (!array || !require_fortran(array)) SWIG_fail; $result = SWIG_Python_AppendOutput($result,obj); } /*************************************/ /* Managed Argoutview Array Typemaps */ /*************************************/ /* Typemap suite for (DATA_TYPE** ARGOUTVIEWM_ARRAY1, DIM_TYPE* DIM1) */ %typemap(in,numinputs=0) (DATA_TYPE** ARGOUTVIEWM_ARRAY1, DIM_TYPE* DIM1 ) (DATA_TYPE* data_temp = NULL , DIM_TYPE dim_temp) { $1 = &data_temp; $2 = &dim_temp; } %typemap(argout, fragment="NumPy_Backward_Compatibility,NumPy_Utilities") (DATA_TYPE** ARGOUTVIEWM_ARRAY1, DIM_TYPE* DIM1) { npy_intp dims[1] = { *$2 }; PyObject* obj = PyArray_SimpleNewFromData(1, dims, DATA_TYPECODE, (void*)(*$1)); PyArrayObject* array = (PyArrayObject*) obj; if (!array) SWIG_fail; %#ifdef SWIGPY_USE_CAPSULE PyObject* cap = PyCapsule_New((void*)(*$1), SWIGPY_CAPSULE_NAME, free_cap); %#else PyObject* cap = PyCObject_FromVoidPtr((void*)(*$1), free); %#endif %#if NPY_API_VERSION < 0x00000007 PyArray_BASE(array) = cap; %#else PyArray_SetBaseObject(array,cap); %#endif $result = SWIG_Python_AppendOutput($result,obj); } /* Typemap suite for (DIM_TYPE* DIM1, DATA_TYPE** ARGOUTVIEWM_ARRAY1) */ %typemap(in,numinputs=0) (DIM_TYPE* DIM1 , DATA_TYPE** ARGOUTVIEWM_ARRAY1) (DIM_TYPE dim_temp, DATA_TYPE* data_temp = NULL ) { $1 = &dim_temp; $2 = &data_temp; } %typemap(argout, fragment="NumPy_Backward_Compatibility,NumPy_Utilities") (DIM_TYPE* DIM1, DATA_TYPE** ARGOUTVIEWM_ARRAY1) { npy_intp dims[1] = { *$1 }; PyObject* obj = PyArray_SimpleNewFromData(1, dims, DATA_TYPECODE, (void*)(*$2)); PyArrayObject* array = (PyArrayObject*) obj; if (!array) SWIG_fail; %#ifdef SWIGPY_USE_CAPSULE PyObject* cap = PyCapsule_New((void*)(*$1), SWIGPY_CAPSULE_NAME, free_cap); %#else PyObject* cap = PyCObject_FromVoidPtr((void*)(*$1), free); %#endif %#if NPY_API_VERSION < 0x00000007 PyArray_BASE(array) = cap; %#else PyArray_SetBaseObject(array,cap); %#endif $result = SWIG_Python_AppendOutput($result,obj); } /* Typemap suite for (DATA_TYPE** ARGOUTVIEWM_ARRAY2, DIM_TYPE* DIM1, DIM_TYPE* DIM2) */ %typemap(in,numinputs=0) (DATA_TYPE** ARGOUTVIEWM_ARRAY2, DIM_TYPE* DIM1 , DIM_TYPE* DIM2 ) (DATA_TYPE* data_temp = NULL , DIM_TYPE dim1_temp, DIM_TYPE dim2_temp) { $1 = &data_temp; $2 = &dim1_temp; $3 = &dim2_temp; } %typemap(argout, fragment="NumPy_Backward_Compatibility,NumPy_Utilities") (DATA_TYPE** ARGOUTVIEWM_ARRAY2, DIM_TYPE* DIM1, DIM_TYPE* DIM2) { npy_intp dims[2] = { *$2, *$3 }; PyObject* obj = PyArray_SimpleNewFromData(2, dims, DATA_TYPECODE, (void*)(*$1)); PyArrayObject* array = (PyArrayObject*) obj; if (!array) SWIG_fail; %#ifdef SWIGPY_USE_CAPSULE PyObject* cap = PyCapsule_New((void*)(*$1), SWIGPY_CAPSULE_NAME, free_cap); %#else PyObject* cap = PyCObject_FromVoidPtr((void*)(*$1), free); %#endif %#if NPY_API_VERSION < 0x00000007 PyArray_BASE(array) = cap; %#else PyArray_SetBaseObject(array,cap); %#endif $result = SWIG_Python_AppendOutput($result,obj); } /* Typemap suite for (DIM_TYPE* DIM1, DIM_TYPE* DIM2, DATA_TYPE** ARGOUTVIEWM_ARRAY2) */ %typemap(in,numinputs=0) (DIM_TYPE* DIM1 , DIM_TYPE* DIM2 , DATA_TYPE** ARGOUTVIEWM_ARRAY2) (DIM_TYPE dim1_temp, DIM_TYPE dim2_temp, DATA_TYPE* data_temp = NULL ) { $1 = &dim1_temp; $2 = &dim2_temp; $3 = &data_temp; } %typemap(argout, fragment="NumPy_Backward_Compatibility,NumPy_Utilities") (DIM_TYPE* DIM1, DIM_TYPE* DIM2, DATA_TYPE** ARGOUTVIEWM_ARRAY2) { npy_intp dims[2] = { *$1, *$2 }; PyObject* obj = PyArray_SimpleNewFromData(2, dims, DATA_TYPECODE, (void*)(*$3)); PyArrayObject* array = (PyArrayObject*) obj; if (!array) SWIG_fail; %#ifdef SWIGPY_USE_CAPSULE PyObject* cap = PyCapsule_New((void*)(*$1), SWIGPY_CAPSULE_NAME, free_cap); %#else PyObject* cap = PyCObject_FromVoidPtr((void*)(*$1), free); %#endif %#if NPY_API_VERSION < 0x00000007 PyArray_BASE(array) = cap; %#else PyArray_SetBaseObject(array,cap); %#endif $result = SWIG_Python_AppendOutput($result,obj); } /* Typemap suite for (DATA_TYPE** ARGOUTVIEWM_FARRAY2, DIM_TYPE* DIM1, DIM_TYPE* DIM2) */ %typemap(in,numinputs=0) (DATA_TYPE** ARGOUTVIEWM_FARRAY2, DIM_TYPE* DIM1 , DIM_TYPE* DIM2 ) (DATA_TYPE* data_temp = NULL , DIM_TYPE dim1_temp, DIM_TYPE dim2_temp) { $1 = &data_temp; $2 = &dim1_temp; $3 = &dim2_temp; } %typemap(argout, fragment="NumPy_Backward_Compatibility,NumPy_Array_Requirements,NumPy_Utilities") (DATA_TYPE** ARGOUTVIEWM_FARRAY2, DIM_TYPE* DIM1, DIM_TYPE* DIM2) { npy_intp dims[2] = { *$2, *$3 }; PyObject* obj = PyArray_SimpleNewFromData(2, dims, DATA_TYPECODE, (void*)(*$1)); PyArrayObject* array = (PyArrayObject*) obj; if (!array || !require_fortran(array)) SWIG_fail; %#ifdef SWIGPY_USE_CAPSULE PyObject* cap = PyCapsule_New((void*)(*$1), SWIGPY_CAPSULE_NAME, free_cap); %#else PyObject* cap = PyCObject_FromVoidPtr((void*)(*$1), free); %#endif %#if NPY_API_VERSION < 0x00000007 PyArray_BASE(array) = cap; %#else PyArray_SetBaseObject(array,cap); %#endif $result = SWIG_Python_AppendOutput($result,obj); } /* Typemap suite for (DIM_TYPE* DIM1, DIM_TYPE* DIM2, DATA_TYPE** ARGOUTVIEWM_FARRAY2) */ %typemap(in,numinputs=0) (DIM_TYPE* DIM1 , DIM_TYPE* DIM2 , DATA_TYPE** ARGOUTVIEWM_FARRAY2) (DIM_TYPE dim1_temp, DIM_TYPE dim2_temp, DATA_TYPE* data_temp = NULL ) { $1 = &dim1_temp; $2 = &dim2_temp; $3 = &data_temp; } %typemap(argout, fragment="NumPy_Backward_Compatibility,NumPy_Array_Requirements,NumPy_Utilities") (DIM_TYPE* DIM1, DIM_TYPE* DIM2, DATA_TYPE** ARGOUTVIEWM_FARRAY2) { npy_intp dims[2] = { *$1, *$2 }; PyObject* obj = PyArray_SimpleNewFromData(2, dims, DATA_TYPECODE, (void*)(*$3)); PyArrayObject* array = (PyArrayObject*) obj; if (!array || !require_fortran(array)) SWIG_fail; %#ifdef SWIGPY_USE_CAPSULE PyObject* cap = PyCapsule_New((void*)(*$1), SWIGPY_CAPSULE_NAME, free_cap); %#else PyObject* cap = PyCObject_FromVoidPtr((void*)(*$1), free); %#endif %#if NPY_API_VERSION < 0x00000007 PyArray_BASE(array) = cap; %#else PyArray_SetBaseObject(array,cap); %#endif $result = SWIG_Python_AppendOutput($result,obj); } /* Typemap suite for (DATA_TYPE** ARGOUTVIEWM_ARRAY3, DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3) */ %typemap(in,numinputs=0) (DATA_TYPE** ARGOUTVIEWM_ARRAY3, DIM_TYPE* DIM1 , DIM_TYPE* DIM2 , DIM_TYPE* DIM3 ) (DATA_TYPE* data_temp = NULL , DIM_TYPE dim1_temp, DIM_TYPE dim2_temp, DIM_TYPE dim3_temp) { $1 = &data_temp; $2 = &dim1_temp; $3 = &dim2_temp; $4 = &dim3_temp; } %typemap(argout, fragment="NumPy_Backward_Compatibility,NumPy_Utilities") (DATA_TYPE** ARGOUTVIEWM_ARRAY3, DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3) { npy_intp dims[3] = { *$2, *$3, *$4 }; PyObject* obj = PyArray_SimpleNewFromData(3, dims, DATA_TYPECODE, (void*)(*$1)); PyArrayObject* array = (PyArrayObject*) obj; if (!array) SWIG_fail; %#ifdef SWIGPY_USE_CAPSULE PyObject* cap = PyCapsule_New((void*)(*$1), SWIGPY_CAPSULE_NAME, free_cap); %#else PyObject* cap = PyCObject_FromVoidPtr((void*)(*$1), free); %#endif %#if NPY_API_VERSION < 0x00000007 PyArray_BASE(array) = cap; %#else PyArray_SetBaseObject(array,cap); %#endif $result = SWIG_Python_AppendOutput($result,obj); } /* Typemap suite for (DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3, DATA_TYPE** ARGOUTVIEWM_ARRAY3) */ %typemap(in,numinputs=0) (DIM_TYPE* DIM1 , DIM_TYPE* DIM2 , DIM_TYPE* DIM3 , DATA_TYPE** ARGOUTVIEWM_ARRAY3) (DIM_TYPE dim1_temp, DIM_TYPE dim2_temp, DIM_TYPE dim3_temp, DATA_TYPE* data_temp = NULL ) { $1 = &dim1_temp; $2 = &dim2_temp; $3 = &dim3_temp; $4 = &data_temp; } %typemap(argout, fragment="NumPy_Backward_Compatibility,NumPy_Utilities") (DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3, DATA_TYPE** ARGOUTVIEWM_ARRAY3) { npy_intp dims[3] = { *$1, *$2, *$3 }; PyObject* obj= PyArray_SimpleNewFromData(3, dims, DATA_TYPECODE, (void*)(*$4)); PyArrayObject* array = (PyArrayObject*) obj; if (!array) SWIG_fail; %#ifdef SWIGPY_USE_CAPSULE PyObject* cap = PyCapsule_New((void*)(*$1), SWIGPY_CAPSULE_NAME, free_cap); %#else PyObject* cap = PyCObject_FromVoidPtr((void*)(*$1), free); %#endif %#if NPY_API_VERSION < 0x00000007 PyArray_BASE(array) = cap; %#else PyArray_SetBaseObject(array,cap); %#endif $result = SWIG_Python_AppendOutput($result,obj); } /* Typemap suite for (DATA_TYPE** ARGOUTVIEWM_FARRAY3, DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3) */ %typemap(in,numinputs=0) (DATA_TYPE** ARGOUTVIEWM_FARRAY3, DIM_TYPE* DIM1 , DIM_TYPE* DIM2 , DIM_TYPE* DIM3 ) (DATA_TYPE* data_temp = NULL , DIM_TYPE dim1_temp, DIM_TYPE dim2_temp, DIM_TYPE dim3_temp) { $1 = &data_temp; $2 = &dim1_temp; $3 = &dim2_temp; $4 = &dim3_temp; } %typemap(argout, fragment="NumPy_Backward_Compatibility,NumPy_Array_Requirements,NumPy_Utilities") (DATA_TYPE** ARGOUTVIEWM_FARRAY3, DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3) { npy_intp dims[3] = { *$2, *$3, *$4 }; PyObject* obj = PyArray_SimpleNewFromData(3, dims, DATA_TYPECODE, (void*)(*$1)); PyArrayObject* array = (PyArrayObject*) obj; if (!array || !require_fortran(array)) SWIG_fail; %#ifdef SWIGPY_USE_CAPSULE PyObject* cap = PyCapsule_New((void*)(*$1), SWIGPY_CAPSULE_NAME, free_cap); %#else PyObject* cap = PyCObject_FromVoidPtr((void*)(*$1), free); %#endif %#if NPY_API_VERSION < 0x00000007 PyArray_BASE(array) = cap; %#else PyArray_SetBaseObject(array,cap); %#endif $result = SWIG_Python_AppendOutput($result,obj); } /* Typemap suite for (DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3, DATA_TYPE** ARGOUTVIEWM_FARRAY3) */ %typemap(in,numinputs=0) (DIM_TYPE* DIM1 , DIM_TYPE* DIM2 , DIM_TYPE* DIM3 , DATA_TYPE** ARGOUTVIEWM_FARRAY3) (DIM_TYPE dim1_temp, DIM_TYPE dim2_temp, DIM_TYPE dim3_temp, DATA_TYPE* data_temp = NULL ) { $1 = &dim1_temp; $2 = &dim2_temp; $3 = &dim3_temp; $4 = &data_temp; } %typemap(argout, fragment="NumPy_Backward_Compatibility,NumPy_Array_Requirements,NumPy_Utilities") (DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3, DATA_TYPE** ARGOUTVIEWM_FARRAY3) { npy_intp dims[3] = { *$1, *$2, *$3 }; PyObject* obj = PyArray_SimpleNewFromData(3, dims, DATA_TYPECODE, (void*)(*$4)); PyArrayObject* array = (PyArrayObject*) obj; if (!array || !require_fortran(array)) SWIG_fail; %#ifdef SWIGPY_USE_CAPSULE PyObject* cap = PyCapsule_New((void*)(*$1), SWIGPY_CAPSULE_NAME, free_cap); %#else PyObject* cap = PyCObject_FromVoidPtr((void*)(*$1), free); %#endif %#if NPY_API_VERSION < 0x00000007 PyArray_BASE(array) = cap; %#else PyArray_SetBaseObject(array,cap); %#endif $result = SWIG_Python_AppendOutput($result,obj); } /* Typemap suite for (DATA_TYPE** ARGOUTVIEWM_ARRAY4, DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3, DIM_TYPE* DIM4) */ %typemap(in,numinputs=0) (DATA_TYPE** ARGOUTVIEWM_ARRAY4, DIM_TYPE* DIM1 , DIM_TYPE* DIM2 , DIM_TYPE* DIM3 , DIM_TYPE* DIM4 ) (DATA_TYPE* data_temp = NULL , DIM_TYPE dim1_temp, DIM_TYPE dim2_temp, DIM_TYPE dim3_temp, DIM_TYPE dim4_temp) { $1 = &data_temp; $2 = &dim1_temp; $3 = &dim2_temp; $4 = &dim3_temp; $5 = &dim4_temp; } %typemap(argout, fragment="NumPy_Backward_Compatibility,NumPy_Utilities") (DATA_TYPE** ARGOUTVIEWM_ARRAY4, DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3, DIM_TYPE* DIM4) { npy_intp dims[4] = { *$2, *$3, *$4 , *$5 }; PyObject* obj = PyArray_SimpleNewFromData(4, dims, DATA_TYPECODE, (void*)(*$1)); PyArrayObject* array = (PyArrayObject*) obj; if (!array) SWIG_fail; %#ifdef SWIGPY_USE_CAPSULE PyObject* cap = PyCapsule_New((void*)(*$1), SWIGPY_CAPSULE_NAME, free_cap); %#else PyObject* cap = PyCObject_FromVoidPtr((void*)(*$1), free); %#endif %#if NPY_API_VERSION < 0x00000007 PyArray_BASE(array) = cap; %#else PyArray_SetBaseObject(array,cap); %#endif $result = SWIG_Python_AppendOutput($result,obj); } /* Typemap suite for (DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3, DIM_TYPE* DIM4, DATA_TYPE** ARGOUTVIEWM_ARRAY4) */ %typemap(in,numinputs=0) (DIM_TYPE* DIM1 , DIM_TYPE* DIM2 , DIM_TYPE* DIM3 , DIM_TYPE* DIM4 , DATA_TYPE** ARGOUTVIEWM_ARRAY4) (DIM_TYPE dim1_temp, DIM_TYPE dim2_temp, DIM_TYPE dim3_temp, DIM_TYPE dim4_temp, DATA_TYPE* data_temp = NULL ) { $1 = &dim1_temp; $2 = &dim2_temp; $3 = &dim3_temp; $4 = &dim4_temp; $5 = &data_temp; } %typemap(argout, fragment="NumPy_Backward_Compatibility,NumPy_Utilities") (DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3, DIM_TYPE* DIM4, DATA_TYPE** ARGOUTVIEWM_ARRAY4) { npy_intp dims[4] = { *$1, *$2, *$3 , *$4 }; PyObject* obj = PyArray_SimpleNewFromData(4, dims, DATA_TYPECODE, (void*)(*$5)); PyArrayObject* array = (PyArrayObject*) obj; if (!array) SWIG_fail; %#ifdef SWIGPY_USE_CAPSULE PyObject* cap = PyCapsule_New((void*)(*$1), SWIGPY_CAPSULE_NAME, free_cap); %#else PyObject* cap = PyCObject_FromVoidPtr((void*)(*$1), free); %#endif %#if NPY_API_VERSION < 0x00000007 PyArray_BASE(array) = cap; %#else PyArray_SetBaseObject(array,cap); %#endif $result = SWIG_Python_AppendOutput($result,obj); } /* Typemap suite for (DATA_TYPE** ARGOUTVIEWM_FARRAY4, DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3, DIM_TYPE* DIM4) */ %typemap(in,numinputs=0) (DATA_TYPE** ARGOUTVIEWM_FARRAY4, DIM_TYPE* DIM1 , DIM_TYPE* DIM2 , DIM_TYPE* DIM3 , DIM_TYPE* DIM4 ) (DATA_TYPE* data_temp = NULL , DIM_TYPE dim1_temp, DIM_TYPE dim2_temp, DIM_TYPE dim3_temp, DIM_TYPE dim4_temp) { $1 = &data_temp; $2 = &dim1_temp; $3 = &dim2_temp; $4 = &dim3_temp; $5 = &dim4_temp; } %typemap(argout, fragment="NumPy_Backward_Compatibility,NumPy_Array_Requirements,NumPy_Utilities") (DATA_TYPE** ARGOUTVIEWM_FARRAY4, DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3) { npy_intp dims[4] = { *$2, *$3, *$4 , *$5 }; PyObject* obj = PyArray_SimpleNewFromData(4, dims, DATA_TYPECODE, (void*)(*$1)); PyArrayObject* array = (PyArrayObject*) obj; if (!array || !require_fortran(array)) SWIG_fail; %#ifdef SWIGPY_USE_CAPSULE PyObject* cap = PyCapsule_New((void*)(*$1), SWIGPY_CAPSULE_NAME, free_cap); %#else PyObject* cap = PyCObject_FromVoidPtr((void*)(*$1), free); %#endif %#if NPY_API_VERSION < 0x00000007 PyArray_BASE(array) = cap; %#else PyArray_SetBaseObject(array,cap); %#endif $result = SWIG_Python_AppendOutput($result,obj); } /* Typemap suite for (DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3, DIM_TYPE* DIM4, DATA_TYPE** ARGOUTVIEWM_FARRAY4) */ %typemap(in,numinputs=0) (DIM_TYPE* DIM1 , DIM_TYPE* DIM2 , DIM_TYPE* DIM3 , DIM_TYPE* DIM4 , DATA_TYPE** ARGOUTVIEWM_FARRAY4) (DIM_TYPE dim1_temp, DIM_TYPE dim2_temp, DIM_TYPE dim3_temp, DIM_TYPE dim4_temp, DATA_TYPE* data_temp = NULL ) { $1 = &dim1_temp; $2 = &dim2_temp; $3 = &dim3_temp; $4 = &dim4_temp; $5 = &data_temp; } %typemap(argout, fragment="NumPy_Backward_Compatibility,NumPy_Array_Requirements,NumPy_Utilities") (DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3, DIM_TYPE* DIM4, DATA_TYPE** ARGOUTVIEWM_FARRAY4) { npy_intp dims[4] = { *$1, *$2, *$3 , *$4 }; PyObject* obj = PyArray_SimpleNewFromData(4, dims, DATA_TYPECODE, (void*)(*$5)); PyArrayObject* array = (PyArrayObject*) obj; if (!array || !require_fortran(array)) SWIG_fail; %#ifdef SWIGPY_USE_CAPSULE PyObject* cap = PyCapsule_New((void*)(*$1), SWIGPY_CAPSULE_NAME, free_cap); %#else PyObject* cap = PyCObject_FromVoidPtr((void*)(*$1), free); %#endif %#if NPY_API_VERSION < 0x00000007 PyArray_BASE(array) = cap; %#else PyArray_SetBaseObject(array,cap); %#endif $result = SWIG_Python_AppendOutput($result,obj); } /* Typemap suite for (DATA_TYPE** ARGOUTVIEWM_ARRAY4, DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3, DIM_TYPE* DIM4) */ %typemap(in,numinputs=0) (DATA_TYPE** ARGOUTVIEWM_ARRAY4, DIM_TYPE* DIM1 , DIM_TYPE* DIM2 , DIM_TYPE* DIM3 , DIM_TYPE* DIM4 ) (DATA_TYPE* data_temp = NULL , DIM_TYPE dim1_temp, DIM_TYPE dim2_temp, DIM_TYPE dim3_temp, DIM_TYPE dim4_temp) { $1 = &data_temp; $2 = &dim1_temp; $3 = &dim2_temp; $4 = &dim3_temp; $5 = &dim4_temp; } %typemap(argout, fragment="NumPy_Backward_Compatibility,NumPy_Utilities") (DATA_TYPE** ARGOUTVIEWM_ARRAY4, DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3, DIM_TYPE* DIM4) { npy_intp dims[4] = { *$2, *$3, *$4 , *$5 }; PyObject* obj = PyArray_SimpleNewFromData(4, dims, DATA_TYPECODE, (void*)(*$1)); PyArrayObject* array = (PyArrayObject*) obj; if (!array) SWIG_fail; %#ifdef SWIGPY_USE_CAPSULE PyObject* cap = PyCapsule_New((void*)(*$1), SWIGPY_CAPSULE_NAME, free_cap); %#else PyObject* cap = PyCObject_FromVoidPtr((void*)(*$1), free); %#endif %#if NPY_API_VERSION < 0x00000007 PyArray_BASE(array) = cap; %#else PyArray_SetBaseObject(array,cap); %#endif $result = SWIG_Python_AppendOutput($result,obj); } /* Typemap suite for (DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3, DIM_TYPE* DIM4, DATA_TYPE** ARGOUTVIEWM_ARRAY4) */ %typemap(in,numinputs=0) (DIM_TYPE* DIM1 , DIM_TYPE* DIM2 , DIM_TYPE* DIM3 , DIM_TYPE* DIM4 , DATA_TYPE** ARGOUTVIEWM_ARRAY4) (DIM_TYPE dim1_temp, DIM_TYPE dim2_temp, DIM_TYPE dim3_temp, DIM_TYPE dim4_temp, DATA_TYPE* data_temp = NULL ) { $1 = &dim1_temp; $2 = &dim2_temp; $3 = &dim3_temp; $4 = &dim4_temp; $5 = &data_temp; } %typemap(argout, fragment="NumPy_Backward_Compatibility,NumPy_Utilities") (DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3, DIM_TYPE* DIM4, DATA_TYPE** ARGOUTVIEWM_ARRAY4) { npy_intp dims[4] = { *$1, *$2, *$3 , *$4 }; PyObject* obj = PyArray_SimpleNewFromData(4, dims, DATA_TYPECODE, (void*)(*$5)); PyArrayObject* array = (PyArrayObject*) obj; if (!array) SWIG_fail; %#ifdef SWIGPY_USE_CAPSULE PyObject* cap = PyCapsule_New((void*)(*$1), SWIGPY_CAPSULE_NAME, free_cap); %#else PyObject* cap = PyCObject_FromVoidPtr((void*)(*$1), free); %#endif %#if NPY_API_VERSION < 0x00000007 PyArray_BASE(array) = cap; %#else PyArray_SetBaseObject(array,cap); %#endif $result = SWIG_Python_AppendOutput($result,obj); } /* Typemap suite for (DATA_TYPE** ARGOUTVIEWM_FARRAY4, DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3, DIM_TYPE* DIM4) */ %typemap(in,numinputs=0) (DATA_TYPE** ARGOUTVIEWM_FARRAY4, DIM_TYPE* DIM1 , DIM_TYPE* DIM2 , DIM_TYPE* DIM3 , DIM_TYPE* DIM4 ) (DATA_TYPE* data_temp = NULL , DIM_TYPE dim1_temp, DIM_TYPE dim2_temp, DIM_TYPE dim3_temp, DIM_TYPE dim4_temp) { $1 = &data_temp; $2 = &dim1_temp; $3 = &dim2_temp; $4 = &dim3_temp; $5 = &dim4_temp; } %typemap(argout, fragment="NumPy_Backward_Compatibility,NumPy_Array_Requirements,NumPy_Utilities") (DATA_TYPE** ARGOUTVIEWM_FARRAY4, DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3, DIM_TYPE* DIM4) { npy_intp dims[4] = { *$2, *$3, *$4 , *$5 }; PyObject* obj = PyArray_SimpleNewFromData(4, dims, DATA_TYPECODE, (void*)(*$1)); PyArrayObject* array = (PyArrayObject*) obj; if (!array || !require_fortran(array)) SWIG_fail; %#ifdef SWIGPY_USE_CAPSULE PyObject* cap = PyCapsule_New((void*)(*$1), SWIGPY_CAPSULE_NAME, free_cap); %#else PyObject* cap = PyCObject_FromVoidPtr((void*)(*$1), free); %#endif %#if NPY_API_VERSION < 0x00000007 PyArray_BASE(array) = cap; %#else PyArray_SetBaseObject(array,cap); %#endif $result = SWIG_Python_AppendOutput($result,obj); } /* Typemap suite for (DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3, DIM_TYPE* DIM4, DATA_TYPE** ARGOUTVIEWM_FARRAY4) */ %typemap(in,numinputs=0) (DIM_TYPE* DIM1 , DIM_TYPE* DIM2 , DIM_TYPE* DIM3 , DIM_TYPE* DIM4 , DATA_TYPE** ARGOUTVIEWM_FARRAY4) (DIM_TYPE dim1_temp, DIM_TYPE dim2_temp, DIM_TYPE dim3_temp, DIM_TYPE dim4_temp, DATA_TYPE* data_temp = NULL ) { $1 = &dim1_temp; $2 = &dim2_temp; $3 = &dim3_temp; $4 = &dim4_temp; $5 = &data_temp; } %typemap(argout, fragment="NumPy_Backward_Compatibility,NumPy_Array_Requirements,NumPy_Utilities") (DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3, DIM_TYPE* DIM4, DATA_TYPE** ARGOUTVIEWM_FARRAY4) { npy_intp dims[4] = { *$1, *$2, *$3 , *$4 }; PyObject* obj = PyArray_SimpleNewFromData(4, dims, DATA_TYPECODE, (void*)(*$5)); PyArrayObject* array = (PyArrayObject*) obj; if (!array || !require_fortran(array)) SWIG_fail; %#ifdef SWIGPY_USE_CAPSULE PyObject* cap = PyCapsule_New((void*)(*$1), SWIGPY_CAPSULE_NAME, free_cap); %#else PyObject* cap = PyCObject_FromVoidPtr((void*)(*$1), free); %#endif %#if NPY_API_VERSION < 0x00000007 PyArray_BASE(array) = cap; %#else PyArray_SetBaseObject(array,cap); %#endif $result = SWIG_Python_AppendOutput($result,obj); } /**************************************/ /* In-Place Array Typemap - flattened */ /**************************************/ /* Typemap suite for (DATA_TYPE* INPLACE_ARRAY_FLAT, DIM_TYPE DIM_FLAT) */ %typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY, fragment="NumPy_Macros") (DATA_TYPE* INPLACE_ARRAY_FLAT, DIM_TYPE DIM_FLAT) { $1 = is_array($input) && PyArray_EquivTypenums(array_type($input), DATA_TYPECODE); } %typemap(in, fragment="NumPy_Fragments") (DATA_TYPE* INPLACE_ARRAY_FLAT, DIM_TYPE DIM_FLAT) (PyArrayObject* array=NULL, int i=1) { array = obj_to_array_no_conversion($input, DATA_TYPECODE); if (!array || !require_c_or_f_contiguous(array) || !require_native(array)) SWIG_fail; $1 = (DATA_TYPE*) array_data(array); $2 = 1; for (i=0; i < array_numdims(array); ++i) $2 *= array_size(array,i); } %enddef /* %numpy_typemaps() macro */ /* *************************************************************** */ /* Concrete instances of the %numpy_typemaps() macro: Each invocation * below applies all of the typemaps above to the specified data type. */ %numpy_typemaps(signed char , NPY_BYTE , int) %numpy_typemaps(unsigned char , NPY_UBYTE , int) %numpy_typemaps(short , NPY_SHORT , int) %numpy_typemaps(unsigned short , NPY_USHORT , int) %numpy_typemaps(int , NPY_INT , int) %numpy_typemaps(unsigned int , NPY_UINT , int) %numpy_typemaps(long , NPY_LONG , int) %numpy_typemaps(unsigned long , NPY_ULONG , int) %numpy_typemaps(long long , NPY_LONGLONG , int) %numpy_typemaps(unsigned long long, NPY_ULONGLONG, int) %numpy_typemaps(float , NPY_FLOAT , int) %numpy_typemaps(double , NPY_DOUBLE , int) %numpy_typemaps(int8_t , NPY_INT8 , int) %numpy_typemaps(int16_t , NPY_INT16 , int) %numpy_typemaps(int32_t , NPY_INT32 , int) %numpy_typemaps(int64_t , NPY_INT64 , int) %numpy_typemaps(uint8_t , NPY_UINT8 , int) %numpy_typemaps(uint16_t , NPY_UINT16 , int) %numpy_typemaps(uint32_t , NPY_UINT32 , int) %numpy_typemaps(uint64_t , NPY_UINT64 , int) /* *************************************************************** * The follow macro expansion does not work, because C++ bool is 4 * bytes and NPY_BOOL is 1 byte * * %numpy_typemaps(bool, NPY_BOOL, int) */ /* *************************************************************** * On my Mac, I get the following warning for this macro expansion: * 'swig/python detected a memory leak of type 'long double *', no destructor found.' * * %numpy_typemaps(long double, NPY_LONGDOUBLE, int) */ #ifdef __cplusplus %include <std_complex.i> %numpy_typemaps(std::complex<float>, NPY_CFLOAT , int) %numpy_typemaps(std::complex<double>, NPY_CDOUBLE, int) #endif #endif /* SWIGPYTHON */
0
coqui_public_repos
coqui_public_repos/stt-model-manager/package.json
{ "name": "coqui_stt_model_manager", "version": "0.1.0", "private": true, "dependencies": { "@babel/core": "7.9.0", "@svgr/webpack": "6.0.0", "@testing-library/jest-dom": "^5.1.0", "@testing-library/react": "^10.0.0", "@testing-library/user-event": "^7.1.2", "@typescript-eslint/eslint-plugin": "^2.10.0", "@typescript-eslint/parser": "^2.10.0", "babel-eslint": "10.1.0", "babel-jest": "^24.9.0", "babel-loader": "8.1.0", "babel-plugin-named-asset-import": "^0.3.6", "babel-preset-react-app": "^9.1.2", "camelcase": "^5.3.1", "case-sensitive-paths-webpack-plugin": "2.3.0", "chai": "^4.2.0", "chai-http": "^4.3.0", "create-react-app": "^5.0.0", "css-loader": "5.2.6", "defaults": "^1.0.3", "dotenv": "8.2.0", "dotenv-expand": "5.1.0", "eslint": "^7.16.0", "eslint-config-react-app": "^5.2.1", "eslint-loader": "3.0.3", "eslint-plugin-flowtype": "4.6.0", "eslint-plugin-import": "2.20.1", "eslint-plugin-jsx-a11y": "6.2.3", "eslint-plugin-react": "7.19.0", "eslint-plugin-react-hooks": "^1.6.1", "file-loader": "4.3.0", "fs-extra": "^8.1.0", "html-webpack-plugin": "4.0.0", "identity-obj-proxy": "3.0.0", "jest": "26.0.0", "jest-environment-jsdom-fourteen": "1.0.1", "jest-resolve": "24.9.0", "jest-watch-typeahead": "0.6.0", "mini-css-extract-plugin": "0.9.0", "mocha": "^9.1.2", "optimize-css-assets-webpack-plugin": "5.0.5", "pnp-webpack-plugin": "1.6.4", "postcss-flexbugs-fixes": "4.1.0", "postcss-loader": "3.0.0", "postcss-normalize": "8.0.1", "postcss-preset-env": "6.7.0", "postcss-safe-parser": "4.0.1", "react": "^16.12.0", "react-app-polyfill": "^1.0.6", "react-dev-utils": "^12.0.0", "react-dom": "^17.0.2", "resolve": "1.15.0", "resolve-url-loader": "4.0.0", "sass-loader": "8.0.2", "semver": "6.3.0", "should": "^13.2.3", "should-http": "^0.1.1", "socket.io-client": "^2.3.0", "style-loader": "0.23.1", "terser-webpack-plugin": "2.3.8", "ts-pnp": "1.2.0", "url-loader": "2.3.0", "webpack": "4.42.0", "webpack-dev-server": "4.0.0", "webpack-manifest-plugin": "2.2.0", "workbox-webpack-plugin": "4.3.1" }, "scripts": { "start": "node scripts/start.js", "build": "node scripts/build.js", "watch": "NODE_ENV=development webpack --config config/webpack.config.js --watch", "test:client": "node scripts/test.js --env=jsdom --watchAll=false --coverage" }, "eslintConfig": { "extends": "react-app" }, "browserslist": { "production": [ ">0.2%", "not dead", "not op_mini all" ], "development": [ "last 1 chrome version", "last 1 firefox version", "last 1 safari version" ] }, "jest": { "roots": [ "<rootDir>/src" ], "collectCoverageFrom": [ "src/**/*.{js,jsx,ts,tsx}", "!src/**/*.d.ts" ], "setupFiles": [ "react-app-polyfill/jsdom" ], "setupFilesAfterEnv": [ "<rootDir>/src/setupTests.js" ], "testMatch": [ "<rootDir>/src/**/__tests__/**/*.{js,jsx,ts,tsx}", "<rootDir>/src/**/*.{spec,test}.{js,jsx,ts,tsx}" ], "testEnvironment": "jest-environment-jsdom-fourteen", "transform": { "^.+\\.(js|jsx|ts|tsx)$": "<rootDir>/node_modules/babel-jest", "^.+\\.css$": "<rootDir>/config/jest/cssTransform.js", "^(?!.*\\.(js|jsx|ts|tsx|css|json)$)": "<rootDir>/config/jest/fileTransform.js" }, "transformIgnorePatterns": [ "[/\\\\]node_modules[/\\\\].+\\.(js|jsx|ts|tsx)$", "^.+\\.module\\.(css|sass|scss)$" ], "modulePaths": [], "moduleNameMapper": { "^react-native$": "react-native-web", "^.+\\.module\\.(css|sass|scss)$": "identity-obj-proxy" }, "moduleFileExtensions": [ "web.js", "js", "web.ts", "ts", "web.tsx", "tsx", "json", "web.jsx", "jsx", "node" ], "watchPlugins": [ "jest-watch-typeahead/filename", "jest-watch-typeahead/testname" ] }, "babel": { "presets": [ "react-app" ] }, "devDependencies": { "webpack-cli": "^4.7.0" } }
0
coqui_public_repos/STT
coqui_public_repos/STT/taskcluster/test-electronjs_v9.0-darwin-amd64-opt.yml
build: template_file: test-darwin-opt-base.tyml dependencies: - "darwin-amd64-cpu-opt" - "test-training_16k-linux-amd64-py36m-opt" - "homebrew_tests-darwin-amd64" test_model_task: "test-training_16k-linux-amd64-py36m-opt" system_setup: > ${nodejs.brew.prep_12} args: tests_cmdline: "$TASKCLUSTER_TASK_DIR/DeepSpeech/ds/taskcluster/tc-electron-tests.sh 12.x 9.0.1 16k" metadata: name: "DeepSpeech OSX AMD64 CPU ElectronJS v9.0 tests" description: "Testing DeepSpeech for OSX/AMD64 on ElectronJS v9.0, CPU only, optimized version"
0
coqui_public_repos/STT-models/latvian/itml
coqui_public_repos/STT-models/latvian/itml/v0.1.0/LICENSE
GNU AFFERO GENERAL PUBLIC LICENSE Version 3, 19 November 2007 Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/> Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU Affero General Public License is a free, copyleft license for software and other kinds of works, specifically designed to ensure cooperation with the community in the case of network server software. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, our General Public Licenses are intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. Developers that use our General Public Licenses protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License which gives you legal permission to copy, distribute and/or modify the software. A secondary benefit of defending all users' freedom is that improvements made in alternate versions of the program, if they receive widespread use, become available for other developers to incorporate. Many developers of free software are heartened and encouraged by the resulting cooperation. However, in the case of software used on network servers, this result may fail to come about. The GNU General Public License permits making a modified version and letting the public access it on a server without ever releasing its source code to the public. The GNU Affero General Public License is designed specifically to ensure that, in such cases, the modified source code becomes available to the community. It requires the operator of a network server to provide the source code of the modified version running there to the users of that server. Therefore, public use of a modified version, on a publicly accessible server, gives the public access to the source code of the modified version. An older license, called the Affero General Public License and published by Affero, was designed to accomplish similar goals. This is a different license, not a version of the Affero GPL, but Affero has released a new version of the Affero GPL which permits relicensing under this license. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU Affero General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Remote Network Interaction; Use with the GNU General Public License. Notwithstanding any other provision of this License, if you modify the Program, your modified version must prominently offer all users interacting with it remotely through a computer network (if your version supports such interaction) an opportunity to receive the Corresponding Source of your version by providing access to the Corresponding Source from a network server at no charge, through some standard or customary means of facilitating copying of software. This Corresponding Source shall include the Corresponding Source for any work covered by version 3 of the GNU General Public License that is incorporated pursuant to the following paragraph. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the work with which it is combined will remain governed by version 3 of the GNU General Public License. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU Affero General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU Affero General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU Affero General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU Affero General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. <one line to give the program's name and a brief idea of what it does.> Copyright (C) <year> <name of author> This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>. Also add information on how to contact you by electronic and paper mail. If your software can interact with users remotely through a computer network, you should also make sure that it provides a way for users to get its source. For example, if your program is a web application, its interface could display a "Source" link that leads users to an archive of the code. There are many ways you could offer source, and different solutions will be better for different programs; see section 13 for the specific requirements. You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU AGPL, see <https://www.gnu.org/licenses/>.
0
coqui_public_repos/STT/native_client/ctcdecode/third_party/openfst-1.6.7/src
coqui_public_repos/STT/native_client/ctcdecode/third_party/openfst-1.6.7/src/test/Makefile.in
# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ check_PROGRAMS = fst_test$(EXEEXT) weight_test$(EXEEXT) \ algo_test_log$(EXEEXT) algo_test_tropical$(EXEEXT) \ algo_test_minmax$(EXEEXT) algo_test_lexicographic$(EXEEXT) \ algo_test_power$(EXEEXT) subdir = src/test DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/depcomp $(top_srcdir)/test-driver ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_python_devel.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h \ $(top_builddir)/src/include/fst/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__objects_1 = algo_test_lexicographic-algo_test.$(OBJEXT) am_algo_test_lexicographic_OBJECTS = $(am__objects_1) algo_test_lexicographic_OBJECTS = \ $(am_algo_test_lexicographic_OBJECTS) algo_test_lexicographic_LDADD = $(LDADD) am__DEPENDENCIES_1 = algo_test_lexicographic_DEPENDENCIES = ../lib/libfst.la \ $(am__DEPENDENCIES_1) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = am__objects_2 = algo_test_log-algo_test.$(OBJEXT) am_algo_test_log_OBJECTS = $(am__objects_2) algo_test_log_OBJECTS = $(am_algo_test_log_OBJECTS) algo_test_log_LDADD = $(LDADD) algo_test_log_DEPENDENCIES = ../lib/libfst.la $(am__DEPENDENCIES_1) am__objects_3 = algo_test_minmax-algo_test.$(OBJEXT) am_algo_test_minmax_OBJECTS = $(am__objects_3) algo_test_minmax_OBJECTS = $(am_algo_test_minmax_OBJECTS) algo_test_minmax_LDADD = $(LDADD) algo_test_minmax_DEPENDENCIES = ../lib/libfst.la $(am__DEPENDENCIES_1) am__objects_4 = algo_test_power-algo_test.$(OBJEXT) am_algo_test_power_OBJECTS = $(am__objects_4) algo_test_power_OBJECTS = $(am_algo_test_power_OBJECTS) algo_test_power_LDADD = $(LDADD) algo_test_power_DEPENDENCIES = ../lib/libfst.la $(am__DEPENDENCIES_1) am__objects_5 = algo_test_tropical-algo_test.$(OBJEXT) am_algo_test_tropical_OBJECTS = $(am__objects_5) algo_test_tropical_OBJECTS = $(am_algo_test_tropical_OBJECTS) algo_test_tropical_LDADD = $(LDADD) algo_test_tropical_DEPENDENCIES = ../lib/libfst.la \ $(am__DEPENDENCIES_1) am_fst_test_OBJECTS = fst_test.$(OBJEXT) fst_test_OBJECTS = $(am_fst_test_OBJECTS) fst_test_LDADD = $(LDADD) fst_test_DEPENDENCIES = ../lib/libfst.la $(am__DEPENDENCIES_1) am_weight_test_OBJECTS = weight_test.$(OBJEXT) weight_test_OBJECTS = $(am_weight_test_OBJECTS) weight_test_LDADD = $(LDADD) weight_test_DEPENDENCIES = ../lib/libfst.la $(am__DEPENDENCIES_1) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLD = $(CXX) CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(algo_test_lexicographic_SOURCES) $(algo_test_log_SOURCES) \ $(algo_test_minmax_SOURCES) $(algo_test_power_SOURCES) \ $(algo_test_tropical_SOURCES) $(fst_test_SOURCES) \ $(weight_test_SOURCES) DIST_SOURCES = $(algo_test_lexicographic_SOURCES) \ $(algo_test_log_SOURCES) $(algo_test_minmax_SOURCES) \ $(algo_test_power_SOURCES) $(algo_test_tropical_SOURCES) \ $(fst_test_SOURCES) $(weight_test_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__tty_colors_dummy = \ mgn= red= grn= lgn= blu= brg= std=; \ am__color_tests=no am__tty_colors = { \ $(am__tty_colors_dummy); \ if test "X$(AM_COLOR_TESTS)" = Xno; then \ am__color_tests=no; \ elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ am__color_tests=yes; \ elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ am__color_tests=yes; \ fi; \ if test $$am__color_tests = yes; then \ red=''; \ grn=''; \ lgn=''; \ blu=''; \ mgn=''; \ brg=''; \ std=''; \ fi; \ } am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__recheck_rx = ^[ ]*:recheck:[ ]* am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* # A command that, given a newline-separated list of test names on the # standard input, print the name of the tests that are to be re-run # upon "make recheck". am__list_recheck_tests = $(AWK) '{ \ recheck = 1; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ { \ if ((getline line2 < ($$0 ".log")) < 0) \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ { \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ { \ break; \ } \ }; \ if (recheck) \ print $$0; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # A command that, given a newline-separated list of test names on the # standard input, create the global log from their .trs and .log files. am__create_global_log = $(AWK) ' \ function fatal(msg) \ { \ print "fatal: making $@: " msg | "cat >&2"; \ exit 1; \ } \ function rst_section(header) \ { \ print header; \ len = length(header); \ for (i = 1; i <= len; i = i + 1) \ printf "="; \ printf "\n\n"; \ } \ { \ copy_in_global_log = 1; \ global_test_result = "RUN"; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".trs"); \ if (line ~ /$(am__global_test_result_rx)/) \ { \ sub("$(am__global_test_result_rx)", "", line); \ sub("[ ]*$$", "", line); \ global_test_result = line; \ } \ else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ copy_in_global_log = 0; \ }; \ if (copy_in_global_log) \ { \ rst_section(global_test_result ": " $$0); \ while ((rc = (getline line < ($$0 ".log"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".log"); \ print line; \ }; \ printf "\n"; \ }; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # Restructured Text title. am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } # Solaris 10 'make', and several other traditional 'make' implementations, # pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it # by disabling -e (using the XSI extension "set +e") if it's set. am__sh_e_setup = case $$- in *e*) set +e;; esac # Default flags passed to test drivers. am__common_driver_flags = \ --color-tests "$$am__color_tests" \ --enable-hard-errors "$$am__enable_hard_errors" \ --expect-failure "$$am__expect_failure" # To be inserted before the command running the test. Creates the # directory for the log if needed. Stores in $dir the directory # containing $f, in $tst the test, in $log the log. Executes the # developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and # passes TESTS_ENVIRONMENT. Set up options for the wrapper that # will run the test scripts (or their associated LOG_COMPILER, if # thy have one). am__check_pre = \ $(am__sh_e_setup); \ $(am__vpath_adj_setup) $(am__vpath_adj) \ $(am__tty_colors); \ srcdir=$(srcdir); export srcdir; \ case "$@" in \ */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ *) am__odir=.;; \ esac; \ test "x$$am__odir" = x"." || test -d "$$am__odir" \ || $(MKDIR_P) "$$am__odir" || exit $$?; \ if test -f "./$$f"; then dir=./; \ elif test -f "$$f"; then dir=; \ else dir="$(srcdir)/"; fi; \ tst=$$dir$$f; log='$@'; \ if test -n '$(DISABLE_HARD_ERRORS)'; then \ am__enable_hard_errors=no; \ else \ am__enable_hard_errors=yes; \ fi; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ am__expect_failure=yes;; \ *) \ am__expect_failure=no;; \ esac; \ $(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) # A shell command to get the names of the tests scripts with any registered # extension removed (i.e., equivalently, the names of the test logs, with # the '.log' extension removed). The result is saved in the shell variable # '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, # we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", # since that might cause problem with VPATH rewrites for suffix-less tests. # See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. am__set_TESTS_bases = \ bases='$(TEST_LOGS)'; \ bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ bases=`echo $$bases` RECHECK_LOGS = $(TEST_LOGS) AM_RECURSIVE_TARGETS = check recheck TEST_SUITE_LOG = test-suite.log TEST_EXTENSIONS = @EXEEXT@ .test LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS) am__set_b = \ case '$@' in \ */*) \ case '$*' in \ */*) b='$*';; \ *) b=`echo '$@' | sed 's/\.log$$//'`; \ esac;; \ *) \ b='$*';; \ esac am__test_logs1 = $(TESTS:=.log) am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) TEST_LOGS = $(am__test_logs2:.test.log=.log) TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ $(TEST_LOG_FLAGS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PYTHON = @PYTHON@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@ PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_SITE_PKG = @PYTHON_SITE_PKG@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ libfstdir = @libfstdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CPPFLAGS = -I$(srcdir)/../include $(ICU_CPPFLAGS) LDADD = ../lib/libfst.la -lm $(DL_LIBS) fst_test_SOURCES = fst_test.cc fst_test.h weight_test_SOURCES = weight_test.cc weight-tester.h algo_test_SOURCES = algo_test.cc algo_test.h rand-fst.h algo_test_log_SOURCES = $(algo_test_SOURCES) algo_test_log_CPPFLAGS = -DTEST_LOG $(AM_CPPFLAGS) algo_test_tropical_SOURCES = $(algo_test_SOURCES) algo_test_tropical_CPPFLAGS = -DTEST_TROPICAL $(AM_CPPFLAGS) algo_test_minmax_SOURCES = $(algo_test_SOURCES) algo_test_minmax_CPPFLAGS = -DTEST_MINMAX $(AM_CPPFLAGS) algo_test_lexicographic_SOURCES = $(algo_test_SOURCES) algo_test_lexicographic_CPPFLAGS = -DTEST_LEXICOGRAPHIC $(AM_CPPFLAGS) algo_test_power_SOURCES = $(algo_test_SOURCES) algo_test_power_CPPFLAGS = -DTEST_POWER $(AM_CPPFLAGS) TESTS = $(check_PROGRAMS) all: all-am .SUFFIXES: .SUFFIXES: .cc .lo .log .o .obj .test .test$(EXEEXT) .trs $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/test/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign src/test/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-checkPROGRAMS: @list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list algo_test_lexicographic$(EXEEXT): $(algo_test_lexicographic_OBJECTS) $(algo_test_lexicographic_DEPENDENCIES) $(EXTRA_algo_test_lexicographic_DEPENDENCIES) @rm -f algo_test_lexicographic$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(algo_test_lexicographic_OBJECTS) $(algo_test_lexicographic_LDADD) $(LIBS) algo_test_log$(EXEEXT): $(algo_test_log_OBJECTS) $(algo_test_log_DEPENDENCIES) $(EXTRA_algo_test_log_DEPENDENCIES) @rm -f algo_test_log$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(algo_test_log_OBJECTS) $(algo_test_log_LDADD) $(LIBS) algo_test_minmax$(EXEEXT): $(algo_test_minmax_OBJECTS) $(algo_test_minmax_DEPENDENCIES) $(EXTRA_algo_test_minmax_DEPENDENCIES) @rm -f algo_test_minmax$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(algo_test_minmax_OBJECTS) $(algo_test_minmax_LDADD) $(LIBS) algo_test_power$(EXEEXT): $(algo_test_power_OBJECTS) $(algo_test_power_DEPENDENCIES) $(EXTRA_algo_test_power_DEPENDENCIES) @rm -f algo_test_power$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(algo_test_power_OBJECTS) $(algo_test_power_LDADD) $(LIBS) algo_test_tropical$(EXEEXT): $(algo_test_tropical_OBJECTS) $(algo_test_tropical_DEPENDENCIES) $(EXTRA_algo_test_tropical_DEPENDENCIES) @rm -f algo_test_tropical$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(algo_test_tropical_OBJECTS) $(algo_test_tropical_LDADD) $(LIBS) fst_test$(EXEEXT): $(fst_test_OBJECTS) $(fst_test_DEPENDENCIES) $(EXTRA_fst_test_DEPENDENCIES) @rm -f fst_test$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(fst_test_OBJECTS) $(fst_test_LDADD) $(LIBS) weight_test$(EXEEXT): $(weight_test_OBJECTS) $(weight_test_DEPENDENCIES) $(EXTRA_weight_test_DEPENDENCIES) @rm -f weight_test$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(weight_test_OBJECTS) $(weight_test_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/algo_test_lexicographic-algo_test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/algo_test_log-algo_test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/algo_test_minmax-algo_test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/algo_test_power-algo_test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/algo_test_tropical-algo_test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fst_test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/weight_test.Po@am__quote@ .cc.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cc.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cc.lo: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< algo_test_lexicographic-algo_test.o: algo_test.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(algo_test_lexicographic_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT algo_test_lexicographic-algo_test.o -MD -MP -MF $(DEPDIR)/algo_test_lexicographic-algo_test.Tpo -c -o algo_test_lexicographic-algo_test.o `test -f 'algo_test.cc' || echo '$(srcdir)/'`algo_test.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/algo_test_lexicographic-algo_test.Tpo $(DEPDIR)/algo_test_lexicographic-algo_test.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='algo_test.cc' object='algo_test_lexicographic-algo_test.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(algo_test_lexicographic_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o algo_test_lexicographic-algo_test.o `test -f 'algo_test.cc' || echo '$(srcdir)/'`algo_test.cc algo_test_lexicographic-algo_test.obj: algo_test.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(algo_test_lexicographic_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT algo_test_lexicographic-algo_test.obj -MD -MP -MF $(DEPDIR)/algo_test_lexicographic-algo_test.Tpo -c -o algo_test_lexicographic-algo_test.obj `if test -f 'algo_test.cc'; then $(CYGPATH_W) 'algo_test.cc'; else $(CYGPATH_W) '$(srcdir)/algo_test.cc'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/algo_test_lexicographic-algo_test.Tpo $(DEPDIR)/algo_test_lexicographic-algo_test.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='algo_test.cc' object='algo_test_lexicographic-algo_test.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(algo_test_lexicographic_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o algo_test_lexicographic-algo_test.obj `if test -f 'algo_test.cc'; then $(CYGPATH_W) 'algo_test.cc'; else $(CYGPATH_W) '$(srcdir)/algo_test.cc'; fi` algo_test_log-algo_test.o: algo_test.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(algo_test_log_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT algo_test_log-algo_test.o -MD -MP -MF $(DEPDIR)/algo_test_log-algo_test.Tpo -c -o algo_test_log-algo_test.o `test -f 'algo_test.cc' || echo '$(srcdir)/'`algo_test.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/algo_test_log-algo_test.Tpo $(DEPDIR)/algo_test_log-algo_test.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='algo_test.cc' object='algo_test_log-algo_test.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(algo_test_log_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o algo_test_log-algo_test.o `test -f 'algo_test.cc' || echo '$(srcdir)/'`algo_test.cc algo_test_log-algo_test.obj: algo_test.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(algo_test_log_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT algo_test_log-algo_test.obj -MD -MP -MF $(DEPDIR)/algo_test_log-algo_test.Tpo -c -o algo_test_log-algo_test.obj `if test -f 'algo_test.cc'; then $(CYGPATH_W) 'algo_test.cc'; else $(CYGPATH_W) '$(srcdir)/algo_test.cc'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/algo_test_log-algo_test.Tpo $(DEPDIR)/algo_test_log-algo_test.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='algo_test.cc' object='algo_test_log-algo_test.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(algo_test_log_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o algo_test_log-algo_test.obj `if test -f 'algo_test.cc'; then $(CYGPATH_W) 'algo_test.cc'; else $(CYGPATH_W) '$(srcdir)/algo_test.cc'; fi` algo_test_minmax-algo_test.o: algo_test.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(algo_test_minmax_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT algo_test_minmax-algo_test.o -MD -MP -MF $(DEPDIR)/algo_test_minmax-algo_test.Tpo -c -o algo_test_minmax-algo_test.o `test -f 'algo_test.cc' || echo '$(srcdir)/'`algo_test.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/algo_test_minmax-algo_test.Tpo $(DEPDIR)/algo_test_minmax-algo_test.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='algo_test.cc' object='algo_test_minmax-algo_test.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(algo_test_minmax_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o algo_test_minmax-algo_test.o `test -f 'algo_test.cc' || echo '$(srcdir)/'`algo_test.cc algo_test_minmax-algo_test.obj: algo_test.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(algo_test_minmax_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT algo_test_minmax-algo_test.obj -MD -MP -MF $(DEPDIR)/algo_test_minmax-algo_test.Tpo -c -o algo_test_minmax-algo_test.obj `if test -f 'algo_test.cc'; then $(CYGPATH_W) 'algo_test.cc'; else $(CYGPATH_W) '$(srcdir)/algo_test.cc'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/algo_test_minmax-algo_test.Tpo $(DEPDIR)/algo_test_minmax-algo_test.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='algo_test.cc' object='algo_test_minmax-algo_test.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(algo_test_minmax_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o algo_test_minmax-algo_test.obj `if test -f 'algo_test.cc'; then $(CYGPATH_W) 'algo_test.cc'; else $(CYGPATH_W) '$(srcdir)/algo_test.cc'; fi` algo_test_power-algo_test.o: algo_test.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(algo_test_power_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT algo_test_power-algo_test.o -MD -MP -MF $(DEPDIR)/algo_test_power-algo_test.Tpo -c -o algo_test_power-algo_test.o `test -f 'algo_test.cc' || echo '$(srcdir)/'`algo_test.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/algo_test_power-algo_test.Tpo $(DEPDIR)/algo_test_power-algo_test.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='algo_test.cc' object='algo_test_power-algo_test.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(algo_test_power_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o algo_test_power-algo_test.o `test -f 'algo_test.cc' || echo '$(srcdir)/'`algo_test.cc algo_test_power-algo_test.obj: algo_test.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(algo_test_power_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT algo_test_power-algo_test.obj -MD -MP -MF $(DEPDIR)/algo_test_power-algo_test.Tpo -c -o algo_test_power-algo_test.obj `if test -f 'algo_test.cc'; then $(CYGPATH_W) 'algo_test.cc'; else $(CYGPATH_W) '$(srcdir)/algo_test.cc'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/algo_test_power-algo_test.Tpo $(DEPDIR)/algo_test_power-algo_test.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='algo_test.cc' object='algo_test_power-algo_test.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(algo_test_power_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o algo_test_power-algo_test.obj `if test -f 'algo_test.cc'; then $(CYGPATH_W) 'algo_test.cc'; else $(CYGPATH_W) '$(srcdir)/algo_test.cc'; fi` algo_test_tropical-algo_test.o: algo_test.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(algo_test_tropical_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT algo_test_tropical-algo_test.o -MD -MP -MF $(DEPDIR)/algo_test_tropical-algo_test.Tpo -c -o algo_test_tropical-algo_test.o `test -f 'algo_test.cc' || echo '$(srcdir)/'`algo_test.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/algo_test_tropical-algo_test.Tpo $(DEPDIR)/algo_test_tropical-algo_test.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='algo_test.cc' object='algo_test_tropical-algo_test.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(algo_test_tropical_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o algo_test_tropical-algo_test.o `test -f 'algo_test.cc' || echo '$(srcdir)/'`algo_test.cc algo_test_tropical-algo_test.obj: algo_test.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(algo_test_tropical_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT algo_test_tropical-algo_test.obj -MD -MP -MF $(DEPDIR)/algo_test_tropical-algo_test.Tpo -c -o algo_test_tropical-algo_test.obj `if test -f 'algo_test.cc'; then $(CYGPATH_W) 'algo_test.cc'; else $(CYGPATH_W) '$(srcdir)/algo_test.cc'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/algo_test_tropical-algo_test.Tpo $(DEPDIR)/algo_test_tropical-algo_test.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='algo_test.cc' object='algo_test_tropical-algo_test.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(algo_test_tropical_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o algo_test_tropical-algo_test.obj `if test -f 'algo_test.cc'; then $(CYGPATH_W) 'algo_test.cc'; else $(CYGPATH_W) '$(srcdir)/algo_test.cc'; fi` mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags # Recover from deleted '.trs' file; this should ensure that # "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create # both 'foo.log' and 'foo.trs'. Break the recipe in two subshells # to avoid problems with "make -n". .log.trs: rm -f $< $@ $(MAKE) $(AM_MAKEFLAGS) $< # Leading 'am--fnord' is there to ensure the list of targets does not # expand to empty, as could happen e.g. with make check TESTS=''. am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) am--force-recheck: @: $(TEST_SUITE_LOG): $(TEST_LOGS) @$(am__set_TESTS_bases); \ am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ redo_bases=`for i in $$bases; do \ am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ done`; \ if test -n "$$redo_bases"; then \ redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ if $(am__make_dryrun); then :; else \ rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ fi; \ fi; \ if test -n "$$am__remaking_logs"; then \ echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ "recursion detected" >&2; \ else \ am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ fi; \ if $(am__make_dryrun); then :; else \ st=0; \ errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ for i in $$redo_bases; do \ test -f $$i.trs && test -r $$i.trs \ || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ test -f $$i.log && test -r $$i.log \ || { echo "$$errmsg $$i.log" >&2; st=1; }; \ done; \ test $$st -eq 0 || exit 1; \ fi @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ ws='[ ]'; \ results=`for b in $$bases; do echo $$b.trs; done`; \ test -n "$$results" || results=/dev/null; \ all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ if test `expr $$fail + $$xpass + $$error` -eq 0; then \ success=true; \ else \ success=false; \ fi; \ br='==================='; br=$$br$$br$$br$$br; \ result_count () \ { \ if test x"$$1" = x"--maybe-color"; then \ maybe_colorize=yes; \ elif test x"$$1" = x"--no-color"; then \ maybe_colorize=no; \ else \ echo "$@: invalid 'result_count' usage" >&2; exit 4; \ fi; \ shift; \ desc=$$1 count=$$2; \ if test $$maybe_colorize = yes && test $$count -gt 0; then \ color_start=$$3 color_end=$$std; \ else \ color_start= color_end=; \ fi; \ echo "$${color_start}# $$desc $$count$${color_end}"; \ }; \ create_testsuite_report () \ { \ result_count $$1 "TOTAL:" $$all "$$brg"; \ result_count $$1 "PASS: " $$pass "$$grn"; \ result_count $$1 "SKIP: " $$skip "$$blu"; \ result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ result_count $$1 "FAIL: " $$fail "$$red"; \ result_count $$1 "XPASS:" $$xpass "$$red"; \ result_count $$1 "ERROR:" $$error "$$mgn"; \ }; \ { \ echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ $(am__rst_title); \ create_testsuite_report --no-color; \ echo; \ echo ".. contents:: :depth: 2"; \ echo; \ for b in $$bases; do echo $$b; done \ | $(am__create_global_log); \ } >$(TEST_SUITE_LOG).tmp || exit 1; \ mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ if $$success; then \ col="$$grn"; \ else \ col="$$red"; \ test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ fi; \ echo "$${col}$$br$${std}"; \ echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \ echo "$${col}$$br$${std}"; \ create_testsuite_report --maybe-color; \ echo "$$col$$br$$std"; \ if $$success; then :; else \ echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \ if test -n "$(PACKAGE_BUGREPORT)"; then \ echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \ fi; \ echo "$$col$$br$$std"; \ fi; \ $$success || exit 1 check-TESTS: @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ log_list=`for i in $$bases; do echo $$i.log; done`; \ trs_list=`for i in $$bases; do echo $$i.trs; done`; \ log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ exit $$?; recheck: all $(check_PROGRAMS) @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ bases=`for i in $$bases; do echo $$i; done \ | $(am__list_recheck_tests)` || exit 1; \ log_list=`for i in $$bases; do echo $$i.log; done`; \ log_list=`echo $$log_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ am__force_recheck=am--force-recheck \ TEST_LOGS="$$log_list"; \ exit $$? fst_test.log: fst_test$(EXEEXT) @p='fst_test$(EXEEXT)'; \ b='fst_test'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) weight_test.log: weight_test$(EXEEXT) @p='weight_test$(EXEEXT)'; \ b='weight_test'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) algo_test_log.log: algo_test_log$(EXEEXT) @p='algo_test_log$(EXEEXT)'; \ b='algo_test_log'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) algo_test_tropical.log: algo_test_tropical$(EXEEXT) @p='algo_test_tropical$(EXEEXT)'; \ b='algo_test_tropical'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) algo_test_minmax.log: algo_test_minmax$(EXEEXT) @p='algo_test_minmax$(EXEEXT)'; \ b='algo_test_minmax'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) algo_test_lexicographic.log: algo_test_lexicographic$(EXEEXT) @p='algo_test_lexicographic$(EXEEXT)'; \ b='algo_test_lexicographic'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) algo_test_power.log: algo_test_power$(EXEEXT) @p='algo_test_power$(EXEEXT)'; \ b='algo_test_power'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) .test.log: @p='$<'; \ $(am__set_b); \ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) @am__EXEEXT_TRUE@.test$(EXEEXT).log: @am__EXEEXT_TRUE@ @p='$<'; \ @am__EXEEXT_TRUE@ $(am__set_b); \ @am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ @am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ @am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ @am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS) -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs) -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-checkPROGRAMS clean-generic clean-libtool \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: check-am install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-TESTS check-am clean \ clean-checkPROGRAMS clean-generic clean-libtool cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ recheck tags tags-am uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT:
0
coqui_public_repos/inference-engine/third_party/kenlm/lm
coqui_public_repos/inference-engine/third_party/kenlm/lm/interpolate/interpolate_info.hh
#ifndef KENLM_INTERPOLATE_INTERPOLATE_INFO_H #define KENLM_INTERPOLATE_INTERPOLATE_INFO_H #include <cstddef> #include <vector> #include <stdint.h> namespace lm { namespace interpolate { /** * Stores relevant info for interpolating several language models, for use * during the three-pass offline log-linear interpolation algorithm. */ struct InterpolateInfo { /** * @return the number of models being interpolated */ std::size_t Models() const { return orders.size(); } /** * The lambda (interpolation weight) for each model. */ std::vector<float> lambdas; /** * The maximum ngram order for each model. */ std::vector<uint8_t> orders; }; } } #endif
0
coqui_public_repos/inference-engine/third_party/openfst-1.6.7/src/include
coqui_public_repos/inference-engine/third_party/openfst-1.6.7/src/include/fst/visit.h
// See www.openfst.org for extensive documentation on this weighted // finite-state transducer library. // // Queue-dependent visitation of finite-state transducers. See also dfs-visit.h. #ifndef FST_VISIT_H_ #define FST_VISIT_H_ #include <fst/arcfilter.h> #include <fst/mutable-fst.h> namespace fst { // Visitor Interface: class determining actions taken during a visit. If any of // the boolean member functions return false, the visit is aborted by first // calling FinishState() on all unfinished (grey) states and then calling // FinishVisit(). // // Note this is more general than the visitor interface in dfs-visit.h but lacks // some DFS-specific behavior. // // template <class Arc> // class Visitor { // public: // using StateId = typename Arc::StateId; // // Visitor(T *return_data); // // // Invoked before visit. // void InitVisit(const Fst<Arc> &fst); // // // Invoked when state discovered (2nd arg is visitation root). // bool InitState(StateId s, StateId root); // // // Invoked when arc to white/undiscovered state examined. // bool WhiteArc(StateId s, const Arc &arc); // // // Invoked when arc to grey/unfinished state examined. // bool GreyArc(StateId s, const Arc &arc); // // // Invoked when arc to black/finished state examined. // bool BlackArc(StateId s, const Arc &arc); // // // Invoked when state finished. // void FinishState(StateId s); // // // Invoked after visit. // void FinishVisit(); // }; // Performs queue-dependent visitation. Visitor class argument determines // actions and contains any return data. ArcFilter determines arcs that are // considered. If 'access_only' is true, performs visitation only to states // accessible from the initial state. template <class FST, class Visitor, class Queue, class ArcFilter> void Visit(const FST &fst, Visitor *visitor, Queue *queue, ArcFilter filter, bool access_only = false) { using Arc = typename FST::Arc; using StateId = typename Arc::StateId; visitor->InitVisit(fst); const auto start = fst.Start(); if (start == kNoStateId) { visitor->FinishVisit(); return; } // An FST's state's visit color. static constexpr uint8 kWhiteState = 0x01; // Undiscovered. static constexpr uint8 kGreyState = 0x02; // Discovered & unfinished. static constexpr uint8 kBlackState = 0x04; // Finished. // We destroy an iterator as soon as possible and mark it so. static constexpr uint8 kArcIterDone = 0x08; std::vector<uint8> state_status; std::vector<ArcIterator<FST> *> arc_iterator; MemoryPool<ArcIterator<FST>> aiter_pool; StateId nstates = start + 1; // Number of known states in general case. bool expanded = false; if (fst.Properties(kExpanded, false)) { // Tests if expanded, then uses nstates = CountStates(fst); // ExpandedFst::NumStates(). expanded = true; } state_status.resize(nstates, kWhiteState); arc_iterator.resize(nstates); StateIterator<Fst<Arc>> siter(fst); // Continues visit while true. bool visit = true; // Iterates over trees in visit forest. for (auto root = start; visit && root < nstates;) { visit = visitor->InitState(root, root); state_status[root] = kGreyState; queue->Enqueue(root); while (!queue->Empty()) { auto state = queue->Head(); if (state >= state_status.size()) { nstates = state + 1; state_status.resize(nstates, kWhiteState); arc_iterator.resize(nstates); } // Creates arc iterator if needed. if (!arc_iterator[state] && !(state_status[state] & kArcIterDone) && visit) { arc_iterator[state] = new (&aiter_pool) ArcIterator<FST>(fst, state); } // Deletes arc iterator if done. auto *aiter = arc_iterator[state]; if ((aiter && aiter->Done()) || !visit) { Destroy(aiter, &aiter_pool); arc_iterator[state] = nullptr; state_status[state] |= kArcIterDone; } // Dequeues state and marks black if done. if (state_status[state] & kArcIterDone) { queue->Dequeue(); visitor->FinishState(state); state_status[state] = kBlackState; continue; } const auto &arc = aiter->Value(); if (arc.nextstate >= state_status.size()) { nstates = arc.nextstate + 1; state_status.resize(nstates, kWhiteState); arc_iterator.resize(nstates); } // Visits respective arc types. if (filter(arc)) { // Enqueues destination state and marks grey if white. if (state_status[arc.nextstate] == kWhiteState) { visit = visitor->WhiteArc(state, arc); if (!visit) continue; visit = visitor->InitState(arc.nextstate, root); state_status[arc.nextstate] = kGreyState; queue->Enqueue(arc.nextstate); } else if (state_status[arc.nextstate] == kBlackState) { visit = visitor->BlackArc(state, arc); } else { visit = visitor->GreyArc(state, arc); } } aiter->Next(); // Destroys an iterator ASAP for efficiency. if (aiter->Done()) { Destroy(aiter, &aiter_pool); arc_iterator[state] = nullptr; state_status[state] |= kArcIterDone; } } if (access_only) break; // Finds next tree root. for (root = (root == start) ? 0 : root + 1; root < nstates && state_status[root] != kWhiteState; ++root) { } // Check for a state beyond the largest known state. if (!expanded && root == nstates) { for (; !siter.Done(); siter.Next()) { if (siter.Value() == nstates) { ++nstates; state_status.push_back(kWhiteState); arc_iterator.push_back(nullptr); break; } } } } visitor->FinishVisit(); } template <class Arc, class Visitor, class Queue> inline void Visit(const Fst<Arc> &fst, Visitor *visitor, Queue *queue) { Visit(fst, visitor, queue, AnyArcFilter<Arc>()); } // Copies input FST to mutable FST following queue order. template <class A> class CopyVisitor { public: using Arc = A; using StateId = typename Arc::StateId; explicit CopyVisitor(MutableFst<Arc> *ofst) : ifst_(nullptr), ofst_(ofst) {} void InitVisit(const Fst<A> &ifst) { ifst_ = &ifst; ofst_->DeleteStates(); ofst_->SetStart(ifst_->Start()); } bool InitState(StateId state, StateId) { while (ofst_->NumStates() <= state) ofst_->AddState(); return true; } bool WhiteArc(StateId state, const Arc &arc) { ofst_->AddArc(state, arc); return true; } bool GreyArc(StateId state, const Arc &arc) { ofst_->AddArc(state, arc); return true; } bool BlackArc(StateId state, const Arc &arc) { ofst_->AddArc(state, arc); return true; } void FinishState(StateId state) { ofst_->SetFinal(state, ifst_->Final(state)); } void FinishVisit() {} private: const Fst<Arc> *ifst_; MutableFst<Arc> *ofst_; }; // Visits input FST up to a state limit following queue order. template <class A> class PartialVisitor { public: using Arc = A; using StateId = typename Arc::StateId; explicit PartialVisitor(StateId maxvisit) : fst_(nullptr), maxvisit_(maxvisit) {} void InitVisit(const Fst<A> &ifst) { fst_ = &ifst; ninit_ = 0; nfinish_ = 0; } bool InitState(StateId state, StateId root) { ++ninit_; return ninit_ <= maxvisit_; } bool WhiteArc(StateId state, const Arc &arc) { return true; } bool GreyArc(StateId state, const Arc &arc) { return true; } bool BlackArc(StateId state, const Arc &arc) { return true; } void FinishState(StateId state) { fst_->Final(state); // Visits super-final arc. ++nfinish_; } void FinishVisit() {} StateId NumInitialized() { return ninit_; } StateId NumFinished() { return nfinish_; } private: const Fst<Arc> *fst_; StateId maxvisit_; StateId ninit_; StateId nfinish_; }; // Copies input FST to mutable FST up to a state limit following queue order. template <class A> class PartialCopyVisitor : public CopyVisitor<A> { public: using Arc = A; using StateId = typename Arc::StateId; using CopyVisitor<A>::WhiteArc; PartialCopyVisitor(MutableFst<Arc> *ofst, StateId maxvisit, bool copy_grey = true, bool copy_black = true) : CopyVisitor<A>(ofst), maxvisit_(maxvisit), copy_grey_(copy_grey), copy_black_(copy_black) {} void InitVisit(const Fst<A> &ifst) { CopyVisitor<A>::InitVisit(ifst); ninit_ = 0; nfinish_ = 0; } bool InitState(StateId state, StateId root) { CopyVisitor<A>::InitState(state, root); ++ninit_; return ninit_ <= maxvisit_; } bool GreyArc(StateId state, const Arc &arc) { if (copy_grey_) return CopyVisitor<A>::GreyArc(state, arc); return true; } bool BlackArc(StateId state, const Arc &arc) { if (copy_black_) return CopyVisitor<A>::BlackArc(state, arc); return true; } void FinishState(StateId state) { CopyVisitor<A>::FinishState(state); ++nfinish_; } void FinishVisit() {} StateId NumInitialized() { return ninit_; } StateId NumFinished() { return nfinish_; } private: StateId maxvisit_; StateId ninit_; StateId nfinish_; const bool copy_grey_; const bool copy_black_; }; } // namespace fst #endif // FST_VISIT_H_
0
coqui_public_repos/TTS/docs
coqui_public_repos/TTS/docs/source/installation.md
# Installation 🐸TTS supports python >=3.7 <3.11.0 and tested on Ubuntu 18.10, 19.10, 20.10. ## Using `pip` `pip` is recommended if you want to use 🐸TTS only for inference. You can install from PyPI as follows: ```bash pip install TTS # from PyPI ``` Or install from Github: ```bash pip install git+https://github.com/coqui-ai/TTS # from Github ``` ## Installing From Source This is recommended for development and more control over 🐸TTS. ```bash git clone https://github.com/coqui-ai/TTS/ cd TTS make system-deps # only on Linux systems. make install ``` ## On Windows If you are on Windows, 👑@GuyPaddock wrote installation instructions [here](https://stackoverflow.com/questions/66726331/
0
coqui_public_repos/TTS/TTS/tts
coqui_public_repos/TTS/TTS/tts/configs/tortoise_config.py
from dataclasses import dataclass, field from TTS.tts.configs.shared_configs import BaseTTSConfig from TTS.tts.models.tortoise import TortoiseArgs, TortoiseAudioConfig @dataclass class TortoiseConfig(BaseTTSConfig): """Defines parameters for Tortoise TTS model. Args: model (str): Model name. Do not change unless you know what you are doing. model_args (TortoiseArgs): Model architecture arguments. Defaults to `TortoiseArgs()`. audio (TortoiseAudioConfig): Audio processing configuration. Defaults to `TortoiseAudioConfig()`. model_dir (str): Path to the folder that has all the Tortoise models. Defaults to None. temperature (float): Temperature for the autoregressive model inference. Larger values makes predictions more creative sacrificing stability. Defaults to `0.2`. length_penalty (float): Exponential penalty to the length that is used with beam-based generation. It is applied as an exponent to the sequence length, which in turn is used to divide the score of the sequence. Since the score is the log likelihood of the sequence (i.e. negative), length_penalty > 0.0 promotes longer sequences, while length_penalty < 0.0 encourages shorter sequences. reperation_penalty (float): The parameter for repetition penalty. 1.0 means no penalty. Defaults to `2.0`. top_p (float): If set to float < 1, only the smallest set of most probable tokens with probabilities that add up to top_p or higher are kept for generation. Defaults to `0.8`. cond_free_k (float): Knob that determines how to balance the conditioning free signal with the conditioning-present signal. [0,inf]. As cond_free_k increases, the output becomes dominated by the conditioning-free signal. Formula is: output=cond_present_output*(cond_free_k+1)-cond_absenct_output*cond_free_k. Defaults to `2.0`. diffusion_temperature (float): Controls the variance of the noise fed into the diffusion model. [0,1]. Values at 0 are the "mean" prediction of the diffusion network and will sound bland and smeared. Defaults to `1.0`. num_autoregressive_samples (int): Number of samples taken from the autoregressive model, all of which are filtered using CLVP. As Tortoise is a probabilistic model, more samples means a higher probability of creating something "great". Defaults to `16`. diffusion_iterations (int): Number of diffusion steps to perform. [0,4000]. More steps means the network has more chances to iteratively refine the output, which should theoretically mean a higher quality output. Generally a value above 250 is not noticeably better, however. Defaults to `30`. sampler (str): Diffusion sampler to be used. `ddim` or `dpm++2m`. Defaults to `ddim`. Note: Check :class:`TTS.tts.configs.shared_configs.BaseTTSConfig` for the inherited parameters. Example: >>> from TTS.tts.configs.tortoise_config import TortoiseConfig >>> config = TortoiseConfig() """ model: str = "tortoise" # model specific params model_args: TortoiseArgs = field(default_factory=TortoiseArgs) audio: TortoiseAudioConfig = field(default_factory=TortoiseAudioConfig) model_dir: str = None # settings temperature: float = 0.2 length_penalty: float = 1.0 repetition_penalty: float = 2.0 top_p: float = 0.8 cond_free_k: float = 2.0 diffusion_temperature: float = 1.0 # inference params num_autoregressive_samples: int = 16 diffusion_iterations: int = 30 sampler: str = "ddim"
0
coqui_public_repos/Trainer
coqui_public_repos/Trainer/examples/train_simple_gan.py
""" This example shows training of a simple GAN model with MNIST dataset using Gradient Accumulation and Advanced Optimization where you call optimizer steps manually. """ import os from dataclasses import dataclass import numpy as np import torch from torch import nn from torch.utils.data import DataLoader from torchvision import transforms from torchvision.datasets import MNIST from trainer import Trainer, TrainerConfig, TrainerModel from trainer.trainer import TrainerArgs is_cuda = torch.cuda.is_available() # pylint: skip-file class Generator(nn.Module): def __init__(self, latent_dim, img_shape): super().__init__() self.img_shape = img_shape def block(in_feat, out_feat, normalize=True): layers = [nn.Linear(in_feat, out_feat)] if normalize: layers.append(nn.BatchNorm1d(out_feat, 0.8)) layers.append(nn.LeakyReLU(0.2, inplace=True)) return layers self.model = nn.Sequential( *block(latent_dim, 128, normalize=False), *block(128, 256), *block(256, 512), *block(512, 1024), nn.Linear(1024, int(np.prod(img_shape))), nn.Tanh(), ) def forward(self, z): img = self.model(z) img = img.view(img.size(0), *self.img_shape) return img class Discriminator(nn.Module): def __init__(self, img_shape): super().__init__() self.model = nn.Sequential( nn.Linear(int(np.prod(img_shape)), 512), nn.LeakyReLU(0.2, inplace=True), nn.Linear(512, 256), nn.LeakyReLU(0.2, inplace=True), nn.Linear(256, 1), nn.Sigmoid(), ) def forward(self, img): img_flat = img.view(img.size(0), -1) validity = self.model(img_flat) return validity @dataclass class GANModelConfig(TrainerConfig): epochs: int = 1 print_step: int = 2 training_seed: int = 666 class GANModel(TrainerModel): def __init__(self): super().__init__() data_shape = (1, 28, 28) self.generator = Generator(latent_dim=100, img_shape=data_shape) self.discriminator = Discriminator(img_shape=data_shape) def forward(self, x): ... def optimize(self, batch, trainer): imgs, _ = batch # sample noise z = torch.randn(imgs.shape[0], 100) z = z.type_as(imgs) # train discriminator imgs_gen = self.generator(z) logits = self.discriminator(imgs_gen.detach()) fake = torch.zeros(imgs.size(0), 1) fake = fake.type_as(imgs) loss_fake = trainer.criterion(logits, fake) valid = torch.ones(imgs.size(0), 1) valid = valid.type_as(imgs) logits = self.discriminator(imgs) loss_real = trainer.criterion(logits, valid) loss_disc = (loss_real + loss_fake) / 2 # step dicriminator _, _ = self.scaled_backward(loss_disc, None, trainer, trainer.optimizer[0]) if trainer.total_steps_done % trainer.grad_accum_steps == 0: trainer.optimizer[0].step() trainer.optimizer[0].zero_grad() # train generator imgs_gen = self.generator(z) valid = torch.ones(imgs.size(0), 1) valid = valid.type_as(imgs) logits = self.discriminator(imgs_gen) loss_gen = trainer.criterion(logits, valid) # step generator _, _ = self.scaled_backward(loss_gen, None, trainer, trainer.optimizer[1]) if trainer.total_steps_done % trainer.grad_accum_steps == 0: trainer.optimizer[1].step() trainer.optimizer[1].zero_grad() return {"model_outputs": logits}, {"loss_gen": loss_gen, "loss_disc": loss_disc} @torch.no_grad() def eval_step(self, batch, criterion): imgs, _ = batch # sample noise z = torch.randn(imgs.shape[0], 100) z = z.type_as(imgs) imgs_gen = self.generator(z) valid = torch.ones(imgs.size(0), 1) valid = valid.type_as(imgs) logits = self.discriminator(imgs_gen) loss_gen = trainer.criterion(logits, valid) return {"model_outputs": logits}, {"loss_gen": loss_gen} def get_optimizer(self): discriminator_optimizer = torch.optim.Adam(self.discriminator.parameters(), lr=0.0001, betas=(0.5, 0.999)) generator_optimizer = torch.optim.Adam(self.generator.parameters(), lr=0.001, betas=(0.5, 0.999)) return [discriminator_optimizer, generator_optimizer] def get_criterion(self): return nn.BCELoss() def get_data_loader( self, config, assets, is_eval, samples, verbose, num_gpus, rank=0 ): # pylint: disable=unused-argument transform = transforms.Compose([transforms.ToTensor(), transforms.Normalize((0.1307,), (0.3081,))]) dataset = MNIST(os.getcwd(), train=not is_eval, download=True, transform=transform) dataset.data = dataset.data[:64] dataset.targets = dataset.targets[:64] dataloader = DataLoader(dataset, batch_size=config.batch_size, drop_last=True, shuffle=True) return dataloader if __name__ == "__main__": config = GANModelConfig() config.batch_size = 64 config.grad_clip = None model = GANModel() trainer = Trainer(TrainerArgs(), config, model=model, output_path=os.getcwd(), gpu=0 if is_cuda else None) trainer.config.epochs = 10 trainer.fit()
0
coqui_public_repos/STT-examples
coqui_public_repos/STT-examples/vad_transcriber/requirements.txt
stt==1.0.0 webrtcvad pyqt5
0
coqui_public_repos/STT
coqui_public_repos/STT/bin/run-ci-ldc93s1-webdataset.sh
#!/bin/sh set -xe if [ ! -f train.py ]; then echo "Please make sure you run this from STT's top level directory." exit 1 fi; if [ ! -f "data/smoke_test/ldc93s1.csv" ]; then echo "Downloading and preprocessing LDC93S1 example data, saving in ./data/smoke_test." python -u bin/import_ldc93s1.py ./data/smoke_test fi; checkpoint_dir="$HOME/.local/share/stt/ldc93s1" # Force only one visible device because we have a single-sample dataset # and when trying to run on multiple devices (like GPUs), this will break export CUDA_VISIBLE_DEVICES=0 python -m coqui_stt_training.train \ --alphabet_config_path "data/alphabet.txt" \ --show_progressbar false \ --train_files data/smoke_test/ldc93s1_wds.tar \ --test_files data/smoke_test/ldc93s1_wds.tar \ --train_batch_size 1 \ --test_batch_size 1 \ --n_hidden 100 \ --epochs 200 \ --checkpoint_dir "$checkpoint_dir" \ "$@"
0
coqui_public_repos/STT/native_client/ctcdecode/third_party/openfst-1.6.9-win/src
coqui_public_repos/STT/native_client/ctcdecode/third_party/openfst-1.6.9-win/src/script/difference.cc
// See www.openfst.org for extensive documentation on this weighted // finite-state transducer library. #include <fst/script/fst-class.h> #include <fst/script/difference.h> #include <fst/script/script-impl.h> namespace fst { namespace script { void Difference(const FstClass &ifst1, const FstClass &ifst2, MutableFstClass *ofst, const ComposeOptions &opts) { if (!internal::ArcTypesMatch(ifst1, ifst2, "Difference") || !internal::ArcTypesMatch(*ofst, ifst1, "Difference")) { ofst->SetProperties(kError, kError); return; } DifferenceArgs args(ifst1, ifst2, ofst, opts); Apply<Operation<DifferenceArgs>>("Difference", ifst1.ArcType(), &args); } REGISTER_FST_OPERATION(Difference, StdArc, DifferenceArgs); REGISTER_FST_OPERATION(Difference, LogArc, DifferenceArgs); REGISTER_FST_OPERATION(Difference, Log64Arc, DifferenceArgs); } // namespace script } // namespace fst
0
coqui_public_repos/STT/native_client/kenlm/lm
coqui_public_repos/STT/native_client/kenlm/lm/common/size_option.hh
#include <boost/program_options.hpp> #include <cstddef> #include <string> namespace lm { // Create a boost program option for data sizes. This parses sizes like 1T and 10k. boost::program_options::typed_value<std::string> *SizeOption(std::size_t &to, const char *default_value); } // namespace lm
0
coqui_public_repos/inference-engine/third_party/onnxruntime/include/onnxruntime/core
coqui_public_repos/inference-engine/third_party/onnxruntime/include/onnxruntime/core/session/onnxruntime_run_options_config_keys.h
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. #pragma once /* * This file defines RunOptions Config Keys and format of the Config Values. * * The Naming Convention for a RunOptions Config Key, * "[Area][.[SubArea1].[SubArea2]...].[Keyname]" * Such as "ep.cuda.use_arena" * The Config Key cannot be empty * The maximum length of the Config Key is 128 * * The string format of a RunOptions Config Value is defined individually for each Config. * The maximum length of the Config Value is 1024 */ // Key for enabling shrinkages of user listed device memory arenas. // Expects a list of semi-colon separated key value pairs separated by colon in the following format: // "device_0:device_id_0;device_1:device_id_1" // No white-spaces allowed in the provided list string. // Currently, the only supported devices are : "cpu", "gpu" (case sensitive). // If "cpu" is included in the list, DisableCpuMemArena() API must not be called (i.e.) arena for cpu should be enabled. // Example usage: "cpu:0;gpu:0" (or) "gpu:0" // By default, the value for this key is empty (i.e.) no memory arenas are shrunk static const char* const kOrtRunOptionsConfigEnableMemoryArenaShrinkage = "memory.enable_memory_arena_shrinkage";
0
coqui_public_repos/inference-engine/third_party/openfst-1.6.7/src/extensions
coqui_public_repos/inference-engine/third_party/openfst-1.6.7/src/extensions/far/Makefile.am
AM_CPPFLAGS = -I$(srcdir)/../../include $(ICU_CPPFLAGS) if HAVE_SCRIPT lib_LTLIBRARIES = libfstfar.la libfstfarscript.la else lib_LTLIBRARIES = libfstfar.la endif libfstfar_la_SOURCES = sttable.cc stlist.cc libfstfar_la_LDFLAGS = -version-info 10:0:0 libfstfar_la_LIBADD = ../../lib/libfst.la -lm $(DL_LIBS) if HAVE_SCRIPT libfstfarscript_la_SOURCES = far-class.cc farscript.cc getters.cc script-impl.cc \ strings.cc libfstfarscript_la_LDFLAGS = -version-info 10:0:0 libfstfarscript_la_LIBADD = \ libfstfar.la ../../script/libfstscript.la \ ../../lib/libfst.la -lm $(DL_LIBS) endif if HAVE_BIN bin_PROGRAMS = farcompilestrings farcreate farequal farextract farinfo \ farisomorphic farprintstrings LDADD = libfstfarscript.la ../../script/libfstscript.la \ ../../lib/libfst.la -lm $(DL_LIBS) farcompilestrings_SOURCES = farcompilestrings.cc farcreate_SOURCES = farcreate.cc farequal_SOURCES = farequal.cc farextract_SOURCES = farextract.cc farinfo_SOURCES = farinfo.cc farisomorphic_SOURCES = farisomorphic.cc farprintstrings_SOURCES = farprintstrings.cc endif
0
coqui_public_repos/STT/native_client/java
coqui_public_repos/STT/native_client/java/app/build.gradle
apply plugin: 'com.android.application' android { compileSdkVersion 27 defaultConfig { applicationId "ai.coqui.sttexampleapp" minSdkVersion 21 targetSdkVersion 27 versionName androidGitVersion.name() versionCode androidGitVersion.code() testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" setProperty("archivesBaseName", "${archivesBaseName}-${dsVersionString}") } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } adbOptions { timeOutInMs 30 * 60 * 1000 // 10 minutes installOptions "-d","-t" } } dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation project(':libstt') implementation 'com.android.support:appcompat-v7:27.1.1' implementation 'com.android.support.constraint:constraint-layout:1.1.3' testImplementation 'junit:junit:4.12' androidTestImplementation 'com.android.support.test:runner:1.0.2' androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' }
0
coqui_public_repos/STT-examples
coqui_public_repos/STT-examples/ffmpeg_vad_streaming/test.sh
#!/bin/bash set -xe THIS=$(dirname "$0") pushd ${THIS} source ../tests.sh npm install $(get_npm_package_url) npm install node ./index.js --audio $HOME/STT/audio/2830-3980-0043.wav \ --model $HOME/STT/models/model.tflite \ --scorer $HOME/STT/models/huge-vocab.scorer node ./index.js --audio $HOME/STT/audio/4507-16021-0012.wav \ --model $HOME/STT/models/model.tflite \ --scorer $HOME/STT/models/huge-vocab.scorer node ./index.js --audio $HOME/STT/audio/8455-210777-0068.wav \ --model $HOME/STT/models/model.tflite \ --scorer $HOME/STT/models/huge-vocab.scorer popd
0
coqui_public_repos/inference-engine/third_party/openfst-1.6.9-win/src/include
coqui_public_repos/inference-engine/third_party/openfst-1.6.9-win/src/include/fst/partition.h
// See www.openfst.org for extensive documentation on this weighted // finite-state transducer library. // // Functions and classes to create a partition of states. #ifndef FST_PARTITION_H_ #define FST_PARTITION_H_ #include <algorithm> #include <vector> #include <fst/queue.h> namespace fst { namespace internal { template <typename T> class PartitionIterator; // Defines a partitioning of elements, used to represent equivalence classes // for FST operations like minimization. T must be a signed integer type. // // The elements are numbered from 0 to num_elements - 1. // Initialize(num_elements) sets up the class for a given number of elements. // We maintain a partition of these elements into classes. The classes are also // numbered from zero; you can add a class with AddClass(), or add them in bulk // with AllocateClasses(num_classes). Initially the elements are not assigned // to any class; you set up the initial mapping from elements to classes by // calling Add(element_id, class_id). You can also move an element to a // different class by calling Move(element_id, class_id). // // We also support a rather specialized interface that allows you to efficiently // split classes in the Hopcroft minimization algorithm. This maintains a // binary partition of each class. Let's call these, rather arbitrarily, the // 'yes' subset and the 'no' subset of each class, and assume that by default, // each element of a class is in its 'no' subset. When one calls // SplitOn(element_id), element_id is moved to the 'yes' subset of its class. // (If it was already in the 'yes' set, it just stays there). The aim is to // enable (later) splitting the class in two in time no greater than the time // already spent calling SplitOn() for that class. We keep a list of the classes // which have nonempty 'yes' sets, as visited_classes_. When one calls // FinalizeSplit(Queue *l), for each class in visited_classes_ whose 'yes' // and 'no' sets are both nonempty, it will create a new class consisting of // the smaller of the two subsets (and this class will be added to the queue), // and the old class will now be the larger of the two subsets. This call also // resets all the yes/no partitions so that everything is in the 'no' subsets. // // One cannot use the Move() function if SplitOn() has been called without // a subsequent call to FinalizeSplit() template <typename T> class Partition { public: Partition() {} explicit Partition(T num_elements) { Initialize(num_elements); } // Creates an empty partition for num_elements. This means that the elements // are not assigned to a class (i.e class_index = -1); you should set up the // number of classes using AllocateClasses() or AddClass(), and allocate each // element to a class by calling Add(element, class_id). void Initialize(size_t num_elements) { elements_.resize(num_elements); classes_.reserve(num_elements); classes_.clear(); yes_counter_ = 1; } // Adds a class; returns new number of classes. T AddClass() { auto num_classes = classes_.size(); classes_.resize(num_classes + 1); return num_classes; } // Adds 'num_classes' new (empty) classes. void AllocateClasses(T num_classes) { classes_.resize(classes_.size() + num_classes); } // Adds element_id to class_id. element_id should already have been allocated // by calling Initialize(num_elements)---or the constructor taking // num_elements---with num_elements > element_id. element_id must not // currently be a member of any class; once elements have been added to a // class, use the Move() method to move them from one class to another. void Add(T element_id, T class_id) { auto &this_element = elements_[element_id]; auto &this_class = classes_[class_id]; ++this_class.size; // Adds the element to the 'no' subset of the class. auto no_head = this_class.no_head; if (no_head >= 0) elements_[no_head].prev_element = element_id; this_class.no_head = element_id; this_element.class_id = class_id; // Adds to the 'no' subset of the class. this_element.yes = 0; this_element.next_element = no_head; this_element.prev_element = -1; } // Moves element_id from 'no' subset of its current class to 'no' subset of // class class_id. This may not work correctly if you have called SplitOn() // [for any element] and haven't subsequently called FinalizeSplit(). void Move(T element_id, T class_id) { auto elements = &(elements_[0]); auto &element = elements[element_id]; auto &old_class = classes_[element.class_id]; --old_class.size; // Excises the element from the 'no' list of its old class, where it is // assumed to be. if (element.prev_element >= 0) { elements[element.prev_element].next_element = element.next_element; } else { old_class.no_head = element.next_element; } if (element.next_element >= 0) { elements[element.next_element].prev_element = element.prev_element; } // Adds to new class. Add(element_id, class_id); } // Moves element_id to the 'yes' subset of its class if it was in the 'no' // subset, and marks the class as having been visited. void SplitOn(T element_id) { auto elements = &(elements_[0]); auto &element = elements[element_id]; if (element.yes == yes_counter_) { return; // Already in the 'yes' set; nothing to do. } auto class_id = element.class_id; auto &this_class = classes_[class_id]; // Excises the element from the 'no' list of its class. if (element.prev_element >= 0) { elements[element.prev_element].next_element = element.next_element; } else { this_class.no_head = element.next_element; } if (element.next_element >= 0) { elements[element.next_element].prev_element = element.prev_element; } // Adds the element to the 'yes' list. if (this_class.yes_head >= 0) { elements[this_class.yes_head].prev_element = element_id; } else { visited_classes_.push_back(class_id); } element.yes = yes_counter_; element.next_element = this_class.yes_head; element.prev_element = -1; this_class.yes_head = element_id; this_class.yes_size++; } // This should be called after one has possibly called SplitOn for one or more // elements, thus moving those elements to the 'yes' subset for their class. // For each class that has a nontrivial split (i.e., it's not the case that // all members are in the 'yes' or 'no' subset), this function creates a new // class containing the smaller of the two subsets of elements, leaving the // larger group of elements in the old class. The identifier of the new class // will be added to the queue provided as the pointer L. This method then // moves all elements to the 'no' subset of their class. template <class Queue> void FinalizeSplit(Queue *queue) { for (const auto &visited_class : visited_classes_) { const auto new_class = SplitRefine(visited_class); if (new_class != -1 && queue) queue->Enqueue(new_class); } visited_classes_.clear(); // Incrementation sets all the 'yes' members of the elements to false. ++yes_counter_; } const T ClassId(T element_id) const { return elements_[element_id].class_id; } const size_t ClassSize(T class_id) const { return classes_[class_id].size; } const T NumClasses() const { return classes_.size(); } private: friend class PartitionIterator<T>; // Information about a given element. struct Element { T class_id; // Class ID of this element. T yes; // This is to be interpreted as a bool, true if it's in the // 'yes' set of this class. The interpretation as bool is // (yes == yes_counter_ ? true : false). T next_element; // Next element in the 'no' list or 'yes' list of this // class, whichever of the two we belong to (think of // this as the 'next' in a doubly-linked list, although // it is an index into the elements array). Negative // values corresponds to null. T prev_element; // Previous element in the 'no' or 'yes' doubly linked // list. Negative values corresponds to null. }; // Information about a given class. struct Class { Class() : size(0), yes_size(0), no_head(-1), yes_head(-1) {} T size; // Total number of elements in this class ('no' plus 'yes' // subsets). T yes_size; // Total number of elements of 'yes' subset of this class. T no_head; // Index of head element of doubly-linked list in 'no' subset. // Everything is in the 'no' subset until you call SplitOn(). // -1 means no element. T yes_head; // Index of head element of doubly-linked list in 'yes' subset. // -1 means no element. }; // This method, called from FinalizeSplit(), checks whether a class has to // be split (a class will be split only if its 'yes' and 'no' subsets are // both nonempty, but one can assume that since this function was called, the // 'yes' subset is nonempty). It splits by taking the smaller subset and // making it a new class, and leaving the larger subset of elements in the // 'no' subset of the old class. It returns the new class if created, or -1 // if none was created. T SplitRefine(T class_id) { auto yes_size = classes_[class_id].yes_size; auto size = classes_[class_id].size; auto no_size = size - yes_size; if (no_size == 0) { // All members are in the 'yes' subset, so we don't have to create a new // class, just move them all to the 'no' subset. classes_[class_id].no_head = classes_[class_id].yes_head; classes_[class_id].yes_head = -1; classes_[class_id].yes_size = 0; return -1; } else { auto new_class_id = classes_.size(); classes_.resize(classes_.size() + 1); auto &old_class = classes_[class_id]; auto &new_class = classes_[new_class_id]; // The new_class will have the values from the constructor. if (no_size < yes_size) { // Moves the 'no' subset to new class ('no' subset). new_class.no_head = old_class.no_head; new_class.size = no_size; // And makes the 'yes' subset of the old class ('no' subset). old_class.no_head = old_class.yes_head; old_class.yes_head = -1; old_class.size = yes_size; old_class.yes_size = 0; } else { // Moves the 'yes' subset to the new class (to the 'no' subset) new_class.size = yes_size; new_class.no_head = old_class.yes_head; // Retains only the 'no' subset in the old class. old_class.size = no_size; old_class.yes_size = 0; old_class.yes_head = -1; } auto elements = &(elements_[0]); // Updates the 'class_id' of all the elements we moved. for (auto e = new_class.no_head; e >= 0; e = elements[e].next_element) { elements[e].class_id = new_class_id; } return new_class_id; } } // elements_[i] contains all info about the i'th element. std::vector<Element> elements_; // classes_[i] contains all info about the i'th class. std::vector<Class> classes_; // Set of visited classes to be used in split refine. std::vector<T> visited_classes_; // yes_counter_ is used in interpreting the 'yes' members of class Element. // If element.yes == yes_counter_, we interpret that element as being in the // 'yes' subset of its class. This allows us to, in effect, set all those // bools to false at a stroke by incrementing yes_counter_. T yes_counter_; }; // Iterates over members of the 'no' subset of a class in a partition. (When // this is used, everything is in the 'no' subset). template <typename T> class PartitionIterator { public: using Element = typename Partition<T>::Element; PartitionIterator(const Partition<T> &partition, T class_id) : partition_(partition), element_id_(partition_.classes_[class_id].no_head), class_id_(class_id) {} bool Done() { return element_id_ < 0; } const T Value() { return element_id_; } void Next() { element_id_ = partition_.elements_[element_id_].next_element; } void Reset() { element_id_ = partition_.classes_[class_id_].no_head; } private: const Partition<T> &partition_; T element_id_; T class_id_; }; } // namespace internal } // namespace fst #endif // FST_PARTITION_H_
0
coqui_public_repos/inference-engine/third_party/openfst-1.6.9-win/src
coqui_public_repos/inference-engine/third_party/openfst-1.6.9-win/src/lib/Makefile.am
AM_CPPFLAGS = -I$(srcdir)/../include $(ICU_CPPFLAGS) lib_LTLIBRARIES = libfst.la libfst_la_SOURCES = compat.cc flags.cc fst.cc fst-types.cc mapped-file.cc \ properties.cc symbol-table.cc symbol-table-ops.cc \ weight.cc util.cc libfst_la_LDFLAGS = -version-info 13:0:0 libfst_la_LIBADD = $(DL_LIBS)
0
coqui_public_repos/STT/native_client/kenlm
coqui_public_repos/STT/native_client/kenlm/util/murmur_hash.cc
/* Downloaded from http://sites.google.com/site/murmurhash/ which says "All * code is released to the public domain. For business purposes, Murmurhash is * under the MIT license." * This is modified from the original: * ULL tag on 0xc6a4a7935bd1e995 so this will compile on 32-bit. * length changed to unsigned int. * placed in namespace util * add MurmurHashNative * default option = 0 for seed * ARM port from NICT */ #include "murmur_hash.hh" #include <cstring> namespace util { //----------------------------------------------------------------------------- // MurmurHash2, 64-bit versions, by Austin Appleby // The same caveats as 32-bit MurmurHash2 apply here - beware of alignment // and endian-ness issues if used across multiple platforms. // 64-bit hash for 64-bit platforms uint64_t MurmurHash64A ( const void * key, std::size_t len, uint64_t seed ) { const uint64_t m = 0xc6a4a7935bd1e995ULL; const int r = 47; uint64_t h = seed ^ (len * m); #if defined(__arm) || defined(__arm__) const size_t ksize = sizeof(uint64_t); const unsigned char * data = (const unsigned char *)key; const unsigned char * end = data + (std::size_t)(len/8) * ksize; #else const uint64_t * data = (const uint64_t *)key; const uint64_t * end = data + (len/8); #endif while(data != end) { #if defined(__arm) || defined(__arm__) uint64_t k; memcpy(&k, data, ksize); data += ksize; #else uint64_t k = *data++; #endif k *= m; k ^= k >> r; k *= m; h ^= k; h *= m; } const unsigned char * data2 = (const unsigned char*)data; switch(len & 7) { case 7: h ^= uint64_t(data2[6]) << 48; case 6: h ^= uint64_t(data2[5]) << 40; case 5: h ^= uint64_t(data2[4]) << 32; case 4: h ^= uint64_t(data2[3]) << 24; case 3: h ^= uint64_t(data2[2]) << 16; case 2: h ^= uint64_t(data2[1]) << 8; case 1: h ^= uint64_t(data2[0]); h *= m; }; h ^= h >> r; h *= m; h ^= h >> r; return h; } // 64-bit hash for 32-bit platforms uint64_t MurmurHash64B ( const void * key, std::size_t len, uint64_t seed ) { const unsigned int m = 0x5bd1e995; const int r = 24; unsigned int h1 = seed ^ len; unsigned int h2 = 0; #if defined(__arm) || defined(__arm__) size_t ksize = sizeof(unsigned int); const unsigned char * data = (const unsigned char *)key; #else const unsigned int * data = (const unsigned int *)key; #endif unsigned int k1, k2; while(len >= 8) { #if defined(__arm) || defined(__arm__) memcpy(&k1, data, ksize); data += ksize; memcpy(&k2, data, ksize); data += ksize; #else k1 = *data++; k2 = *data++; #endif k1 *= m; k1 ^= k1 >> r; k1 *= m; h1 *= m; h1 ^= k1; len -= 4; k2 *= m; k2 ^= k2 >> r; k2 *= m; h2 *= m; h2 ^= k2; len -= 4; } if(len >= 4) { #if defined(__arm) || defined(__arm__) memcpy(&k1, data, ksize); data += ksize; #else k1 = *data++; #endif k1 *= m; k1 ^= k1 >> r; k1 *= m; h1 *= m; h1 ^= k1; len -= 4; } switch(len) { case 3: h2 ^= ((unsigned char*)data)[2] << 16; case 2: h2 ^= ((unsigned char*)data)[1] << 8; case 1: h2 ^= ((unsigned char*)data)[0]; h2 *= m; }; h1 ^= h2 >> 18; h1 *= m; h2 ^= h1 >> 22; h2 *= m; h1 ^= h2 >> 17; h1 *= m; h2 ^= h1 >> 19; h2 *= m; uint64_t h = h1; h = (h << 32) | h2; return h; } // Trick to test for 64-bit architecture at compile time. namespace { #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wunused-function" #endif template <unsigned L> inline uint64_t MurmurHashNativeBackend(const void * key, std::size_t len, uint64_t seed) { return MurmurHash64A(key, len, seed); } template <> inline uint64_t MurmurHashNativeBackend<4>(const void * key, std::size_t len, uint64_t seed) { return MurmurHash64B(key, len, seed); } #ifdef __clang__ #pragma clang diagnostic pop #endif } // namespace uint64_t MurmurHashNative(const void * key, std::size_t len, uint64_t seed) { return MurmurHashNativeBackend<sizeof(void*)>(key, len, seed); } } // namespace util
0
coqui_public_repos
coqui_public_repos/stt-model-manager/VERSION
0.0.21
0
coqui_public_repos/inference-engine/third_party/openfst-1.6.9-win/src
coqui_public_repos/inference-engine/third_party/openfst-1.6.9-win/src/bin/fstpush.cc
// See www.openfst.org for extensive documentation on this weighted // finite-state transducer library. #include <fst/flags.h> #include <fst/weight.h> DEFINE_double(delta, fst::kDelta, "Comparison/quantization delta"); DEFINE_bool(push_weights, false, "Push weights"); DEFINE_bool(push_labels, false, "Push output labels"); DEFINE_bool(remove_total_weight, false, "Remove total weight when pushing weights"); DEFINE_bool(remove_common_affix, false, "Remove common prefix/suffix when pushing labels"); DEFINE_bool(to_final, false, "Push/reweight to final (vs. to initial) states"); int fstpush_main(int argc, char **argv); int main(int argc, char **argv) { return fstpush_main(argc, argv); }
0
coqui_public_repos/inference-engine/third_party/kenlm/lm
coqui_public_repos/inference-engine/third_party/kenlm/lm/interpolate/normalize.cc
#include "lm/interpolate/normalize.hh" #include "lm/common/compare.hh" #include "lm/common/ngram_stream.hh" #include "lm/interpolate/backoff_matrix.hh" #include "lm/interpolate/bounded_sequence_encoding.hh" #include "lm/interpolate/interpolate_info.hh" #include "lm/interpolate/merge_probabilities.hh" #include "lm/weights.hh" #include "lm/word_index.hh" #include "util/fixed_array.hh" #include "util/scoped.hh" #include "util/stream/stream.hh" #include "util/stream/rewindable_stream.hh" #include <functional> #include <queue> #include <vector> namespace lm { namespace interpolate { namespace { class BackoffQueueEntry { public: BackoffQueueEntry(float &entry, const util::stream::ChainPosition &position) : entry_(entry), stream_(position) { entry_ = 0.0; } operator bool() const { return stream_; } NGramHeader operator*() const { return *stream_; } const NGramHeader *operator->() const { return &*stream_; } void Enter() { entry_ = stream_->Value().backoff; } BackoffQueueEntry &Next() { entry_ = 0.0; ++stream_; return *this; } private: float &entry_; NGramStream<ProbBackoff> stream_; }; struct PtrGreater : public std::binary_function<const BackoffQueueEntry *, const BackoffQueueEntry *, bool> { bool operator()(const BackoffQueueEntry *first, const BackoffQueueEntry *second) const { return SuffixLexicographicLess<NGramHeader>()(**second, **first); } }; class EntryOwner : public util::FixedArray<BackoffQueueEntry> { public: void push_back(float &entry, const util::stream::ChainPosition &position) { new (end()) BackoffQueueEntry(entry, position); Constructed(); } }; std::size_t MaxOrder(const util::FixedArray<util::stream::ChainPositions> &model) { std::size_t ret = 0; for (const util::stream::ChainPositions *m = model.begin(); m != model.end(); ++m) { ret = std::max(ret, m->size()); } return ret; } class BackoffManager { public: explicit BackoffManager(const util::FixedArray<util::stream::ChainPositions> &models) : entered_(MaxOrder(models)), matrix_(models.size(), MaxOrder(models)), skip_write_(MaxOrder(models)) { std::size_t total = 0; for (const util::stream::ChainPositions *m = models.begin(); m != models.end(); ++m) { total += m->size(); } for (std::size_t i = 0; i < MaxOrder(models); ++i) { entered_.push_back(models.size()); } owner_.Init(total); for (const util::stream::ChainPositions *m = models.begin(); m != models.end(); ++m) { for (const util::stream::ChainPosition *j = m->begin(); j != m->end(); ++j) { owner_.push_back(matrix_.Backoff(m - models.begin(), j - m->begin()), *j); if (owner_.back()) { queue_.push(&owner_.back()); } } } } void SetupSkip(std::size_t order, util::stream::Stream &stream) { skip_write_[order - 2] = &stream; } // Move up the backoffs for the given n-gram. The n-grams must be provided // in suffix lexicographic order. void Enter(const NGramHeader &to) { // Check that we exited properly. for (std::size_t i = to.Order() - 1; i < entered_.size(); ++i) { assert(entered_[i].empty()); } SuffixLexicographicLess<NGramHeader> less; while (!queue_.empty() && less(**queue_.top(), to)) SkipRecord(); while (TopMatches(to)) { BackoffQueueEntry *matches = queue_.top(); entered_[to.Order() - 1].push_back(matches); matches->Enter(); queue_.pop(); } } void Exit(std::size_t order_minus_1) { for (BackoffQueueEntry **i = entered_[order_minus_1].begin(); i != entered_[order_minus_1].end(); ++i) { if ((*i)->Next()) queue_.push(*i); } entered_[order_minus_1].clear(); } float Get(std::size_t model, std::size_t order_minus_1) const { return matrix_.Backoff(model, order_minus_1); } void Finish() { while (!queue_.empty()) SkipRecord(); } private: void SkipRecord() { BackoffQueueEntry *top = queue_.top(); queue_.pop(); // Is this the last instance of the n-gram? if (!TopMatches(**top)) { // An n-gram is being skipped. Called once per skipped n-gram, // regardless of how many models it comes from. *reinterpret_cast<float*>(skip_write_[(*top)->Order() - 1]->Get()) = 0.0; ++*skip_write_[(*top)->Order() - 1]; } if (top->Next()) queue_.push(top); } bool TopMatches(const NGramHeader &header) const { return !queue_.empty() && (*queue_.top())->Order() == header.Order() && std::equal(header.begin(), header.end(), (*queue_.top())->begin()); } EntryOwner owner_; std::priority_queue<BackoffQueueEntry*, std::vector<BackoffQueueEntry*>, PtrGreater> queue_; // Indexed by order then just all the matching models. util::FixedArray<util::FixedArray<BackoffQueueEntry*> > entered_; BackoffMatrix matrix_; std::vector<util::stream::Stream*> skip_write_; }; typedef long double Accum; // Handles n-grams of the same order, using recursion to call another instance // for higher orders. class Recurse { public: Recurse( const InterpolateInfo &info, // Must stay alive the entire time. std::size_t order, const util::stream::ChainPosition &merged_probs, const util::stream::ChainPosition &prob_out, const util::stream::ChainPosition &backoff_out, BackoffManager &backoffs, Recurse *higher) // higher is null for the highest order. : order_(order), encoding_(MakeEncoder(info, order)), input_(merged_probs, PartialProbGamma(order, encoding_.EncodedLength())), prob_out_(prob_out), backoff_out_(backoff_out), backoffs_(backoffs), lambdas_(&*info.lambdas.begin()), higher_(higher), decoded_backoffs_(info.Models()), extended_context_(order - 1) { // This is only for bigrams and above. Summing unigrams is a much easier case. assert(order >= 2); } // context = w_1^{n-1} // z_lower = Z(w_2^{n-1}) // Input: // Merged probabilities without backoff applied in input_. // Backoffs via backoffs_. // Calculates: // Z(w_1^{n-1}): intermediate only. // p_I(x | w_1^{n-1}) for all x: w_1^{n-1}x exists: Written to prob_out_. // b_I(w_1^{n-1}): Written to backoff_out_. void SameContext(const NGramHeader &context, Accum z_lower) { assert(context.size() == order_ - 1); backoffs_.Enter(context); prob_out_.Mark(); // This is the backoff term that applies when one assumes everything backs off: // \prod_i b_i(w_1^{n-1})^{\lambda_i}. Accum backoff_once = 0.0; for (std::size_t m = 0; m < decoded_backoffs_.size(); ++m) { backoff_once += lambdas_[m] * backoffs_.Get(m, order_ - 2); } Accum z_delta = 0.0; std::size_t count = 0; for (; input_ && std::equal(context.begin(), context.end(), input_->begin()); ++input_, ++prob_out_, ++count) { // Apply backoffs to probabilities. // TODO: change bounded sequence encoding to have an iterator for decoding instead of doing a copy here. encoding_.Decode(input_->FromBegin(), &*decoded_backoffs_.begin()); for (std::size_t m = 0; m < NumModels(); ++m) { // Apply the backoffs as instructed for model m. float accumulated = 0.0; // Change backoffs for [order it backed off to, order - 1) except // with 0-indexing. There is still the potential to charge backoff // for order - 1, which is done later. The backoffs charged here // are b_m(w_{n-1}^{n-1}) ... b_m(w_2^{n-1}) for (unsigned char backed_to = decoded_backoffs_[m]; backed_to < order_ - 2; ++backed_to) { accumulated += backoffs_.Get(m, backed_to); } float lambda = lambdas_[m]; // Lower p(x | w_2^{n-1}) gets all the backoffs except the highest. input_->LowerProb() += accumulated * lambda; // Charge the backoff b(w_1^{n-1}) if applicable, but only to attain p(x | w_1^{n-1}) if (decoded_backoffs_[m] < order_ - 1) { accumulated += backoffs_.Get(m, order_ - 2); } input_->Prob() += accumulated * lambda; } // TODO: better precision/less operations here. z_delta += pow(10.0, input_->Prob()) - pow(10.0, input_->LowerProb() + backoff_once); // Write unnormalized probability record. std::copy(input_->begin(), input_->end(), reinterpret_cast<WordIndex*>(prob_out_.Get())); ProbWrite() = input_->Prob(); } // TODO numerical precision. Accum z = log10(pow(10.0, z_lower + backoff_once) + z_delta); // Normalize. prob_out_.Rewind(); for (std::size_t i = 0; i < count; ++i, ++prob_out_) { ProbWrite() -= z; } // This allows the stream to release data. prob_out_.Mark(); // Output backoff. *reinterpret_cast<float*>(backoff_out_.Get()) = z_lower + backoff_once - z; ++backoff_out_; if (higher_.get()) higher_->ExtendContext(context, z); backoffs_.Exit(order_ - 2); } // Call is given a context and z(context). // Evaluates y context x for all y,x. void ExtendContext(const NGramHeader &middle, Accum z_lower) { assert(middle.size() == order_ - 2); // Copy because the input will advance. TODO avoid this copy by sharing amongst classes. std::copy(middle.begin(), middle.end(), extended_context_.begin() + 1); while (input_ && std::equal(middle.begin(), middle.end(), input_->begin() + 1)) { *extended_context_.begin() = *input_->begin(); SameContext(NGramHeader(&*extended_context_.begin(), order_ - 1), z_lower); } } void Finish() { assert(!input_); prob_out_.Poison(); backoff_out_.Poison(); if (higher_.get()) higher_->Finish(); } // The BackoffManager class also injects backoffs when it skips ahead e.g. b(</s>) = 1 util::stream::Stream &BackoffStream() { return backoff_out_; } private: // Write the probability to the correct place in prob_out_. Should use a proxy but currently incompatible with RewindableStream. float &ProbWrite() { return *reinterpret_cast<float*>(reinterpret_cast<uint8_t*>(prob_out_.Get()) + order_ * sizeof(WordIndex)); } std::size_t NumModels() const { return decoded_backoffs_.size(); } const std::size_t order_; const BoundedSequenceEncoding encoding_; ProxyStream<PartialProbGamma> input_; util::stream::RewindableStream prob_out_; util::stream::Stream backoff_out_; BackoffManager &backoffs_; const float *const lambdas_; // Higher order instance of this same class. util::scoped_ptr<Recurse> higher_; // Temporary in SameContext. std::vector<unsigned char> decoded_backoffs_; // Temporary in ExtendContext. std::vector<WordIndex> extended_context_; }; class Thread { public: Thread(const InterpolateInfo &info, util::FixedArray<util::stream::ChainPositions> &models_by_order, util::stream::Chains &prob_out, util::stream::Chains &backoff_out) : info_(info), models_by_order_(models_by_order), prob_out_(prob_out), backoff_out_(backoff_out) {} void Run(const util::stream::ChainPositions &merged_probabilities) { // Unigrams do not have enocded backoff info. ProxyStream<PartialProbGamma> in(merged_probabilities[0], PartialProbGamma(1, 0)); util::stream::RewindableStream prob_write(prob_out_[0]); Accum z = 0.0; prob_write.Mark(); WordIndex count = 0; for (; in; ++in, ++prob_write, ++count) { // Note assumption that probabilitity comes first memcpy(prob_write.Get(), in.Get(), sizeof(WordIndex) + sizeof(float)); z += pow(10.0, in->Prob()); } // TODO HACK TODO: lmplz outputs p(<s>) = 1 to get q to compute nicely. That will always result in 1.0 more than it should be. z -= 1.0; float log_z = log10(z); prob_write.Rewind(); // Normalize unigram probabilities. for (WordIndex i = 0; i < count; ++i, ++prob_write) { *reinterpret_cast<float*>(reinterpret_cast<uint8_t*>(prob_write.Get()) + sizeof(WordIndex)) -= log_z; } prob_write.Poison(); // Now setup the higher orders. util::scoped_ptr<Recurse> higher_order; BackoffManager backoffs(models_by_order_); std::size_t max_order = merged_probabilities.size(); for (std::size_t order = max_order; order >= 2; --order) { higher_order.reset(new Recurse(info_, order, merged_probabilities[order - 1], prob_out_[order - 1], backoff_out_[order - 2], backoffs, higher_order.release())); backoffs.SetupSkip(order, higher_order->BackoffStream()); } if (max_order > 1) { higher_order->ExtendContext(NGramHeader(NULL, 0), log_z); backoffs.Finish(); higher_order->Finish(); } } private: const InterpolateInfo info_; util::FixedArray<util::stream::ChainPositions> &models_by_order_; util::stream::ChainPositions prob_out_; util::stream::ChainPositions backoff_out_; }; } // namespace void Normalize(const InterpolateInfo &info, util::FixedArray<util::stream::ChainPositions> &models_by_order, util::stream::Chains &merged_probabilities, util::stream::Chains &prob_out, util::stream::Chains &backoff_out) { assert(prob_out.size() == backoff_out.size() + 1); // Arbitrarily put the thread on the merged_probabilities Chains. merged_probabilities >> Thread(info, models_by_order, prob_out, backoff_out); } }} // namespaces
0
coqui_public_repos/inference-engine/third_party/onnxruntime/include/onnxruntime/core/providers
coqui_public_repos/inference-engine/third_party/onnxruntime/include/onnxruntime/core/providers/dml/dml_provider_factory.h
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. #pragma warning(push) #pragma warning(disable : 4201) // nonstandard extension used: nameless struct/union #include <d3d12.h> #pragma warning(pop) #ifdef __cplusplus #include <DirectML.h> #else struct IDMLDevice; typedef struct IDMLDevice IDMLDevice; #endif // Windows pollutes the macro space, causing a build break in constants.h. #undef OPTIONAL #include "onnxruntime_c_api.h" #ifdef __cplusplus extern "C" { #endif /** * Creates a DirectML Execution Provider which executes on the hardware adapter with the given device_id, also known as * the adapter index. The device ID corresponds to the enumeration order of hardware adapters as given by * IDXGIFactory::EnumAdapters. A device_id of 0 always corresponds to the default adapter, which is typically the * primary display GPU installed on the system. A negative device_id is invalid. */ ORT_API_STATUS(OrtSessionOptionsAppendExecutionProvider_DML, _In_ OrtSessionOptions* options, int device_id); /** * Creates a DirectML Execution Provider using the given DirectML device, and which executes work on the supplied D3D12 * command queue. The DirectML device and D3D12 command queue must have the same parent ID3D12Device, or an error will * be returned. The D3D12 command queue must be of type DIRECT or COMPUTE (see D3D12_COMMAND_LIST_TYPE). If this * function succeeds, the inference session maintains a strong reference on both the dml_device and the command_queue * objects. * See also: DMLCreateDevice * See also: ID3D12Device::CreateCommandQueue */ ORT_API_STATUS(OrtSessionOptionsAppendExecutionProviderEx_DML, _In_ OrtSessionOptions* options, _In_ IDMLDevice* dml_device, _In_ ID3D12CommandQueue* cmd_queue); #ifdef __cplusplus } #endif
0
coqui_public_repos/STT/native_client/ctcdecode/third_party/openfst-1.6.9-win/src/extensions
coqui_public_repos/STT/native_client/ctcdecode/third_party/openfst-1.6.9-win/src/extensions/linear/fstloglinearapply.cc
// See www.openfst.org for extensive documentation on this weighted // finite-state transducer library. #include <fst/compat.h> #include <fst/extensions/linear/linear-fst.h> #include <fst/extensions/linear/loglinear-apply.h> #include <fst/vector-fst.h> #include <fst/flags.h> #include <fst/log.h> DEFINE_bool(normalize, true, "Normalize to get posterior"); int main(int argc, char **argv) { string usage = "Applies an FST to another FST, treating the second as a log-linear " "model.\n\n " "Usage: "; usage += argv[0]; usage += " in.fst linear.fst [out.fst]\n"; std::set_new_handler(FailedNewHandler); SET_FLAGS(usage.c_str(), &argc, &argv, true); if (argc < 3 || argc > 4) { ShowUsage(); return 1; } string in_name = strcmp(argv[1], "-") != 0 ? argv[1] : ""; string linear_name = (argc > 2 && (strcmp(argv[2], "-") != 0)) ? argv[2] : ""; string out_name = argc > 3 ? argv[3] : ""; if (in_name.empty() && linear_name.empty()) { LOG(ERROR) << argv[0] << ": Can't take both inputs from standard input."; return 1; } fst::StdFst *ifst1 = fst::StdFst::Read(in_name); if (!ifst1) return 1; fst::StdFst *ifst2 = fst::StdFst::Read(linear_name); if (!ifst2) return 1; fst::StdVectorFst ofst; LogLinearApply(*ifst1, *ifst2, &ofst, FLAGS_normalize); ofst.Write(out_name); return 0; }
0
coqui_public_repos/inference-engine/third_party/openfst-1.6.9-win/src/extensions
coqui_public_repos/inference-engine/third_party/openfst-1.6.9-win/src/extensions/special/Makefile.in
# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @HAVE_BIN_TRUE@bin_PROGRAMS = fstspecial$(EXEEXT) subdir = src/extensions/special ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_python_devel.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h \ $(top_builddir)/src/include/fst/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(libfstdir)" \ "$(DESTDIR)$(bindir)" LTLIBRARIES = $(lib_LTLIBRARIES) $(libfst_LTLIBRARIES) am__DEPENDENCIES_1 = libfstspecial_la_DEPENDENCIES = ../../lib/libfst.la \ $(am__DEPENDENCIES_1) am_libfstspecial_la_OBJECTS = phi-fst.lo rho-fst.lo sigma-fst.lo libfstspecial_la_OBJECTS = $(am_libfstspecial_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = libfstspecial_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CXXLD) \ $(AM_CXXFLAGS) $(CXXFLAGS) $(libfstspecial_la_LDFLAGS) \ $(LDFLAGS) -o $@ phi_fst_la_DEPENDENCIES = ../../lib/libfst.la $(am__DEPENDENCIES_1) am_phi_fst_la_OBJECTS = phi-fst.lo phi_fst_la_OBJECTS = $(am_phi_fst_la_OBJECTS) phi_fst_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(phi_fst_la_LDFLAGS) $(LDFLAGS) -o $@ rho_fst_la_DEPENDENCIES = ../../lib/libfst.la $(am__DEPENDENCIES_1) am_rho_fst_la_OBJECTS = rho-fst.lo rho_fst_la_OBJECTS = $(am_rho_fst_la_OBJECTS) rho_fst_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(rho_fst_la_LDFLAGS) $(LDFLAGS) -o $@ sigma_fst_la_DEPENDENCIES = ../../lib/libfst.la $(am__DEPENDENCIES_1) am_sigma_fst_la_OBJECTS = sigma-fst.lo sigma_fst_la_OBJECTS = $(am_sigma_fst_la_OBJECTS) sigma_fst_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(sigma_fst_la_LDFLAGS) $(LDFLAGS) -o $@ PROGRAMS = $(bin_PROGRAMS) am__fstspecial_SOURCES_DIST = fstspecial.cc phi-fst.cc rho-fst.cc \ sigma-fst.cc @HAVE_BIN_TRUE@am_fstspecial_OBJECTS = \ @HAVE_BIN_TRUE@ fstspecial-fstspecial.$(OBJEXT) \ @HAVE_BIN_TRUE@ fstspecial-phi-fst.$(OBJEXT) \ @HAVE_BIN_TRUE@ fstspecial-rho-fst.$(OBJEXT) \ @HAVE_BIN_TRUE@ fstspecial-sigma-fst.$(OBJEXT) fstspecial_OBJECTS = $(am_fstspecial_OBJECTS) fstspecial_LDADD = $(LDADD) @HAVE_BIN_TRUE@fstspecial_DEPENDENCIES = ../../script/libfstscript.la \ @HAVE_BIN_TRUE@ ../../lib/libfst.la $(am__DEPENDENCIES_1) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLD = $(CXX) CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = SOURCES = $(libfstspecial_la_SOURCES) $(phi_fst_la_SOURCES) \ $(rho_fst_la_SOURCES) $(sigma_fst_la_SOURCES) \ $(fstspecial_SOURCES) DIST_SOURCES = $(libfstspecial_la_SOURCES) $(phi_fst_la_SOURCES) \ $(rho_fst_la_SOURCES) $(sigma_fst_la_SOURCES) \ $(am__fstspecial_SOURCES_DIST) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PYTHON = @PYTHON@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@ PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_SITE_PKG = @PYTHON_SITE_PKG@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ libfstdir = @libfstdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CPPFLAGS = -I$(srcdir)/../../include -I$(srcdir)/../../bin $(ICU_CPPFLAGS) @HAVE_BIN_TRUE@LDADD = ../../script/libfstscript.la \ @HAVE_BIN_TRUE@ ../../lib/libfst.la -lm $(DL_LIBS) @HAVE_BIN_TRUE@fstspecial_SOURCES = fstspecial.cc phi-fst.cc rho-fst.cc sigma-fst.cc @HAVE_BIN_TRUE@fstspecial_CPPFLAGS = $(AM_CPPFLAGS) libfst_LTLIBRARIES = phi-fst.la rho-fst.la sigma-fst.la lib_LTLIBRARIES = libfstspecial.la libfstspecial_la_SOURCES = phi-fst.cc rho-fst.cc sigma-fst.cc libfstspecial_la_LDFLAGS = -version-info 13:0:0 -lm $(DL_LIBS) libfstspecial_la_LIBADD = ../../lib/libfst.la -lm $(DL_LIBS) phi_fst_la_SOURCES = phi-fst.cc phi_fst_la_LDFLAGS = -module phi_fst_la_LIBADD = ../../lib/libfst.la -lm $(DL_LIBS) rho_fst_la_SOURCES = rho-fst.cc rho_fst_la_LDFLAGS = -module rho_fst_la_LIBADD = ../../lib/libfst.la -lm $(DL_LIBS) sigma_fst_la_SOURCES = sigma-fst.cc sigma_fst_la_LDFLAGS = -module sigma_fst_la_LIBADD = ../../lib/libfst.la -lm $(DL_LIBS) all: all-am .SUFFIXES: .SUFFIXES: .cc .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/extensions/special/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign src/extensions/special/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } install-libfstLTLIBRARIES: $(libfst_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(libfst_LTLIBRARIES)'; test -n "$(libfstdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(libfstdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libfstdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libfstdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libfstdir)"; \ } uninstall-libfstLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(libfst_LTLIBRARIES)'; test -n "$(libfstdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libfstdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libfstdir)/$$f"; \ done clean-libfstLTLIBRARIES: -test -z "$(libfst_LTLIBRARIES)" || rm -f $(libfst_LTLIBRARIES) @list='$(libfst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libfstspecial.la: $(libfstspecial_la_OBJECTS) $(libfstspecial_la_DEPENDENCIES) $(EXTRA_libfstspecial_la_DEPENDENCIES) $(AM_V_CXXLD)$(libfstspecial_la_LINK) -rpath $(libdir) $(libfstspecial_la_OBJECTS) $(libfstspecial_la_LIBADD) $(LIBS) phi-fst.la: $(phi_fst_la_OBJECTS) $(phi_fst_la_DEPENDENCIES) $(EXTRA_phi_fst_la_DEPENDENCIES) $(AM_V_CXXLD)$(phi_fst_la_LINK) -rpath $(libfstdir) $(phi_fst_la_OBJECTS) $(phi_fst_la_LIBADD) $(LIBS) rho-fst.la: $(rho_fst_la_OBJECTS) $(rho_fst_la_DEPENDENCIES) $(EXTRA_rho_fst_la_DEPENDENCIES) $(AM_V_CXXLD)$(rho_fst_la_LINK) -rpath $(libfstdir) $(rho_fst_la_OBJECTS) $(rho_fst_la_LIBADD) $(LIBS) sigma-fst.la: $(sigma_fst_la_OBJECTS) $(sigma_fst_la_DEPENDENCIES) $(EXTRA_sigma_fst_la_DEPENDENCIES) $(AM_V_CXXLD)$(sigma_fst_la_LINK) -rpath $(libfstdir) $(sigma_fst_la_OBJECTS) $(sigma_fst_la_LIBADD) $(LIBS) install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list fstspecial$(EXEEXT): $(fstspecial_OBJECTS) $(fstspecial_DEPENDENCIES) $(EXTRA_fstspecial_DEPENDENCIES) @rm -f fstspecial$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(fstspecial_OBJECTS) $(fstspecial_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstspecial-fstspecial.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstspecial-phi-fst.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstspecial-rho-fst.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstspecial-sigma-fst.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/phi-fst.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rho-fst.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sigma-fst.Plo@am__quote@ .cc.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cc.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cc.lo: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< fstspecial-fstspecial.o: fstspecial.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(fstspecial_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT fstspecial-fstspecial.o -MD -MP -MF $(DEPDIR)/fstspecial-fstspecial.Tpo -c -o fstspecial-fstspecial.o `test -f 'fstspecial.cc' || echo '$(srcdir)/'`fstspecial.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fstspecial-fstspecial.Tpo $(DEPDIR)/fstspecial-fstspecial.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='fstspecial.cc' object='fstspecial-fstspecial.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(fstspecial_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o fstspecial-fstspecial.o `test -f 'fstspecial.cc' || echo '$(srcdir)/'`fstspecial.cc fstspecial-fstspecial.obj: fstspecial.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(fstspecial_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT fstspecial-fstspecial.obj -MD -MP -MF $(DEPDIR)/fstspecial-fstspecial.Tpo -c -o fstspecial-fstspecial.obj `if test -f 'fstspecial.cc'; then $(CYGPATH_W) 'fstspecial.cc'; else $(CYGPATH_W) '$(srcdir)/fstspecial.cc'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fstspecial-fstspecial.Tpo $(DEPDIR)/fstspecial-fstspecial.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='fstspecial.cc' object='fstspecial-fstspecial.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(fstspecial_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o fstspecial-fstspecial.obj `if test -f 'fstspecial.cc'; then $(CYGPATH_W) 'fstspecial.cc'; else $(CYGPATH_W) '$(srcdir)/fstspecial.cc'; fi` fstspecial-phi-fst.o: phi-fst.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(fstspecial_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT fstspecial-phi-fst.o -MD -MP -MF $(DEPDIR)/fstspecial-phi-fst.Tpo -c -o fstspecial-phi-fst.o `test -f 'phi-fst.cc' || echo '$(srcdir)/'`phi-fst.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fstspecial-phi-fst.Tpo $(DEPDIR)/fstspecial-phi-fst.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='phi-fst.cc' object='fstspecial-phi-fst.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(fstspecial_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o fstspecial-phi-fst.o `test -f 'phi-fst.cc' || echo '$(srcdir)/'`phi-fst.cc fstspecial-phi-fst.obj: phi-fst.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(fstspecial_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT fstspecial-phi-fst.obj -MD -MP -MF $(DEPDIR)/fstspecial-phi-fst.Tpo -c -o fstspecial-phi-fst.obj `if test -f 'phi-fst.cc'; then $(CYGPATH_W) 'phi-fst.cc'; else $(CYGPATH_W) '$(srcdir)/phi-fst.cc'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fstspecial-phi-fst.Tpo $(DEPDIR)/fstspecial-phi-fst.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='phi-fst.cc' object='fstspecial-phi-fst.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(fstspecial_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o fstspecial-phi-fst.obj `if test -f 'phi-fst.cc'; then $(CYGPATH_W) 'phi-fst.cc'; else $(CYGPATH_W) '$(srcdir)/phi-fst.cc'; fi` fstspecial-rho-fst.o: rho-fst.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(fstspecial_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT fstspecial-rho-fst.o -MD -MP -MF $(DEPDIR)/fstspecial-rho-fst.Tpo -c -o fstspecial-rho-fst.o `test -f 'rho-fst.cc' || echo '$(srcdir)/'`rho-fst.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fstspecial-rho-fst.Tpo $(DEPDIR)/fstspecial-rho-fst.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='rho-fst.cc' object='fstspecial-rho-fst.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(fstspecial_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o fstspecial-rho-fst.o `test -f 'rho-fst.cc' || echo '$(srcdir)/'`rho-fst.cc fstspecial-rho-fst.obj: rho-fst.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(fstspecial_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT fstspecial-rho-fst.obj -MD -MP -MF $(DEPDIR)/fstspecial-rho-fst.Tpo -c -o fstspecial-rho-fst.obj `if test -f 'rho-fst.cc'; then $(CYGPATH_W) 'rho-fst.cc'; else $(CYGPATH_W) '$(srcdir)/rho-fst.cc'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fstspecial-rho-fst.Tpo $(DEPDIR)/fstspecial-rho-fst.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='rho-fst.cc' object='fstspecial-rho-fst.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(fstspecial_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o fstspecial-rho-fst.obj `if test -f 'rho-fst.cc'; then $(CYGPATH_W) 'rho-fst.cc'; else $(CYGPATH_W) '$(srcdir)/rho-fst.cc'; fi` fstspecial-sigma-fst.o: sigma-fst.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(fstspecial_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT fstspecial-sigma-fst.o -MD -MP -MF $(DEPDIR)/fstspecial-sigma-fst.Tpo -c -o fstspecial-sigma-fst.o `test -f 'sigma-fst.cc' || echo '$(srcdir)/'`sigma-fst.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fstspecial-sigma-fst.Tpo $(DEPDIR)/fstspecial-sigma-fst.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='sigma-fst.cc' object='fstspecial-sigma-fst.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(fstspecial_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o fstspecial-sigma-fst.o `test -f 'sigma-fst.cc' || echo '$(srcdir)/'`sigma-fst.cc fstspecial-sigma-fst.obj: sigma-fst.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(fstspecial_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT fstspecial-sigma-fst.obj -MD -MP -MF $(DEPDIR)/fstspecial-sigma-fst.Tpo -c -o fstspecial-sigma-fst.obj `if test -f 'sigma-fst.cc'; then $(CYGPATH_W) 'sigma-fst.cc'; else $(CYGPATH_W) '$(srcdir)/sigma-fst.cc'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fstspecial-sigma-fst.Tpo $(DEPDIR)/fstspecial-sigma-fst.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='sigma-fst.cc' object='fstspecial-sigma-fst.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(fstspecial_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o fstspecial-sigma-fst.obj `if test -f 'sigma-fst.cc'; then $(CYGPATH_W) 'sigma-fst.cc'; else $(CYGPATH_W) '$(srcdir)/sigma-fst.cc'; fi` mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) install-binPROGRAMS: install-libLTLIBRARIES installdirs: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(libfstdir)" "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libLTLIBRARIES \ clean-libfstLTLIBRARIES clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-libfstLTLIBRARIES install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-libLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-libLTLIBRARIES \ uninstall-libfstLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ clean-binPROGRAMS clean-generic clean-libLTLIBRARIES \ clean-libfstLTLIBRARIES clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-libLTLIBRARIES \ install-libfstLTLIBRARIES install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-binPROGRAMS \ uninstall-libLTLIBRARIES uninstall-libfstLTLIBRARIES .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT:
0
coqui_public_repos/STT/native_client/ctcdecode/third_party/openfst-1.6.7/src
coqui_public_repos/STT/native_client/ctcdecode/third_party/openfst-1.6.7/src/script/equal.cc
// See www.openfst.org for extensive documentation on this weighted // finite-state transducer library. #include <fst/script/fst-class.h> #include <fst/script/equal.h> #include <fst/script/script-impl.h> namespace fst { namespace script { bool Equal(const FstClass &fst1, const FstClass &fst2, float delta) { if (!internal::ArcTypesMatch(fst1, fst2, "Equal")) return false; EqualInnerArgs iargs(fst1, fst2, delta); EqualArgs args(iargs); Apply<Operation<EqualArgs>>("Equal", fst1.ArcType(), &args); return args.retval; } REGISTER_FST_OPERATION(Equal, StdArc, EqualArgs); REGISTER_FST_OPERATION(Equal, LogArc, EqualArgs); REGISTER_FST_OPERATION(Equal, Log64Arc, EqualArgs); } // namespace script } // namespace fst
0
coqui_public_repos
coqui_public_repos/open-bible-scripts/MFA_CONFIG
beam: 500 retry_beam: 1000 features: type: "mfcc" use_energy: false frame_shift: 10 training: - monophone: num_iterations: 40 max_gaussians: 1000 subset: 2000 boost_silence: 1.25 - triphone: num_iterations: 35 num_leaves: 2000 max_gaussians: 10000 cluster_threshold: -1 subset: 5000 boost_silence: 1.25 power: 0.25 - lda: num_leaves: 2500 max_gaussians: 15000 subset: 10000 num_iterations: 35 features: splice_left_context: 3 splice_right_context: 3
0
coqui_public_repos/STT/native_client/ctcdecode/third_party/openfst-1.6.7/src/include
coqui_public_repos/STT/native_client/ctcdecode/third_party/openfst-1.6.7/src/include/fst/cache.h
// See www.openfst.org for extensive documentation on this weighted // finite-state transducer library. // // An FST implementation that caches FST elements of a delayed computation. #ifndef FST_CACHE_H_ #define FST_CACHE_H_ #include <functional> #include <unordered_map> using std::unordered_map; using std::unordered_multimap; #include <list> #include <vector> #include <fst/flags.h> #include <fst/log.h> #include <fst/vector-fst.h> DECLARE_bool(fst_default_cache_gc); DECLARE_int64(fst_default_cache_gc_limit); namespace fst { // Options for controlling caching behavior; higher level than CacheImplOptions. struct CacheOptions { bool gc; // Enables GC. size_t gc_limit; // Number of bytes allowed before GC. explicit CacheOptions(bool gc = FLAGS_fst_default_cache_gc, size_t gc_limit = FLAGS_fst_default_cache_gc_limit) : gc(gc), gc_limit(gc_limit) {} }; // Options for controlling caching behavior, at a lower level than // CacheOptions; templated on the cache store and allows passing the store. template <class CacheStore> struct CacheImplOptions { bool gc; // Enables GC. size_t gc_limit; // Number of bytes allowed before GC. CacheStore *store; // Cache store. bool own_store; // Should CacheImpl takes ownership of the store? explicit CacheImplOptions(bool gc = FLAGS_fst_default_cache_gc, size_t gc_limit = FLAGS_fst_default_cache_gc_limit, CacheStore *store = nullptr) : gc(gc), gc_limit(gc_limit), store(store), own_store(true) {} explicit CacheImplOptions(const CacheOptions &opts) : gc(opts.gc), gc_limit(opts.gc_limit), store(nullptr), own_store(true) {} }; // Cache flags. constexpr uint32 kCacheFinal = 0x0001; // Final weight has been cached. constexpr uint32 kCacheArcs = 0x0002; // Arcs have been cached. constexpr uint32 kCacheInit = 0x0004; // Initialized by GC. constexpr uint32 kCacheRecent = 0x0008; // Visited since GC. constexpr uint32 kCacheFlags = kCacheFinal | kCacheArcs | kCacheInit | kCacheRecent; // Cache state, with arcs stored in a per-state std::vector. template <class A, class M = PoolAllocator<A>> class CacheState { public: using Arc = A; using Label = typename Arc::Label; using StateId = typename Arc::StateId; using Weight = typename Arc::Weight; using ArcAllocator = M; using StateAllocator = typename ArcAllocator::template rebind<CacheState<A, M>>::other; // Provides STL allocator for arcs. explicit CacheState(const ArcAllocator &alloc) : final_(Weight::Zero()), niepsilons_(0), noepsilons_(0), arcs_(alloc), flags_(0), ref_count_(0) {} CacheState(const CacheState<A> &state, const ArcAllocator &alloc) : final_(state.Final()), niepsilons_(state.NumInputEpsilons()), noepsilons_(state.NumOutputEpsilons()), arcs_(state.arcs_.begin(), state.arcs_.end(), alloc), flags_(state.Flags()), ref_count_(0) {} void Reset() { final_ = Weight::Zero(); niepsilons_ = 0; noepsilons_ = 0; ref_count_ = 0; flags_ = 0; arcs_.clear(); } Weight Final() const { return final_; } size_t NumInputEpsilons() const { return niepsilons_; } size_t NumOutputEpsilons() const { return noepsilons_; } size_t NumArcs() const { return arcs_.size(); } const Arc &GetArc(size_t n) const { return arcs_[n]; } // Used by the ArcIterator<Fst<Arc>> efficient implementation. const Arc *Arcs() const { return !arcs_.empty() ? &arcs_[0] : nullptr; } // Accesses flags; used by the caller. uint32 Flags() const { return flags_; } // Accesses ref count; used by the caller. int RefCount() const { return ref_count_; } void SetFinal(Weight weight) { final_ = std::move(weight); } void ReserveArcs(size_t n) { arcs_.reserve(n); } // Adds one arc at a time with all needed book-keeping; use PushArc and // SetArcs for a more efficient alternative. void AddArc(const Arc &arc) { arcs_.push_back(arc); if (arc.ilabel == 0) ++niepsilons_; if (arc.olabel == 0) ++noepsilons_; } // Adds one arc at a time with delayed book-keeping; finalize with SetArcs(). void PushArc(const Arc &arc) { arcs_.push_back(arc); } // Finalizes arcs book-keeping; call only once. void SetArcs() { for (const auto &arc : arcs_) { if (arc.ilabel == 0) ++niepsilons_; if (arc.olabel == 0) ++noepsilons_; } } // Modifies nth arc. void SetArc(const Arc &arc, size_t n) { if (arcs_[n].ilabel == 0) --niepsilons_; if (arcs_[n].olabel == 0) --noepsilons_; if (arc.ilabel == 0) ++niepsilons_; if (arc.olabel == 0) ++noepsilons_; arcs_[n] = arc; } // Deletes all arcs. void DeleteArcs() { niepsilons_ = 0; noepsilons_ = 0; arcs_.clear(); } void DeleteArcs(size_t n) { for (size_t i = 0; i < n; ++i) { if (arcs_.back().ilabel == 0) --niepsilons_; if (arcs_.back().olabel == 0) --noepsilons_; arcs_.pop_back(); } } // Sets status flags; used by the caller. void SetFlags(uint32 flags, uint32 mask) const { flags_ &= ~mask; flags_ |= flags; } // Mutates reference counts; used by the caller. int IncrRefCount() const { return ++ref_count_; } int DecrRefCount() const { return --ref_count_; } // Used by the ArcIterator<Fst<Arc>> efficient implementation. int *MutableRefCount() const { return &ref_count_; } // Used for state class allocation. void *operator new(size_t size, StateAllocator *alloc) { return alloc->allocate(1); } // For state destruction and memory freeing. static void Destroy(CacheState<Arc> *state, StateAllocator *alloc) { if (state) { state->~CacheState<Arc>(); alloc->deallocate(state, 1); } } private: Weight final_; // Final weight. size_t niepsilons_; // # of input epsilons. size_t noepsilons_; // # of output epsilons. std::vector<Arc, ArcAllocator> arcs_; // Arcs representation. mutable uint32 flags_; mutable int ref_count_; // If 0, available for GC. }; // Cache store, allocating and storing states, providing a mapping from state // IDs to cached states, and an iterator over these states. The state template // argument must implement the CacheState interface. The state for a StateId s // is constructed when requested by GetMutableState(s) if it is not yet stored. // Initially, a state has a reference count of zero, but the user may increment // or decrement this to control the time of destruction. In particular, a state // is destroyed when: // // 1. This instance is destroyed, or // 2. Clear() or Delete() is called, or // 3. Possibly (implementation-dependently) when: // - Garbage collection is enabled (as defined by opts.gc), // - The cache store size exceeds the limits (as defined by opts.gc_limits), // - The state's reference count is zero, and // - The state is not the most recently requested state. // // template <class S> // class CacheStore { // public: // using State = S; // using Arc = typename State::Arc; // using StateId = typename Arc::StateId; // // // Required constructors/assignment operators. // explicit CacheStore(const CacheOptions &opts); // // // Returns nullptr if state is not stored. // const State *GetState(StateId s); // // // Creates state if state is not stored. // State *GetMutableState(StateId s); // // // Similar to State::AddArc() but updates cache store book-keeping. // void AddArc(State *state, const Arc &arc); // // // Similar to State::SetArcs() but updates cache store book-keeping; call // // only once. // void SetArcs(State *state); // // // Similar to State::DeleteArcs() but updates cache store book-keeping. // // void DeleteArcs(State *state); // // void DeleteArcs(State *state, size_t n); // // // Deletes all cached states. // void Clear(); // // // Iterates over cached states (in an arbitrary order); only needed if // // opts.gc is true. // bool Done() const; // End of iteration. // StateId Value() const; // Current state. // void Next(); // Advances to next state (when !Done). // void Reset(); // Returns to initial condition. // void Delete(); // Deletes current state and advances to next. // }; // Container cache stores. // This class uses a vector of pointers to states to store cached states. template <class S> class VectorCacheStore { public: using State = S; using Arc = typename State::Arc; using StateId = typename Arc::StateId; using StateList = std::list<StateId, PoolAllocator<StateId>>; // Required constructors/assignment operators. explicit VectorCacheStore(const CacheOptions &opts) : cache_gc_(opts.gc) { Clear(); Reset(); } VectorCacheStore(const VectorCacheStore<S> &store) : cache_gc_(store.cache_gc_) { CopyStates(store); Reset(); } ~VectorCacheStore() { Clear(); } VectorCacheStore<State> &operator=(const VectorCacheStore<State> &store) { if (this != &store) { CopyStates(store); Reset(); } return *this; } // Returns nullptr if state is not stored. const State *GetState(StateId s) const { return s < state_vec_.size() ? state_vec_[s] : nullptr; } // Creates state if state is not stored. State *GetMutableState(StateId s) { State *state = nullptr; if (s >= state_vec_.size()) { state_vec_.resize(s + 1, nullptr); } else { state = state_vec_[s]; } if (!state) { state = new (&state_alloc_) State(arc_alloc_); state_vec_[s] = state; if (cache_gc_) state_list_.push_back(s); } return state; } // Similar to State::AddArc() but updates cache store book-keeping void AddArc(State *state, const Arc &arc) { state->AddArc(arc); } // Similar to State::SetArcs() but updates cache store book-keeping; call // only once. void SetArcs(State *state) { state->SetArcs(); } // Deletes all arcs. void DeleteArcs(State *state) { state->DeleteArcs(); } // Deletes some arcs. void DeleteArcs(State *state, size_t n) { state->DeleteArcs(n); } // Deletes all cached states. void Clear() { for (StateId s = 0; s < state_vec_.size(); ++s) { State::Destroy(state_vec_[s], &state_alloc_); } state_vec_.clear(); state_list_.clear(); } // Iterates over cached states (in an arbitrary order); only works if GC is // enabled (o.w. avoiding state_list_ overhead). bool Done() const { return iter_ == state_list_.end(); } StateId Value() const { return *iter_; } void Next() { ++iter_; } void Reset() { iter_ = state_list_.begin(); } // Deletes current state and advances to next. void Delete() { State::Destroy(state_vec_[*iter_], &state_alloc_); state_vec_[*iter_] = nullptr; state_list_.erase(iter_++); } private: void CopyStates(const VectorCacheStore<State> &store) { Clear(); state_vec_.reserve(store.state_vec_.size()); for (StateId s = 0; s < store.state_vec_.size(); ++s) { State *state = nullptr; const auto *store_state = store.state_vec_[s]; if (store_state) { state = new (&state_alloc_) State(*store_state, arc_alloc_); if (cache_gc_) state_list_.push_back(s); } state_vec_.push_back(state); } } bool cache_gc_; // Supports iteration when true. std::vector<State *> state_vec_; // Vector of states (or null). StateList state_list_; // List of states. typename StateList::iterator iter_; // State list iterator. typename State::StateAllocator state_alloc_; // For state allocation. typename State::ArcAllocator arc_alloc_; // For arc allocation. }; // This class uses a hash map from state IDs to pointers to cached states. template <class S> class HashCacheStore { public: using State = S; using Arc = typename State::Arc; using StateId = typename Arc::StateId; using StateMap = std::unordered_map<StateId, State *, std::hash<StateId>, std::equal_to<StateId>, PoolAllocator<std::pair<const StateId, State *>>>; // Required constructors/assignment operators. explicit HashCacheStore(const CacheOptions &opts) { Clear(); Reset(); } HashCacheStore(const HashCacheStore<S> &store) { CopyStates(store); Reset(); } ~HashCacheStore() { Clear(); } HashCacheStore<State> &operator=(const HashCacheStore<State> &store) { if (this != &store) { CopyStates(store); Reset(); } return *this; } // Returns nullptr if state is not stored. const State *GetState(StateId s) const { const auto it = state_map_.find(s); return it != state_map_.end() ? it->second : nullptr; } // Creates state if state is not stored. State *GetMutableState(StateId s) { auto *&state = state_map_[s]; if (!state) state = new (&state_alloc_) State(arc_alloc_); return state; } // Similar to State::AddArc() but updates cache store book-keeping. void AddArc(State *state, const Arc &arc) { state->AddArc(arc); } // Similar to State::SetArcs() but updates internal cache size; call only // once. void SetArcs(State *state) { state->SetArcs(); } // Deletes all arcs. void DeleteArcs(State *state) { state->DeleteArcs(); } // Deletes some arcs. void DeleteArcs(State *state, size_t n) { state->DeleteArcs(n); } // Deletes all cached states. void Clear() { for (auto it = state_map_.begin(); it != state_map_.end(); ++it) { State::Destroy(it->second, &state_alloc_); } state_map_.clear(); } // Iterates over cached states (in an arbitrary order). bool Done() const { return iter_ == state_map_.end(); } StateId Value() const { return iter_->first; } void Next() { ++iter_; } void Reset() { iter_ = state_map_.begin(); } // Deletes current state and advances to next. void Delete() { State::Destroy(iter_->second, &state_alloc_); state_map_.erase(iter_++); } private: void CopyStates(const HashCacheStore<State> &store) { Clear(); for (auto it = store.state_map_.begin(); it != store.state_map_.end(); ++it) { state_map_[it->first] = new (&state_alloc_) State(*it->second, arc_alloc_); } } StateMap state_map_; // Map from state ID to state. typename StateMap::iterator iter_; // State map iterator. typename State::StateAllocator state_alloc_; // For state allocation. typename State::ArcAllocator arc_alloc_; // For arc allocation. }; // Garbage-colllection cache stores. // This class implements a simple garbage collection scheme when // 'opts.gc_limit = 0'. In particular, the first cached state is reused for each // new state so long as the reference count is zero on the to-be-reused state. // Otherwise, the full underlying store is used. The caller can increment the // reference count to inhibit the GC of in-use states (e.g., in an ArcIterator). // // The typical use case for this optimization is when a single pass over a // cached // FST is performed with only one-state expanded at a time. template <class CacheStore> class FirstCacheStore { public: using State = typename CacheStore::State; using Arc = typename State::Arc; using StateId = typename Arc::StateId; // Required constructors/assignment operators. explicit FirstCacheStore(const CacheOptions &opts) : store_(opts), cache_gc_(opts.gc_limit == 0), // opts.gc ignored historically. cache_first_state_id_(kNoStateId), cache_first_state_(nullptr) {} FirstCacheStore(const FirstCacheStore<CacheStore> &store) : store_(store.store_), cache_gc_(store.cache_gc_), cache_first_state_id_(store.cache_first_state_id_), cache_first_state_(store.cache_first_state_id_ != kNoStateId ? store_.GetMutableState(0) : nullptr) {} FirstCacheStore<CacheStore> &operator=( const FirstCacheStore<CacheStore> &store) { if (this != &store) { store_ = store.store_; cache_gc_ = store.cache_gc_; cache_first_state_id_ = store.cache_first_state_id_; cache_first_state_ = store.cache_first_state_id_ != kNoStateId ? store_.GetMutableState(0) : nullptr; } return *this; } // Returns nullptr if state is not stored. const State *GetState(StateId s) const { // store_ state 0 may hold first cached state; the rest are shifted by 1. return s == cache_first_state_id_ ? cache_first_state_ : store_.GetState(s + 1); } // Creates state if state is not stored. State *GetMutableState(StateId s) { // store_ state 0 used to hold first cached state; the rest are shifted by // 1. if (cache_first_state_id_ == s) { return cache_first_state_; // Request for first cached state. } if (cache_gc_) { if (cache_first_state_id_ == kNoStateId) { cache_first_state_id_ = s; // Sets first cached state. cache_first_state_ = store_.GetMutableState(0); cache_first_state_->SetFlags(kCacheInit, kCacheInit); cache_first_state_->ReserveArcs(2 * kAllocSize); return cache_first_state_; } else if (cache_first_state_->RefCount() == 0) { cache_first_state_id_ = s; // Updates first cached state. cache_first_state_->Reset(); cache_first_state_->SetFlags(kCacheInit, kCacheInit); return cache_first_state_; } else { // Keeps first cached state. cache_first_state_->SetFlags(0, kCacheInit); // Clears initialized bit. cache_gc_ = false; // Disables GC. } } auto *state = store_.GetMutableState(s + 1); return state; } // Similar to State::AddArc() but updates cache store book-keeping. void AddArc(State *state, const Arc &arc) { store_.AddArc(state, arc); } // Similar to State::SetArcs() but updates internal cache size; call only // once. void SetArcs(State *state) { store_.SetArcs(state); } // Deletes all arcs void DeleteArcs(State *state) { store_.DeleteArcs(state); } // Deletes some arcs void DeleteArcs(State *state, size_t n) { store_.DeleteArcs(state, n); } // Deletes all cached states void Clear() { store_.Clear(); cache_first_state_id_ = kNoStateId; cache_first_state_ = nullptr; } // Iterates over cached states (in an arbitrary order). Only needed if GC is // enabled. bool Done() const { return store_.Done(); } StateId Value() const { // store_ state 0 may hold first cached state; rest shifted + 1. const auto s = store_.Value(); return s ? s - 1 : cache_first_state_id_; } void Next() { store_.Next(); } void Reset() { store_.Reset(); } // Deletes current state and advances to next. void Delete() { if (Value() == cache_first_state_id_) { cache_first_state_id_ = kNoStateId; cache_first_state_ = nullptr; } store_.Delete(); } private: CacheStore store_; // Underlying store. bool cache_gc_; // GC enabled. StateId cache_first_state_id_; // First cached state ID. State *cache_first_state_; // First cached state. }; // This class implements mark-sweep garbage collection on an underlying cache // store. If GC is enabled, garbage collection of states is performed in a // rough approximation of LRU order once when 'gc_limit' bytes is reached. The // caller can increment the reference count to inhibit the GC of in-use state // (e.g., in an ArcIterator). With GC enabled, the 'gc_limit' parameter allows // the caller to trade-off time vs. space. template <class CacheStore> class GCCacheStore { public: using State = typename CacheStore::State; using Arc = typename State::Arc; using StateId = typename Arc::StateId; // Required constructors/assignment operators. explicit GCCacheStore(const CacheOptions &opts) : store_(opts), cache_gc_request_(opts.gc), cache_limit_(opts.gc_limit > kMinCacheLimit ? opts.gc_limit : kMinCacheLimit), cache_gc_(false), cache_size_(0) {} // Returns 0 if state is not stored. const State *GetState(StateId s) const { return store_.GetState(s); } // Creates state if state is not stored State *GetMutableState(StateId s) { auto *state = store_.GetMutableState(s); if (cache_gc_request_ && !(state->Flags() & kCacheInit)) { state->SetFlags(kCacheInit, kCacheInit); cache_size_ += sizeof(State) + state->NumArcs() * sizeof(Arc); // GC is enabled once an uninited state (from underlying store) is seen. cache_gc_ = true; if (cache_size_ > cache_limit_) GC(state, false); } return state; } // Similar to State::AddArc() but updates cache store book-keeping. void AddArc(State *state, const Arc &arc) { store_.AddArc(state, arc); if (cache_gc_ && (state->Flags() & kCacheInit)) { cache_size_ += sizeof(Arc); if (cache_size_ > cache_limit_) GC(state, false); } } // Similar to State::SetArcs() but updates internal cache size; call only // once. void SetArcs(State *state) { store_.SetArcs(state); if (cache_gc_ && (state->Flags() & kCacheInit)) { cache_size_ += state->NumArcs() * sizeof(Arc); if (cache_size_ > cache_limit_) GC(state, false); } } // Deletes all arcs. void DeleteArcs(State *state) { if (cache_gc_ && (state->Flags() & kCacheInit)) { cache_size_ -= state->NumArcs() * sizeof(Arc); } store_.DeleteArcs(state); } // Deletes some arcs. void DeleteArcs(State *state, size_t n) { if (cache_gc_ && (state->Flags() & kCacheInit)) { cache_size_ -= n * sizeof(Arc); } store_.DeleteArcs(state, n); } // Deletes all cached states. void Clear() { store_.Clear(); cache_size_ = 0; } // Iterates over cached states (in an arbitrary order); only needed if GC is // enabled. bool Done() const { return store_.Done(); } StateId Value() const { return store_.Value(); } void Next() { store_.Next(); } void Reset() { store_.Reset(); } // Deletes current state and advances to next. void Delete() { if (cache_gc_) { const auto *state = store_.GetState(Value()); if (state->Flags() & kCacheInit) { cache_size_ -= sizeof(State) + state->NumArcs() * sizeof(Arc); } } store_.Delete(); } // Removes from the cache store (not referenced-counted and not the current) // states that have not been accessed since the last GC until at most // cache_fraction * cache_limit_ bytes are cached. If that fails to free // enough, attempts to uncaching recently visited states as well. If still // unable to free enough memory, then widens cache_limit_. void GC(const State *current, bool free_recent, float cache_fraction = 0.666); // Returns the current cache size in bytes or 0 if GC is disabled. size_t CacheSize() const { return cache_size_; } // Returns the cache limit in bytes. size_t CacheLimit() const { return cache_limit_; } private: static constexpr size_t kMinCacheLimit = 8096; // Minimum cache limit. CacheStore store_; // Underlying store. bool cache_gc_request_; // GC requested but possibly not yet enabled. size_t cache_limit_; // Number of bytes allowed before GC. bool cache_gc_; // GC enabled size_t cache_size_; // Number of bytes cached. }; template <class CacheStore> void GCCacheStore<CacheStore>::GC(const State *current, bool free_recent, float cache_fraction) { if (!cache_gc_) return; VLOG(2) << "GCCacheStore: Enter GC: object = " << "(" << this << "), free recently cached = " << free_recent << ", cache size = " << cache_size_ << ", cache frac = " << cache_fraction << ", cache limit = " << cache_limit_ << "\n"; size_t cache_target = cache_fraction * cache_limit_; store_.Reset(); while (!store_.Done()) { auto *state = store_.GetMutableState(store_.Value()); if (cache_size_ > cache_target && state->RefCount() == 0 && (free_recent || !(state->Flags() & kCacheRecent)) && state != current) { if (state->Flags() & kCacheInit) { size_t size = sizeof(State) + state->NumArcs() * sizeof(Arc); if (size < cache_size_) { cache_size_ -= size; } } store_.Delete(); } else { state->SetFlags(0, kCacheRecent); store_.Next(); } } if (!free_recent && cache_size_ > cache_target) { // Recurses on recent. GC(current, true, cache_fraction); } else if (cache_target > 0) { // Widens cache limit. while (cache_size_ > cache_target) { cache_limit_ *= 2; cache_target *= 2; } } else if (cache_size_ > 0) { FSTERROR() << "GCCacheStore:GC: Unable to free all cached states"; } VLOG(2) << "GCCacheStore: Exit GC: object = " << "(" << this << "), free recently cached = " << free_recent << ", cache size = " << cache_size_ << ", cache frac = " << cache_fraction << ", cache limit = " << cache_limit_ << "\n"; } template <class CacheStore> constexpr size_t GCCacheStore<CacheStore>::kMinCacheLimit; // This class is the default cache state and store used by CacheBaseImpl. // It uses VectorCacheStore for storage decorated by FirstCacheStore // and GCCacheStore to do (optional) garbage collection. template <class Arc> class DefaultCacheStore : public GCCacheStore<FirstCacheStore<VectorCacheStore<CacheState<Arc>>>> { public: explicit DefaultCacheStore(const CacheOptions &opts) : GCCacheStore<FirstCacheStore<VectorCacheStore<CacheState<Arc>>>>(opts) { } }; namespace internal { // This class is used to cache FST elements stored in states of type State // (see CacheState) with the flags used to indicate what has been cached. Use // HasStart(), HasFinal(), and HasArcs() to determine if cached and SetStart(), // SetFinal(), AddArc(), (or PushArc() and SetArcs()) to cache. Note that you // must set the final weight even if the state is non-final to mark it as // cached. The state storage method and any garbage collection policy are // determined by the cache store. If the store is passed in with the options, // CacheBaseImpl takes ownership. template <class State, class CacheStore = DefaultCacheStore<typename State::Arc>> class CacheBaseImpl : public FstImpl<typename State::Arc> { public: using Arc = typename State::Arc; using StateId = typename Arc::StateId; using Weight = typename Arc::Weight; using Store = CacheStore; using FstImpl<Arc>::Type; using FstImpl<Arc>::Properties; explicit CacheBaseImpl(const CacheOptions &opts = CacheOptions()) : has_start_(false), cache_start_(kNoStateId), nknown_states_(0), min_unexpanded_state_id_(0), max_expanded_state_id_(-1), cache_gc_(opts.gc), cache_limit_(opts.gc_limit), cache_store_(new CacheStore(opts)), new_cache_store_(true), own_cache_store_(true) {} explicit CacheBaseImpl(const CacheImplOptions<CacheStore> &opts) : has_start_(false), cache_start_(kNoStateId), nknown_states_(0), min_unexpanded_state_id_(0), max_expanded_state_id_(-1), cache_gc_(opts.gc), cache_limit_(opts.gc_limit), cache_store_(opts.store ? opts.store : new CacheStore(CacheOptions( opts.gc, opts.gc_limit))), new_cache_store_(!opts.store), own_cache_store_(opts.store ? opts.own_store : true) {} // Preserve gc parameters. If preserve_cache is true, also preserves // cache data. CacheBaseImpl(const CacheBaseImpl<State, CacheStore> &impl, bool preserve_cache = false) : FstImpl<Arc>(), has_start_(false), cache_start_(kNoStateId), nknown_states_(0), min_unexpanded_state_id_(0), max_expanded_state_id_(-1), cache_gc_(impl.cache_gc_), cache_limit_(impl.cache_limit_), cache_store_(new CacheStore(CacheOptions(cache_gc_, cache_limit_))), new_cache_store_(impl.new_cache_store_ || !preserve_cache), own_cache_store_(true) { if (preserve_cache) { *cache_store_ = *impl.cache_store_; has_start_ = impl.has_start_; cache_start_ = impl.cache_start_; nknown_states_ = impl.nknown_states_; expanded_states_ = impl.expanded_states_; min_unexpanded_state_id_ = impl.min_unexpanded_state_id_; max_expanded_state_id_ = impl.max_expanded_state_id_; } } ~CacheBaseImpl() override { if (own_cache_store_) delete cache_store_; } void SetStart(StateId s) { cache_start_ = s; has_start_ = true; if (s >= nknown_states_) nknown_states_ = s + 1; } void SetFinal(StateId s, Weight weight) { auto *state = cache_store_->GetMutableState(s); state->SetFinal(std::move(weight)); static constexpr auto flags = kCacheFinal | kCacheRecent; state->SetFlags(flags, flags); } // Disabled to ensure PushArc not AddArc is used in existing code // TODO(sorenj): re-enable for backing store #if 0 // AddArc adds a single arc to a state and does incremental cache // book-keeping. For efficiency, prefer PushArc and SetArcs below // when possible. void AddArc(StateId s, const Arc &arc) { auto *state = cache_store_->GetMutableState(s); cache_store_->AddArc(state, arc); if (arc.nextstate >= nknown_states_) nknown_states_ = arc.nextstate + 1; SetExpandedState(s); static constexpr auto flags = kCacheArcs | kCacheRecent; state->SetFlags(flags, flags); } #endif // Adds a single arc to a state but delays cache book-keeping. SetArcs must // be called when all PushArc calls at a state are complete. Do not mix with // calls to AddArc. void PushArc(StateId s, const Arc &arc) { auto *state = cache_store_->GetMutableState(s); state->PushArc(arc); } // Marks arcs of a state as cached and does cache book-keeping after all // calls to PushArc have been completed. Do not mix with calls to AddArc. void SetArcs(StateId s) { auto *state = cache_store_->GetMutableState(s); cache_store_->SetArcs(state); const auto narcs = state->NumArcs(); for (size_t a = 0; a < narcs; ++a) { const auto &arc = state->GetArc(a); if (arc.nextstate >= nknown_states_) nknown_states_ = arc.nextstate + 1; } SetExpandedState(s); static constexpr auto flags = kCacheArcs | kCacheRecent; state->SetFlags(flags, flags); } void ReserveArcs(StateId s, size_t n) { auto *state = cache_store_->GetMutableState(s); state->ReserveArcs(n); } void DeleteArcs(StateId s) { auto *state = cache_store_->GetMutableState(s); cache_store_->DeleteArcs(state); } void DeleteArcs(StateId s, size_t n) { auto *state = cache_store_->GetMutableState(s); cache_store_->DeleteArcs(state, n); } void Clear() { nknown_states_ = 0; min_unexpanded_state_id_ = 0; max_expanded_state_id_ = -1; has_start_ = false; cache_start_ = kNoStateId; cache_store_->Clear(); } // Is the start state cached? bool HasStart() const { if (!has_start_ && Properties(kError)) has_start_ = true; return has_start_; } // Is the final weight of the state cached? bool HasFinal(StateId s) const { const auto *state = cache_store_->GetState(s); if (state && state->Flags() & kCacheFinal) { state->SetFlags(kCacheRecent, kCacheRecent); return true; } else { return false; } } // Are arcs of the state cached? bool HasArcs(StateId s) const { const auto *state = cache_store_->GetState(s); if (state && state->Flags() & kCacheArcs) { state->SetFlags(kCacheRecent, kCacheRecent); return true; } else { return false; } } StateId Start() const { return cache_start_; } Weight Final(StateId s) const { const auto *state = cache_store_->GetState(s); return state->Final(); } size_t NumArcs(StateId s) const { const auto *state = cache_store_->GetState(s); return state->NumArcs(); } size_t NumInputEpsilons(StateId s) const { const auto *state = cache_store_->GetState(s); return state->NumInputEpsilons(); } size_t NumOutputEpsilons(StateId s) const { const auto *state = cache_store_->GetState(s); return state->NumOutputEpsilons(); } // Provides information needed for generic arc iterator. void InitArcIterator(StateId s, ArcIteratorData<Arc> *data) const { const auto *state = cache_store_->GetState(s); data->base = nullptr; data->narcs = state->NumArcs(); data->arcs = state->Arcs(); data->ref_count = state->MutableRefCount(); state->IncrRefCount(); } // Number of known states. StateId NumKnownStates() const { return nknown_states_; } // Updates number of known states, taking into account the passed state ID. void UpdateNumKnownStates(StateId s) { if (s >= nknown_states_) nknown_states_ = s + 1; } // Finds the mininum never-expanded state ID. StateId MinUnexpandedState() const { while (min_unexpanded_state_id_ <= max_expanded_state_id_ && ExpandedState(min_unexpanded_state_id_)) { ++min_unexpanded_state_id_; } return min_unexpanded_state_id_; } // Returns maximum ever-expanded state ID. StateId MaxExpandedState() const { return max_expanded_state_id_; } void SetExpandedState(StateId s) { if (s > max_expanded_state_id_) max_expanded_state_id_ = s; if (s < min_unexpanded_state_id_) return; if (s == min_unexpanded_state_id_) ++min_unexpanded_state_id_; if (cache_gc_ || cache_limit_ == 0) { if (expanded_states_.size() <= s) expanded_states_.resize(s + 1, false); expanded_states_[s] = true; } } bool ExpandedState(StateId s) const { if (cache_gc_ || cache_limit_ == 0) { return expanded_states_[s]; } else if (new_cache_store_) { return cache_store_->GetState(s) != nullptr; } else { // If the cache was not created by this class, then the cached state needs // to be inspected to update nknown_states_. return false; } } const CacheStore *GetCacheStore() const { return cache_store_; } CacheStore *GetCacheStore() { return cache_store_; } // Caching on/off switch, limit and size accessors. bool GetCacheGc() const { return cache_gc_; } size_t GetCacheLimit() const { return cache_limit_; } private: mutable bool has_start_; // Is the start state cached? StateId cache_start_; // ID of start state. StateId nknown_states_; // Number of known states. std::vector<bool> expanded_states_; // States that have been expanded. mutable StateId min_unexpanded_state_id_; // Minimum never-expanded state ID mutable StateId max_expanded_state_id_; // Maximum ever-expanded state ID bool cache_gc_; // GC enabled. size_t cache_limit_; // Number of bytes allowed before GC. CacheStore *cache_store_; // The store of cached states. bool new_cache_store_; // Was the store was created by class? bool own_cache_store_; // Is the store owned by class? CacheBaseImpl &operator=(const CacheBaseImpl &impl) = delete; }; // A CacheBaseImpl with the default cache state type. template <class Arc> class CacheImpl : public CacheBaseImpl<CacheState<Arc>> { public: using State = CacheState<Arc>; CacheImpl() {} explicit CacheImpl(const CacheOptions &opts) : CacheBaseImpl<CacheState<Arc>>(opts) {} CacheImpl(const CacheImpl<Arc> &impl, bool preserve_cache = false) : CacheBaseImpl<State>(impl, preserve_cache) {} private: CacheImpl &operator=(const CacheImpl &impl) = delete; }; } // namespace internal // Use this to make a state iterator for a CacheBaseImpl-derived FST, which must // have Arc and Store types defined. Note this iterator only returns those // states reachable from the initial state, so consider implementing a // class-specific one. // // This class may be derived from. template <class FST> class CacheStateIterator : public StateIteratorBase<typename FST::Arc> { public: using Arc = typename FST::Arc; using StateId = typename Arc::StateId; using Weight = typename Arc::Weight; using Store = typename FST::Store; using State = typename Store::State; using Impl = internal::CacheBaseImpl<State, Store>; CacheStateIterator(const FST &fst, Impl *impl) : fst_(fst), impl_(impl), s_(0) { fst_.Start(); // Forces start state. } bool Done() const final { if (s_ < impl_->NumKnownStates()) return false; for (StateId u = impl_->MinUnexpandedState(); u < impl_->NumKnownStates(); u = impl_->MinUnexpandedState()) { // Forces state expansion. ArcIterator<FST> aiter(fst_, u); aiter.SetFlags(kArcValueFlags, kArcValueFlags | kArcNoCache); for (; !aiter.Done(); aiter.Next()) { impl_->UpdateNumKnownStates(aiter.Value().nextstate); } impl_->SetExpandedState(u); if (s_ < impl_->NumKnownStates()) return false; } return true; } StateId Value() const final { return s_; } void Next() final { ++s_; } void Reset() final { s_ = 0; } private: const FST &fst_; Impl *impl_; StateId s_; }; // Used to make an arc iterator for a CacheBaseImpl-derived FST, which must // have Arc and State types defined. template <class FST> class CacheArcIterator { public: using Arc = typename FST::Arc; using StateId = typename Arc::StateId; using Weight = typename Arc::Weight; using Store = typename FST::Store; using State = typename Store::State; using Impl = internal::CacheBaseImpl<State, Store>; CacheArcIterator(Impl *impl, StateId s) : i_(0) { state_ = impl->GetCacheStore()->GetMutableState(s); state_->IncrRefCount(); } ~CacheArcIterator() { state_->DecrRefCount(); } bool Done() const { return i_ >= state_->NumArcs(); } const Arc &Value() const { return state_->GetArc(i_); } void Next() { ++i_; } size_t Position() const { return i_; } void Reset() { i_ = 0; } void Seek(size_t a) { i_ = a; } constexpr uint32 Flags() const { return kArcValueFlags; } void SetFlags(uint32 flags, uint32 mask) {} private: const State *state_; size_t i_; CacheArcIterator(const CacheArcIterator &) = delete; CacheArcIterator &operator=(const CacheArcIterator &) = delete; }; // Use this to make a mutable arc iterator for a CacheBaseImpl-derived FST, // which must have types Arc and Store defined. template <class FST> class CacheMutableArcIterator : public MutableArcIteratorBase<typename FST::Arc> { public: using Arc = typename FST::Arc; using StateId = typename Arc::StateId; using Weight = typename Arc::Weight; using Store = typename FST::Store; using State = typename Store::State; using Impl = internal::CacheBaseImpl<State, Store>; // User must call MutateCheck() in the constructor. CacheMutableArcIterator(Impl *impl, StateId s) : i_(0), s_(s), impl_(impl) { state_ = impl_->GetCacheStore()->GetMutableState(s_); state_->IncrRefCount(); } ~CacheMutableArcIterator() override { state_->DecrRefCount(); } bool Done() const final { return i_ >= state_->NumArcs(); } const Arc &Value() const final { return state_->GetArc(i_); } void Next() final { ++i_; } size_t Position() const final { return i_; } void Reset() final { i_ = 0; } void Seek(size_t a) final { i_ = a; } void SetValue(const Arc &arc) final { state_->SetArc(arc, i_); } uint32 Flags() const final { return kArcValueFlags; } void SetFlags(uint32, uint32) final {} private: size_t i_; StateId s_; Impl *impl_; State *state_; CacheMutableArcIterator(const CacheMutableArcIterator &) = delete; CacheMutableArcIterator &operator=(const CacheMutableArcIterator &) = delete; }; // Wrap existing CacheStore implementation to use with ExpanderFst. template <class CacheStore> class ExpanderCacheStore { public: using State = typename CacheStore::State; using Arc = typename CacheStore::Arc; using StateId = typename Arc::StateId; using Weight = typename Arc::Weight; explicit ExpanderCacheStore(const CacheOptions &opts = CacheOptions()) : store_(opts) {} template <class Expander> State *FindOrExpand(Expander &expander, StateId s) { // NOLINT auto *state = store_.GetMutableState(s); if (state->Flags()) { state->SetFlags(kCacheRecent, kCacheRecent); } else { StateBuilder builder(state); expander.Expand(s, &builder); state->SetFlags(kCacheFlags, kCacheFlags); store_.SetArcs(state); } return state; } private: CacheStore store_; struct StateBuilder { State *state; explicit StateBuilder(State *state_) : state(state_) {} void AddArc(const Arc &arc) { state->PushArc(arc); } void SetFinal(Weight weight) { state->SetFinal(std::move(weight)); } }; }; } // namespace fst #endif // FST_CACHE_H_
0