repo_name stringlengths 7 104 | file_path stringlengths 13 198 | context stringlengths 67 7.15k | import_statement stringlengths 16 4.43k | code stringlengths 40 6.98k | prompt stringlengths 227 8.27k | next_line stringlengths 8 795 |
|---|---|---|---|---|---|---|
RentTheRunway/conduit | conduit/src/main/java/io/rtr/conduit/amqp/publisher/Publisher.java | // Path: conduit/src/main/java/io/rtr/conduit/amqp/transport/TransportMessageBundle.java
// public interface TransportMessageBundle {
// }
//
// Path: conduit/src/main/java/io/rtr/conduit/amqp/transport/TransportPublishContext.java
// public interface TransportPublishContext {
// Transport getTransport();
// T... | import io.rtr.conduit.amqp.transport.TransportMessageBundle;
import io.rtr.conduit.amqp.transport.TransportPublishContext;
import io.rtr.conduit.amqp.transport.TransportPublishProperties;
import java.io.IOException;
import java.util.Collection;
import java.util.concurrent.TimeoutException; | package io.rtr.conduit.amqp.publisher;
/**
* The publisher operates in terms of a publish context; an encapsulation of a
* concrete transport and its properties.
* Example:
*
* AMQPPublishContext context = new AMQPPublishContext(
* username, password, virtualHost, exchange, routingKey, host, port
* );... | // Path: conduit/src/main/java/io/rtr/conduit/amqp/transport/TransportMessageBundle.java
// public interface TransportMessageBundle {
// }
//
// Path: conduit/src/main/java/io/rtr/conduit/amqp/transport/TransportPublishContext.java
// public interface TransportPublishContext {
// Transport getTransport();
// T... | public boolean publish(TransportMessageBundle messageBundle, TransportPublishProperties overridePublishProperties) |
RentTheRunway/conduit | conduit/src/test/java/io/rtr/conduit/amqp/impl/AMQPTransportTest.java | // Path: conduit/src/main/java/io/rtr/conduit/amqp/AMQPConsumerCallback.java
// public interface AMQPConsumerCallback {
// ActionResponse handle(AMQPMessageBundle messageBundle);
// void notifyOfActionFailure(Exception e);
// void notifyOfShutdown(String consumerTag, ShutdownSignalException sig);
// }
//
/... | import com.rabbitmq.client.AMQP;
import com.rabbitmq.client.Channel;
import com.rabbitmq.client.ConnectionFactory;
import com.rabbitmq.client.Consumer;
import com.rabbitmq.client.impl.AMQImpl;
import io.rtr.conduit.amqp.AMQPConsumerCallback;
import io.rtr.conduit.amqp.AMQPMessageBundle;
import org.junit.jupiter.api.Bef... | package io.rtr.conduit.amqp.impl;
public class AMQPTransportTest {
Channel channel;
AMQPTransport amqpTransport;
AMQPPublishProperties properties; | // Path: conduit/src/main/java/io/rtr/conduit/amqp/AMQPConsumerCallback.java
// public interface AMQPConsumerCallback {
// ActionResponse handle(AMQPMessageBundle messageBundle);
// void notifyOfActionFailure(Exception e);
// void notifyOfShutdown(String consumerTag, ShutdownSignalException sig);
// }
//
/... | AMQPMessageBundle messageBundle; |
RentTheRunway/conduit | conduit/src/test/java/io/rtr/conduit/amqp/impl/AMQPTransportTest.java | // Path: conduit/src/main/java/io/rtr/conduit/amqp/AMQPConsumerCallback.java
// public interface AMQPConsumerCallback {
// ActionResponse handle(AMQPMessageBundle messageBundle);
// void notifyOfActionFailure(Exception e);
// void notifyOfShutdown(String consumerTag, ShutdownSignalException sig);
// }
//
/... | import com.rabbitmq.client.AMQP;
import com.rabbitmq.client.Channel;
import com.rabbitmq.client.ConnectionFactory;
import com.rabbitmq.client.Consumer;
import com.rabbitmq.client.impl.AMQImpl;
import io.rtr.conduit.amqp.AMQPConsumerCallback;
import io.rtr.conduit.amqp.AMQPMessageBundle;
import org.junit.jupiter.api.Bef... | package io.rtr.conduit.amqp.impl;
public class AMQPTransportTest {
Channel channel;
AMQPTransport amqpTransport;
AMQPPublishProperties properties;
AMQPMessageBundle messageBundle; | // Path: conduit/src/main/java/io/rtr/conduit/amqp/AMQPConsumerCallback.java
// public interface AMQPConsumerCallback {
// ActionResponse handle(AMQPMessageBundle messageBundle);
// void notifyOfActionFailure(Exception e);
// void notifyOfShutdown(String consumerTag, ShutdownSignalException sig);
// }
//
/... | AMQPConsumerCallback consumerCallback = mock(AMQPConsumerCallback.class); |
RentTheRunway/conduit | conduit/src/main/java/io/rtr/conduit/amqp/impl/AMQPPublishContext.java | // Path: conduit/src/main/java/io/rtr/conduit/amqp/transport/Transport.java
// public abstract class Transport {
// //! Public interface.
//
// //! Establishes a connection to either an intermediary or the other
// // end point. In the case of AMQP, this method is used to connect
// // to the broker.... | import io.rtr.conduit.amqp.transport.Transport;
import io.rtr.conduit.amqp.transport.TransportConnectionProperties;
import io.rtr.conduit.amqp.transport.TransportPublishContext;
import io.rtr.conduit.amqp.transport.TransportPublishProperties; | package io.rtr.conduit.amqp.impl;
public class AMQPPublishContext implements TransportPublishContext {
private AMQPTransport transport;
private AMQPConnectionProperties connectionProperties;
private AMQPPublishProperties publishProperties;
AMQPPublishContext(
AMQPTransport transport
... | // Path: conduit/src/main/java/io/rtr/conduit/amqp/transport/Transport.java
// public abstract class Transport {
// //! Public interface.
//
// //! Establishes a connection to either an intermediary or the other
// // end point. In the case of AMQP, this method is used to connect
// // to the broker.... | public Transport getTransport() { |
RentTheRunway/conduit | conduit/src/main/java/io/rtr/conduit/amqp/impl/AMQPPublishContext.java | // Path: conduit/src/main/java/io/rtr/conduit/amqp/transport/Transport.java
// public abstract class Transport {
// //! Public interface.
//
// //! Establishes a connection to either an intermediary or the other
// // end point. In the case of AMQP, this method is used to connect
// // to the broker.... | import io.rtr.conduit.amqp.transport.Transport;
import io.rtr.conduit.amqp.transport.TransportConnectionProperties;
import io.rtr.conduit.amqp.transport.TransportPublishContext;
import io.rtr.conduit.amqp.transport.TransportPublishProperties; | package io.rtr.conduit.amqp.impl;
public class AMQPPublishContext implements TransportPublishContext {
private AMQPTransport transport;
private AMQPConnectionProperties connectionProperties;
private AMQPPublishProperties publishProperties;
AMQPPublishContext(
AMQPTransport transport
... | // Path: conduit/src/main/java/io/rtr/conduit/amqp/transport/Transport.java
// public abstract class Transport {
// //! Public interface.
//
// //! Establishes a connection to either an intermediary or the other
// // end point. In the case of AMQP, this method is used to connect
// // to the broker.... | public TransportConnectionProperties getConnectionProperties() { |
RentTheRunway/conduit | conduit/src/main/java/io/rtr/conduit/amqp/impl/AMQPPublishContext.java | // Path: conduit/src/main/java/io/rtr/conduit/amqp/transport/Transport.java
// public abstract class Transport {
// //! Public interface.
//
// //! Establishes a connection to either an intermediary or the other
// // end point. In the case of AMQP, this method is used to connect
// // to the broker.... | import io.rtr.conduit.amqp.transport.Transport;
import io.rtr.conduit.amqp.transport.TransportConnectionProperties;
import io.rtr.conduit.amqp.transport.TransportPublishContext;
import io.rtr.conduit.amqp.transport.TransportPublishProperties; | package io.rtr.conduit.amqp.impl;
public class AMQPPublishContext implements TransportPublishContext {
private AMQPTransport transport;
private AMQPConnectionProperties connectionProperties;
private AMQPPublishProperties publishProperties;
AMQPPublishContext(
AMQPTransport transport
... | // Path: conduit/src/main/java/io/rtr/conduit/amqp/transport/Transport.java
// public abstract class Transport {
// //! Public interface.
//
// //! Establishes a connection to either an intermediary or the other
// // end point. In the case of AMQP, this method is used to connect
// // to the broker.... | public TransportPublishProperties getPublishProperties() { |
RentTheRunway/conduit | conduit/src/main/java/io/rtr/conduit/amqp/impl/AMQPAsyncTransport.java | // Path: conduit/src/main/java/io/rtr/conduit/amqp/AMQPAsyncConsumerCallback.java
// public interface AMQPAsyncConsumerCallback {
// void handle(AMQPMessageBundle messageBundle, AsyncResponse response);
// void notifyOfActionFailure(Exception e);
// void notifyOfShutdown(String consumerTag, ShutdownSignalEx... | import com.rabbitmq.client.MetricsCollector;
import io.rtr.conduit.amqp.AMQPAsyncConsumerCallback;
import io.rtr.conduit.amqp.transport.TransportListenProperties; | package io.rtr.conduit.amqp.impl;
public class AMQPAsyncTransport extends AMQPTransport {
public AMQPAsyncTransport(boolean ssl, String host, int port, MetricsCollector metricsCollector) {
super(ssl, host, port, metricsCollector);
}
public AMQPAsyncTransport(AMQPConnection sharedConnection) {
... | // Path: conduit/src/main/java/io/rtr/conduit/amqp/AMQPAsyncConsumerCallback.java
// public interface AMQPAsyncConsumerCallback {
// void handle(AMQPMessageBundle messageBundle, AsyncResponse response);
// void notifyOfActionFailure(Exception e);
// void notifyOfShutdown(String consumerTag, ShutdownSignalEx... | (AMQPAsyncConsumerCallback) callback, |
RentTheRunway/conduit | conduit/src/main/java/io/rtr/conduit/amqp/impl/AMQPAsyncTransport.java | // Path: conduit/src/main/java/io/rtr/conduit/amqp/AMQPAsyncConsumerCallback.java
// public interface AMQPAsyncConsumerCallback {
// void handle(AMQPMessageBundle messageBundle, AsyncResponse response);
// void notifyOfActionFailure(Exception e);
// void notifyOfShutdown(String consumerTag, ShutdownSignalEx... | import com.rabbitmq.client.MetricsCollector;
import io.rtr.conduit.amqp.AMQPAsyncConsumerCallback;
import io.rtr.conduit.amqp.transport.TransportListenProperties; | package io.rtr.conduit.amqp.impl;
public class AMQPAsyncTransport extends AMQPTransport {
public AMQPAsyncTransport(boolean ssl, String host, int port, MetricsCollector metricsCollector) {
super(ssl, host, port, metricsCollector);
}
public AMQPAsyncTransport(AMQPConnection sharedConnection) {
... | // Path: conduit/src/main/java/io/rtr/conduit/amqp/AMQPAsyncConsumerCallback.java
// public interface AMQPAsyncConsumerCallback {
// void handle(AMQPMessageBundle messageBundle, AsyncResponse response);
// void notifyOfActionFailure(Exception e);
// void notifyOfShutdown(String consumerTag, ShutdownSignalEx... | protected AMQPCommonListenProperties getCommonListenProperties(TransportListenProperties properties) { |
RentTheRunway/conduit | conduit/src/main/java/io/rtr/conduit/amqp/impl/AMQPTransport.java | // Path: conduit/src/main/java/io/rtr/conduit/amqp/AMQPConsumerCallback.java
// public interface AMQPConsumerCallback {
// ActionResponse handle(AMQPMessageBundle messageBundle);
// void notifyOfActionFailure(Exception e);
// void notifyOfShutdown(String consumerTag, ShutdownSignalException sig);
// }
//
/... | import com.rabbitmq.client.AlreadyClosedException;
import com.rabbitmq.client.Channel;
import com.rabbitmq.client.MetricsCollector;
import com.rabbitmq.client.ShutdownListener;
import com.rabbitmq.client.ShutdownSignalException;
import io.rtr.conduit.amqp.AMQPConsumerCallback;
import io.rtr.conduit.amqp.AMQPMessageBund... | private final boolean hasPrivateConnection;
private Channel channel;
static final String POISON = ".poison";
private String dynamicQueue;
private boolean dynamicPoisonQueueInUse = false;
protected AMQPTransport(boolean ssl, String host, int port, MetricsCollector metricsCollector) {
thi... | // Path: conduit/src/main/java/io/rtr/conduit/amqp/AMQPConsumerCallback.java
// public interface AMQPConsumerCallback {
// ActionResponse handle(AMQPMessageBundle messageBundle);
// void notifyOfActionFailure(Exception e);
// void notifyOfShutdown(String consumerTag, ShutdownSignalException sig);
// }
//
/... | protected void connectImpl(TransportConnectionProperties properties) throws IOException { |
RentTheRunway/conduit | conduit/src/main/java/io/rtr/conduit/amqp/impl/AMQPTransport.java | // Path: conduit/src/main/java/io/rtr/conduit/amqp/AMQPConsumerCallback.java
// public interface AMQPConsumerCallback {
// ActionResponse handle(AMQPMessageBundle messageBundle);
// void notifyOfActionFailure(Exception e);
// void notifyOfShutdown(String consumerTag, ShutdownSignalException sig);
// }
//
/... | import com.rabbitmq.client.AlreadyClosedException;
import com.rabbitmq.client.Channel;
import com.rabbitmq.client.MetricsCollector;
import com.rabbitmq.client.ShutdownListener;
import com.rabbitmq.client.ShutdownSignalException;
import io.rtr.conduit.amqp.AMQPConsumerCallback;
import io.rtr.conduit.amqp.AMQPMessageBund... | protected void connectImpl(TransportConnectionProperties properties) throws IOException {
if (hasPrivateConnection && !isConnected()) {
try {
conn.connect((AMQPConnectionProperties) properties);
} catch (TimeoutException e) {
throw new IOException("Tim... | // Path: conduit/src/main/java/io/rtr/conduit/amqp/AMQPConsumerCallback.java
// public interface AMQPConsumerCallback {
// ActionResponse handle(AMQPMessageBundle messageBundle);
// void notifyOfActionFailure(Exception e);
// void notifyOfShutdown(String consumerTag, ShutdownSignalException sig);
// }
//
/... | (AMQPConsumerCallback) callback, |
RentTheRunway/conduit | conduit/src/main/java/io/rtr/conduit/amqp/impl/AMQPTransport.java | // Path: conduit/src/main/java/io/rtr/conduit/amqp/AMQPConsumerCallback.java
// public interface AMQPConsumerCallback {
// ActionResponse handle(AMQPMessageBundle messageBundle);
// void notifyOfActionFailure(Exception e);
// void notifyOfShutdown(String consumerTag, ShutdownSignalException sig);
// }
//
/... | import com.rabbitmq.client.AlreadyClosedException;
import com.rabbitmq.client.Channel;
import com.rabbitmq.client.MetricsCollector;
import com.rabbitmq.client.ShutdownListener;
import com.rabbitmq.client.ShutdownSignalException;
import io.rtr.conduit.amqp.AMQPConsumerCallback;
import io.rtr.conduit.amqp.AMQPMessageBund... |
if (channel == null || !channel.isOpen()) {
channel = conn.createChannel();
}
}
@Override
protected void closeImpl() throws IOException {
if (hasPrivateConnection) {
if (conn.isConnected()) {
conn.disconnect();
}
}
... | // Path: conduit/src/main/java/io/rtr/conduit/amqp/AMQPConsumerCallback.java
// public interface AMQPConsumerCallback {
// ActionResponse handle(AMQPMessageBundle messageBundle);
// void notifyOfActionFailure(Exception e);
// void notifyOfShutdown(String consumerTag, ShutdownSignalException sig);
// }
//
/... | protected AMQPCommonListenProperties getCommonListenProperties(TransportListenProperties properties) { |
RentTheRunway/conduit | conduit/src/main/java/io/rtr/conduit/amqp/impl/AMQPTransport.java | // Path: conduit/src/main/java/io/rtr/conduit/amqp/AMQPConsumerCallback.java
// public interface AMQPConsumerCallback {
// ActionResponse handle(AMQPMessageBundle messageBundle);
// void notifyOfActionFailure(Exception e);
// void notifyOfShutdown(String consumerTag, ShutdownSignalException sig);
// }
//
/... | import com.rabbitmq.client.AlreadyClosedException;
import com.rabbitmq.client.Channel;
import com.rabbitmq.client.MetricsCollector;
import com.rabbitmq.client.ShutdownListener;
import com.rabbitmq.client.ShutdownSignalException;
import io.rtr.conduit.amqp.AMQPConsumerCallback;
import io.rtr.conduit.amqp.AMQPMessageBund... | }
@Override
protected void stopImpl() throws IOException {
// As with closing the connection, closing an already
// closed channel is considered success.
if (channel != null && channel.isOpen()) {
try {
channel.close();
} catch (TimeoutExcept... | // Path: conduit/src/main/java/io/rtr/conduit/amqp/AMQPConsumerCallback.java
// public interface AMQPConsumerCallback {
// ActionResponse handle(AMQPMessageBundle messageBundle);
// void notifyOfActionFailure(Exception e);
// void notifyOfShutdown(String consumerTag, ShutdownSignalException sig);
// }
//
/... | protected boolean publishImpl(TransportMessageBundle bundle, TransportPublishProperties properties) |
RentTheRunway/conduit | conduit/src/main/java/io/rtr/conduit/amqp/impl/AMQPTransport.java | // Path: conduit/src/main/java/io/rtr/conduit/amqp/AMQPConsumerCallback.java
// public interface AMQPConsumerCallback {
// ActionResponse handle(AMQPMessageBundle messageBundle);
// void notifyOfActionFailure(Exception e);
// void notifyOfShutdown(String consumerTag, ShutdownSignalException sig);
// }
//
/... | import com.rabbitmq.client.AlreadyClosedException;
import com.rabbitmq.client.Channel;
import com.rabbitmq.client.MetricsCollector;
import com.rabbitmq.client.ShutdownListener;
import com.rabbitmq.client.ShutdownSignalException;
import io.rtr.conduit.amqp.AMQPConsumerCallback;
import io.rtr.conduit.amqp.AMQPMessageBund... | }
@Override
protected void stopImpl() throws IOException {
// As with closing the connection, closing an already
// closed channel is considered success.
if (channel != null && channel.isOpen()) {
try {
channel.close();
} catch (TimeoutExcept... | // Path: conduit/src/main/java/io/rtr/conduit/amqp/AMQPConsumerCallback.java
// public interface AMQPConsumerCallback {
// ActionResponse handle(AMQPMessageBundle messageBundle);
// void notifyOfActionFailure(Exception e);
// void notifyOfShutdown(String consumerTag, ShutdownSignalException sig);
// }
//
/... | protected boolean publishImpl(TransportMessageBundle bundle, TransportPublishProperties properties) |
RentTheRunway/conduit | conduit/src/main/java/io/rtr/conduit/amqp/impl/AMQPTransport.java | // Path: conduit/src/main/java/io/rtr/conduit/amqp/AMQPConsumerCallback.java
// public interface AMQPConsumerCallback {
// ActionResponse handle(AMQPMessageBundle messageBundle);
// void notifyOfActionFailure(Exception e);
// void notifyOfShutdown(String consumerTag, ShutdownSignalException sig);
// }
//
/... | import com.rabbitmq.client.AlreadyClosedException;
import com.rabbitmq.client.Channel;
import com.rabbitmq.client.MetricsCollector;
import com.rabbitmq.client.ShutdownListener;
import com.rabbitmq.client.ShutdownSignalException;
import io.rtr.conduit.amqp.AMQPConsumerCallback;
import io.rtr.conduit.amqp.AMQPMessageBund... | protected void stopImpl() throws IOException {
// As with closing the connection, closing an already
// closed channel is considered success.
if (channel != null && channel.isOpen()) {
try {
channel.close();
} catch (TimeoutException e) {
... | // Path: conduit/src/main/java/io/rtr/conduit/amqp/AMQPConsumerCallback.java
// public interface AMQPConsumerCallback {
// ActionResponse handle(AMQPMessageBundle messageBundle);
// void notifyOfActionFailure(Exception e);
// void notifyOfShutdown(String consumerTag, ShutdownSignalException sig);
// }
//
/... | AMQPMessageBundle messageBundle = (AMQPMessageBundle) bundle; |
RentTheRunway/conduit | conduit/src/main/java/io/rtr/conduit/amqp/impl/AMQPConsumerBuilder.java | // Path: conduit/src/main/java/io/rtr/conduit/amqp/consumer/ConsumerBuilder.java
// public abstract class ConsumerBuilder<T extends Transport
// , C extends TransportConnectionProperties
// , L extends TransportListenProperties
// ... | import io.rtr.conduit.amqp.consumer.ConsumerBuilder;
import io.rtr.conduit.amqp.transport.Transport;
import io.rtr.conduit.amqp.transport.TransportListenProperties; | package io.rtr.conduit.amqp.impl;
public abstract class AMQPConsumerBuilder<T extends Transport
, L extends TransportListenProperties
, R extends AMQPConsumerBuilder<?,?,?>> | // Path: conduit/src/main/java/io/rtr/conduit/amqp/consumer/ConsumerBuilder.java
// public abstract class ConsumerBuilder<T extends Transport
// , C extends TransportConnectionProperties
// , L extends TransportListenProperties
// ... | extends ConsumerBuilder<T |
RentTheRunway/conduit | conduit/src/test/java/io/rtr/conduit/amqp/impl/AMQPConnectionTest.java | // Path: conduit/src/main/java/io/rtr/conduit/amqp/transport/TransportExecutor.java
// public class TransportExecutor extends ThreadPoolExecutor {
//
// // From ConsumerWorkService
// private static final int DEFAULT_NUM_THREADS = Runtime.getRuntime().availableProcessors() * 2;
//
// private static Thread... | import com.rabbitmq.client.Channel;
import com.rabbitmq.client.Connection;
import com.rabbitmq.client.ConnectionFactory;
import com.rabbitmq.client.MetricsCollector;
import io.rtr.conduit.amqp.transport.TransportExecutor;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import java.io.IOExcep... | package io.rtr.conduit.amqp.impl;
public class AMQPConnectionTest {
private final static int CONNECTION_TIMEOUT = 1337;
private final static int PORT = 42;
Connection mockConnection;
ConnectionFactory mockFactory; | // Path: conduit/src/main/java/io/rtr/conduit/amqp/transport/TransportExecutor.java
// public class TransportExecutor extends ThreadPoolExecutor {
//
// // From ConsumerWorkService
// private static final int DEFAULT_NUM_THREADS = Runtime.getRuntime().availableProcessors() * 2;
//
// private static Thread... | TransportExecutor mockExecutor; |
RentTheRunway/conduit | conduit/src/main/java/io/rtr/conduit/amqp/impl/AMQPAsyncConsumerBuilder.java | // Path: conduit/src/main/java/io/rtr/conduit/amqp/AMQPAsyncConsumerCallback.java
// public interface AMQPAsyncConsumerCallback {
// void handle(AMQPMessageBundle messageBundle, AsyncResponse response);
// void notifyOfActionFailure(Exception e);
// void notifyOfShutdown(String consumerTag, ShutdownSignalEx... | import com.rabbitmq.client.MetricsCollector;
import io.rtr.conduit.amqp.AMQPAsyncConsumerCallback; | package io.rtr.conduit.amqp.impl;
public class AMQPAsyncConsumerBuilder extends AMQPConsumerBuilder<AMQPAsyncTransport
, AMQPAsyncListenProperties
, AMQPAsyncConsumerBuilder> { | // Path: conduit/src/main/java/io/rtr/conduit/amqp/AMQPAsyncConsumerCallback.java
// public interface AMQPAsyncConsumerCallback {
// void handle(AMQPMessageBundle messageBundle, AsyncResponse response);
// void notifyOfActionFailure(Exception e);
// void notifyOfShutdown(String consumerTag, ShutdownSignalEx... | private AMQPAsyncConsumerCallback callback; |
RentTheRunway/conduit | conduit/src/main/java/io/rtr/conduit/amqp/impl/AMQPSyncConsumerBuilder.java | // Path: conduit/src/main/java/io/rtr/conduit/amqp/AMQPConsumerCallback.java
// public interface AMQPConsumerCallback {
// ActionResponse handle(AMQPMessageBundle messageBundle);
// void notifyOfActionFailure(Exception e);
// void notifyOfShutdown(String consumerTag, ShutdownSignalException sig);
// }
| import com.rabbitmq.client.MetricsCollector;
import io.rtr.conduit.amqp.AMQPConsumerCallback; | package io.rtr.conduit.amqp.impl;
public class AMQPSyncConsumerBuilder extends AMQPConsumerBuilder<AMQPTransport
, AMQPListenProperties
, AMQPSyncConsumerBuilder> { | // Path: conduit/src/main/java/io/rtr/conduit/amqp/AMQPConsumerCallback.java
// public interface AMQPConsumerCallback {
// ActionResponse handle(AMQPMessageBundle messageBundle);
// void notifyOfActionFailure(Exception e);
// void notifyOfShutdown(String consumerTag, ShutdownSignalException sig);
// }
// ... | private AMQPConsumerCallback callback; |
RentTheRunway/conduit | conduit/src/main/java/io/rtr/conduit/amqp/impl/AMQPConnection.java | // Path: conduit/src/main/java/io/rtr/conduit/amqp/transport/TransportExecutor.java
// public class TransportExecutor extends ThreadPoolExecutor {
//
// // From ConsumerWorkService
// private static final int DEFAULT_NUM_THREADS = Runtime.getRuntime().availableProcessors() * 2;
//
// private static Thread... | import com.rabbitmq.client.AlreadyClosedException;
import com.rabbitmq.client.Channel;
import com.rabbitmq.client.Connection;
import com.rabbitmq.client.ConnectionFactory;
import com.rabbitmq.client.MetricsCollector;
import io.rtr.conduit.amqp.transport.TransportExecutor;
import javax.net.ssl.SSLSocketFactory;
import j... | package io.rtr.conduit.amqp.impl;
public class AMQPConnection {
private final ConnectionFactory connectionFactory;
private Connection connection; | // Path: conduit/src/main/java/io/rtr/conduit/amqp/transport/TransportExecutor.java
// public class TransportExecutor extends ThreadPoolExecutor {
//
// // From ConsumerWorkService
// private static final int DEFAULT_NUM_THREADS = Runtime.getRuntime().availableProcessors() * 2;
//
// private static Thread... | private TransportExecutor executor; |
RentTheRunway/conduit | conduit/src/main/java/io/rtr/conduit/amqp/impl/AMQPListenContext.java | // Path: conduit/src/main/java/io/rtr/conduit/amqp/transport/Transport.java
// public abstract class Transport {
// //! Public interface.
//
// //! Establishes a connection to either an intermediary or the other
// // end point. In the case of AMQP, this method is used to connect
// // to the broker.... | import io.rtr.conduit.amqp.transport.Transport;
import io.rtr.conduit.amqp.transport.TransportConnectionProperties;
import io.rtr.conduit.amqp.transport.TransportListenContext;
import io.rtr.conduit.amqp.transport.TransportListenProperties; | package io.rtr.conduit.amqp.impl;
public class AMQPListenContext implements TransportListenContext {
private AMQPTransport transport;
private AMQPConnectionProperties connectionProperties; | // Path: conduit/src/main/java/io/rtr/conduit/amqp/transport/Transport.java
// public abstract class Transport {
// //! Public interface.
//
// //! Establishes a connection to either an intermediary or the other
// // end point. In the case of AMQP, this method is used to connect
// // to the broker.... | private TransportListenProperties listenProperties; |
RentTheRunway/conduit | conduit/src/main/java/io/rtr/conduit/amqp/impl/AMQPListenContext.java | // Path: conduit/src/main/java/io/rtr/conduit/amqp/transport/Transport.java
// public abstract class Transport {
// //! Public interface.
//
// //! Establishes a connection to either an intermediary or the other
// // end point. In the case of AMQP, this method is used to connect
// // to the broker.... | import io.rtr.conduit.amqp.transport.Transport;
import io.rtr.conduit.amqp.transport.TransportConnectionProperties;
import io.rtr.conduit.amqp.transport.TransportListenContext;
import io.rtr.conduit.amqp.transport.TransportListenProperties; | package io.rtr.conduit.amqp.impl;
public class AMQPListenContext implements TransportListenContext {
private AMQPTransport transport;
private AMQPConnectionProperties connectionProperties;
private TransportListenProperties listenProperties;
//! Consume context.
AMQPListenContext(
AMQP... | // Path: conduit/src/main/java/io/rtr/conduit/amqp/transport/Transport.java
// public abstract class Transport {
// //! Public interface.
//
// //! Establishes a connection to either an intermediary or the other
// // end point. In the case of AMQP, this method is used to connect
// // to the broker.... | public Transport getTransport() { |
RentTheRunway/conduit | conduit/src/main/java/io/rtr/conduit/amqp/impl/AMQPListenContext.java | // Path: conduit/src/main/java/io/rtr/conduit/amqp/transport/Transport.java
// public abstract class Transport {
// //! Public interface.
//
// //! Establishes a connection to either an intermediary or the other
// // end point. In the case of AMQP, this method is used to connect
// // to the broker.... | import io.rtr.conduit.amqp.transport.Transport;
import io.rtr.conduit.amqp.transport.TransportConnectionProperties;
import io.rtr.conduit.amqp.transport.TransportListenContext;
import io.rtr.conduit.amqp.transport.TransportListenProperties; | package io.rtr.conduit.amqp.impl;
public class AMQPListenContext implements TransportListenContext {
private AMQPTransport transport;
private AMQPConnectionProperties connectionProperties;
private TransportListenProperties listenProperties;
//! Consume context.
AMQPListenContext(
AMQP... | // Path: conduit/src/main/java/io/rtr/conduit/amqp/transport/Transport.java
// public abstract class Transport {
// //! Public interface.
//
// //! Establishes a connection to either an intermediary or the other
// // end point. In the case of AMQP, this method is used to connect
// // to the broker.... | public TransportConnectionProperties getConnectionProperties() { |
RentTheRunway/conduit | conduit/src/main/java/io/rtr/conduit/amqp/impl/AMQPAsyncQueueConsumer.java | // Path: conduit/src/main/java/io/rtr/conduit/amqp/AMQPAsyncConsumerCallback.java
// public interface AMQPAsyncConsumerCallback {
// void handle(AMQPMessageBundle messageBundle, AsyncResponse response);
// void notifyOfActionFailure(Exception e);
// void notifyOfShutdown(String consumerTag, ShutdownSignalEx... | import com.rabbitmq.client.AMQP;
import com.rabbitmq.client.Channel;
import com.rabbitmq.client.Envelope;
import com.rabbitmq.client.ShutdownSignalException;
import io.rtr.conduit.amqp.AMQPAsyncConsumerCallback;
import io.rtr.conduit.amqp.AMQPMessageBundle;
import io.rtr.conduit.amqp.ActionResponse;
import io.rtr.condu... | package io.rtr.conduit.amqp.impl;
public class AMQPAsyncQueueConsumer extends AMQPQueueConsumer implements AsyncResponse {
private static final Logger log = LoggerFactory.getLogger(AMQPAsyncQueueConsumer.class); | // Path: conduit/src/main/java/io/rtr/conduit/amqp/AMQPAsyncConsumerCallback.java
// public interface AMQPAsyncConsumerCallback {
// void handle(AMQPMessageBundle messageBundle, AsyncResponse response);
// void notifyOfActionFailure(Exception e);
// void notifyOfShutdown(String consumerTag, ShutdownSignalEx... | private final AMQPAsyncConsumerCallback callback; |
RentTheRunway/conduit | conduit/src/main/java/io/rtr/conduit/amqp/impl/AMQPAsyncQueueConsumer.java | // Path: conduit/src/main/java/io/rtr/conduit/amqp/AMQPAsyncConsumerCallback.java
// public interface AMQPAsyncConsumerCallback {
// void handle(AMQPMessageBundle messageBundle, AsyncResponse response);
// void notifyOfActionFailure(Exception e);
// void notifyOfShutdown(String consumerTag, ShutdownSignalEx... | import com.rabbitmq.client.AMQP;
import com.rabbitmq.client.Channel;
import com.rabbitmq.client.Envelope;
import com.rabbitmq.client.ShutdownSignalException;
import io.rtr.conduit.amqp.AMQPAsyncConsumerCallback;
import io.rtr.conduit.amqp.AMQPMessageBundle;
import io.rtr.conduit.amqp.ActionResponse;
import io.rtr.condu... | package io.rtr.conduit.amqp.impl;
public class AMQPAsyncQueueConsumer extends AMQPQueueConsumer implements AsyncResponse {
private static final Logger log = LoggerFactory.getLogger(AMQPAsyncQueueConsumer.class);
private final AMQPAsyncConsumerCallback callback; | // Path: conduit/src/main/java/io/rtr/conduit/amqp/AMQPAsyncConsumerCallback.java
// public interface AMQPAsyncConsumerCallback {
// void handle(AMQPMessageBundle messageBundle, AsyncResponse response);
// void notifyOfActionFailure(Exception e);
// void notifyOfShutdown(String consumerTag, ShutdownSignalEx... | private final Map<Long, AMQPMessageBundle> unacknowledgedMessages = new LinkedHashMap<Long, AMQPMessageBundle>(); |
RentTheRunway/conduit | conduit/src/test/java/io/rtr/conduit/util/RecordingAmqpCallbackHandler.java | // Path: conduit/src/main/java/io/rtr/conduit/amqp/AMQPMessageBundle.java
// public class AMQPMessageBundle implements TransportMessageBundle {
// private String consumerTag;
// private Envelope envelope;
// private AMQP.BasicProperties basicProperties;
// private byte[] body;
//
// private static ... | import io.rtr.conduit.amqp.AMQPMessageBundle;
import io.rtr.conduit.amqp.ActionResponse;
import java.util.ArrayList;
import java.util.List; | package io.rtr.conduit.util;
public class RecordingAmqpCallbackHandler extends LoggingAmqpCallbackHandler {
private final List<AMQPMessageBundle> capturedMessages = new ArrayList<>();
@Override | // Path: conduit/src/main/java/io/rtr/conduit/amqp/AMQPMessageBundle.java
// public class AMQPMessageBundle implements TransportMessageBundle {
// private String consumerTag;
// private Envelope envelope;
// private AMQP.BasicProperties basicProperties;
// private byte[] body;
//
// private static ... | public ActionResponse handle(AMQPMessageBundle messageBundle) { |
mvc-spec/ozark | core/src/main/java/org/mvcspec/ozark/MvcContextImpl.java | // Path: core/src/main/java/org/mvcspec/ozark/util/PathUtils.java
// public final class PathUtils {
//
// /**
// * Drops starting slash from path if present.
// *
// * @param path the path.
// * @return the resulting path without a starting slash.
// */
// public static String noStarti... | import org.mvcspec.ozark.jaxrs.JaxRsContext;
import org.mvcspec.ozark.uri.ApplicationUris;
import org.mvcspec.ozark.util.PathUtils;
import javax.annotation.PostConstruct;
import javax.enterprise.context.RequestScoped;
import javax.inject.Inject;
import javax.inject.Named;
import javax.mvc.MvcContext;
import javax.mvc.s... | /*
* Copyright © 2017 Ivar Grimstad (ivar.grimstad@gmail.com)
*
* 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 b... | // Path: core/src/main/java/org/mvcspec/ozark/util/PathUtils.java
// public final class PathUtils {
//
// /**
// * Drops starting slash from path if present.
// *
// * @param path the path.
// * @return the resulting path without a starting slash.
// */
// public static String noStarti... | applicationPath = PathUtils.normalizePath( |
mvc-spec/ozark | ext/jade/src/main/java/org/mvcspec/ozark/ext/jade/JadeViewEngine.java | // Path: core/src/main/java/org/mvcspec/ozark/engine/ViewEngineBase.java
// public abstract class ViewEngineBase implements ViewEngine {
//
// /**
// * Resolves a view path based on {@link javax.mvc.engine.ViewEngine#VIEW_FOLDER}
// * in the active configuration. If the view is absolute, starts with '/',... | import java.io.Writer;
import java.nio.charset.Charset;
import java.util.HashMap;
import java.util.Map;
import de.neuland.jade4j.JadeConfiguration;
import de.neuland.jade4j.exceptions.JadeException;
import de.neuland.jade4j.template.JadeTemplate;
import org.mvcspec.ozark.engine.ViewEngineBase;
import org.mvcspec.ozark.... | /*
* Copyright © 2017 Ivar Grimstad (ivar.grimstad@gmail.com)
*
* 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 b... | // Path: core/src/main/java/org/mvcspec/ozark/engine/ViewEngineBase.java
// public abstract class ViewEngineBase implements ViewEngine {
//
// /**
// * Resolves a view path based on {@link javax.mvc.engine.ViewEngine#VIEW_FOLDER}
// * in the active configuration. If the view is absolute, starts with '/',... | public class JadeViewEngine extends ViewEngineBase { |
mvc-spec/ozark | jersey/src/main/java/org/mvcspec/ozark/jersey/bootstrap/JerseyConfigProvider.java | // Path: core/src/main/java/org/mvcspec/ozark/bootstrap/ConfigProvider.java
// public interface ConfigProvider {
//
// void configure(FeatureContext context);
//
// }
//
// Path: jersey/src/main/java/org/mvcspec/ozark/jersey/validation/OzarkValidationInterceptor.java
// public class OzarkValidationInterceptor im... | import org.mvcspec.ozark.bootstrap.ConfigProvider;
import org.mvcspec.ozark.jersey.model.OzarkModelProcessor;
import org.mvcspec.ozark.jersey.validation.OzarkValidationInterceptor;
import javax.ws.rs.core.FeatureContext; | /*
* Copyright © 2017 Ivar Grimstad (ivar.grimstad@gmail.com)
*
* 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 b... | // Path: core/src/main/java/org/mvcspec/ozark/bootstrap/ConfigProvider.java
// public interface ConfigProvider {
//
// void configure(FeatureContext context);
//
// }
//
// Path: jersey/src/main/java/org/mvcspec/ozark/jersey/validation/OzarkValidationInterceptor.java
// public class OzarkValidationInterceptor im... | context.register(OzarkValidationInterceptor.class); |
mvc-spec/ozark | core/src/test/java/org/mvcspec/ozark/engine/ViewEngineContextImplTest.java | // Path: core/src/main/java/org/mvcspec/ozark/core/ModelsImpl.java
// @RequestScoped
// public class ModelsImpl implements Models {
//
// private final Map<String, Object> map = new LinkedHashMap<>();
//
// @Override
// public Models put(String name, Object model) {
// Objects.requireNonNull(name,... | import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.ws.rs.container.ResourceInfo;
import javax.ws.rs.core.Configuration;
import javax.ws.rs.core.UriInfo;
import org.easymock.EasyMock;
import static org.easymock.EasyMock.replay;
import static org.easymock.EasyMock.ve... | /*
* Copyright © 2017 Ivar Grimstad (ivar.grimstad@gmail.com)
*
* 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 b... | // Path: core/src/main/java/org/mvcspec/ozark/core/ModelsImpl.java
// @RequestScoped
// public class ModelsImpl implements Models {
//
// private final Map<String, Object> map = new LinkedHashMap<>();
//
// @Override
// public Models put(String name, Object model) {
// Objects.requireNonNull(name,... | context = new ViewEngineContextImpl(null, new ModelsImpl(), null, null, null, null, null, null, null, null, null); |
mvc-spec/ozark | resteasy/src/main/java/org/mvcspec/ozark/resteasy/bootstrap/RestEasyConfigProvider.java | // Path: core/src/main/java/org/mvcspec/ozark/bootstrap/ConfigProvider.java
// public interface ConfigProvider {
//
// void configure(FeatureContext context);
//
// }
//
// Path: resteasy/src/main/java/org/mvcspec/ozark/resteasy/validation/OzarkValidationResolver.java
// public class OzarkValidationResolver impl... | import org.mvcspec.ozark.bootstrap.ConfigProvider;
import org.mvcspec.ozark.resteasy.validation.OzarkValidationResolver;
import javax.ws.rs.core.FeatureContext; | /*
* Copyright © 2017 Ivar Grimstad (ivar.grimstad@gmail.com)
*
* 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 b... | // Path: core/src/main/java/org/mvcspec/ozark/bootstrap/ConfigProvider.java
// public interface ConfigProvider {
//
// void configure(FeatureContext context);
//
// }
//
// Path: resteasy/src/main/java/org/mvcspec/ozark/resteasy/validation/OzarkValidationResolver.java
// public class OzarkValidationResolver impl... | context.register(OzarkValidationResolver.class); |
mvc-spec/ozark | ext/pebble/src/main/java/org/mvcspec/ozark/ext/pebble/PebbleViewEngine.java | // Path: core/src/main/java/org/mvcspec/ozark/engine/ViewEngineBase.java
// public abstract class ViewEngineBase implements ViewEngine {
//
// /**
// * Resolves a view path based on {@link javax.mvc.engine.ViewEngine#VIEW_FOLDER}
// * in the active configuration. If the view is absolute, starts with '/',... | import java.util.Map;
import javax.inject.Inject;
import javax.servlet.http.HttpServletRequest;
import org.mvcspec.ozark.engine.ViewEngineConfig;
import com.mitchellbosecke.pebble.PebbleEngine;
import com.mitchellbosecke.pebble.error.PebbleException;
import com.mitchellbosecke.pebble.template.PebbleTemplate;
import org... | /*
* Copyright © 2017 Ivar Grimstad (ivar.grimstad@gmail.com)
*
* 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 b... | // Path: core/src/main/java/org/mvcspec/ozark/engine/ViewEngineBase.java
// public abstract class ViewEngineBase implements ViewEngine {
//
// /**
// * Resolves a view path based on {@link javax.mvc.engine.ViewEngine#VIEW_FOLDER}
// * in the active configuration. If the view is absolute, starts with '/',... | public class PebbleViewEngine extends ViewEngineBase { |
mvc-spec/ozark | core/src/main/java/org/mvcspec/ozark/cdi/RedirectScopeManager.java | // Path: core/src/main/java/org/mvcspec/ozark/util/CdiUtils.java
// @ApplicationScoped
// @SuppressWarnings("unchecked")
// public class CdiUtils {
//
// @Inject
// private BeanManager beanManager;
//
// /**
// * Create a new CDI bean given its class. The bean is created in the context
// * defi... | import org.mvcspec.ozark.Properties;
import org.mvcspec.ozark.event.ControllerRedirectEventImpl;
import org.mvcspec.ozark.jaxrs.JaxRsContext;
import org.mvcspec.ozark.util.CdiUtils;
import org.mvcspec.ozark.util.PropertyUtils;
import javax.annotation.PostConstruct;
import javax.enterprise.context.ApplicationScoped;
imp... | if (cookie.getName().equals(COOKIE_NAME)) {
request.setAttribute(SCOPE_ID, cookie.getValue());
return; // we're done
}
}
}
} else {
final String scopeId = event.getUriInfo().getQue... | // Path: core/src/main/java/org/mvcspec/ozark/util/CdiUtils.java
// @ApplicationScoped
// @SuppressWarnings("unchecked")
// public class CdiUtils {
//
// @Inject
// private BeanManager beanManager;
//
// /**
// * Create a new CDI bean given its class. The bean is created in the context
// * defi... | BeanManager beanManager = CdiUtils.getApplicationBeanManager(); |
mvc-spec/ozark | ext/asciidoc/src/main/java/org/mvcspec/ozark/ext/asciidoc/AsciiDocViewEngine.java | // Path: core/src/main/java/org/mvcspec/ozark/engine/ViewEngineBase.java
// public abstract class ViewEngineBase implements ViewEngine {
//
// /**
// * Resolves a view path based on {@link javax.mvc.engine.ViewEngine#VIEW_FOLDER}
// * in the active configuration. If the view is absolute, starts with '/',... | import org.asciidoctor.Asciidoctor;
import org.asciidoctor.Asciidoctor.Factory;
import org.asciidoctor.Options;
import org.mvcspec.ozark.engine.ViewEngineBase;
import javax.annotation.Priority;
import javax.enterprise.context.ApplicationScoped;
import javax.inject.Inject;
import javax.mvc.engine.ViewEngine;
import java... | /*
* Copyright © 2017 Ivar Grimstad (ivar.grimstad@gmail.com)
*
* 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 b... | // Path: core/src/main/java/org/mvcspec/ozark/engine/ViewEngineBase.java
// public abstract class ViewEngineBase implements ViewEngine {
//
// /**
// * Resolves a view path based on {@link javax.mvc.engine.ViewEngine#VIEW_FOLDER}
// * in the active configuration. If the view is absolute, starts with '/',... | public class AsciiDocViewEngine extends ViewEngineBase { |
mvc-spec/ozark | core/src/main/java/org/mvcspec/ozark/security/CsrfValidateInterceptor.java | // Path: core/src/main/java/org/mvcspec/ozark/util/AnnotationUtils.java
// public static <T extends Annotation> boolean hasAnnotation(Class<?> clazz, Class<T> annotationType) {
// return getAnnotation(clazz, annotationType) != null;
// }
| import org.mvcspec.ozark.OzarkConfig;
import org.mvcspec.ozark.core.Messages;
import javax.annotation.Priority;
import javax.inject.Inject;
import javax.mvc.Controller;
import javax.mvc.security.CsrfProtected;
import javax.mvc.security.CsrfValidationException;
import javax.ws.rs.POST;
import javax.ws.rs.Priorities;
imp... | return contentType != null &&
contentType.isCompatible(MediaType.APPLICATION_FORM_URLENCODED_TYPE);
}
private ByteArrayInputStream copyStream(InputStream is) throws IOException {
int n;
try (final ByteArrayOutputStream baos = new ByteArrayOutputStream()) {
final ... | // Path: core/src/main/java/org/mvcspec/ozark/util/AnnotationUtils.java
// public static <T extends Annotation> boolean hasAnnotation(Class<?> clazz, Class<T> annotationType) {
// return getAnnotation(clazz, annotationType) != null;
// }
// Path: core/src/main/java/org/mvcspec/ozark/security/CsrfValidateIntercept... | if (controller == null || !hasAnnotation(controller, POST.class)) { |
mvc-spec/ozark | core/src/main/java/org/mvcspec/ozark/util/ServiceLoaders.java | // Path: core/src/main/java/org/mvcspec/ozark/bootstrap/ConfigProvider.java
// public interface ConfigProvider {
//
// void configure(FeatureContext context);
//
// }
| import org.mvcspec.ozark.bootstrap.ConfigProvider;
import java.util.List;
import java.util.ServiceLoader;
import java.util.stream.Collectors;
import java.util.stream.StreamSupport; | /*
* Copyright © 2017 Ivar Grimstad (ivar.grimstad@gmail.com)
*
* 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 b... | // Path: core/src/main/java/org/mvcspec/ozark/bootstrap/ConfigProvider.java
// public interface ConfigProvider {
//
// void configure(FeatureContext context);
//
// }
// Path: core/src/main/java/org/mvcspec/ozark/util/ServiceLoaders.java
import org.mvcspec.ozark.bootstrap.ConfigProvider;
import java.util.List;
... | classLoader = ConfigProvider.class.getClassLoader(); |
mvc-spec/ozark | ext/handlebars/src/main/java/org/mvcspec/ozark/ext/handlebars/HandlebarsViewEngine.java | // Path: core/src/main/java/org/mvcspec/ozark/engine/ViewEngineBase.java
// public abstract class ViewEngineBase implements ViewEngine {
//
// /**
// * Resolves a view path based on {@link javax.mvc.engine.ViewEngine#VIEW_FOLDER}
// * in the active configuration. If the view is absolute, starts with '/',... | import com.github.jknack.handlebars.Handlebars;
import com.github.jknack.handlebars.Template;
import org.mvcspec.ozark.engine.ViewEngineBase;
import org.mvcspec.ozark.engine.ViewEngineConfig;
import javax.annotation.Priority;
import javax.enterprise.context.ApplicationScoped;
import javax.inject.Inject;
import javax.mv... | /*
* Copyright © 2017 Ivar Grimstad (ivar.grimstad@gmail.com)
*
* 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 b... | // Path: core/src/main/java/org/mvcspec/ozark/engine/ViewEngineBase.java
// public abstract class ViewEngineBase implements ViewEngine {
//
// /**
// * Resolves a view path based on {@link javax.mvc.engine.ViewEngine#VIEW_FOLDER}
// * in the active configuration. If the view is absolute, starts with '/',... | public class HandlebarsViewEngine extends ViewEngineBase { |
mvc-spec/ozark | testsuite/src/test/java/org/mvcspec/ozark/test/MvcIT.java | // Path: testsuite/src/test/java/org/mvcspec/ozark/test/util/WebArchiveBuilder.java
// public class WebArchiveBuilder {
//
// private final WebArchive archive = ShrinkWrap.create(WebArchive.class);
// private List<MavenDependency> additionalDependencies = new ArrayList<>();
//
// public WebArchiveBuilder ... | import static org.junit.Assert.assertEquals;
import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.drone.api.annotation.Drone;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.arquillian.test.api.ArquillianResource;
import org.jboss.shrinkwrap.api.Archive;
import org.jboss... | /*
* Copyright © 2017 Ivar Grimstad (ivar.grimstad@gmail.com)
*
* 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 b... | // Path: testsuite/src/test/java/org/mvcspec/ozark/test/util/WebArchiveBuilder.java
// public class WebArchiveBuilder {
//
// private final WebArchive archive = ShrinkWrap.create(WebArchive.class);
// private List<MavenDependency> additionalDependencies = new ArrayList<>();
//
// public WebArchiveBuilder ... | return new WebArchiveBuilder() |
mvc-spec/ozark | core/src/main/java/org/mvcspec/ozark/binding/convert/MvcConverterProvider.java | // Path: core/src/main/java/org/mvcspec/ozark/binding/BindingErrorImpl.java
// public class BindingErrorImpl implements BindingError {
//
// private String message;
//
// private String paramName;
//
// private String submittedValue;
//
// public BindingErrorImpl(String message, String paramName, St... | import java.util.Locale;
import java.util.stream.Stream;
import org.mvcspec.ozark.binding.BindingErrorImpl;
import org.mvcspec.ozark.binding.BindingResultImpl;
import javax.inject.Inject;
import javax.mvc.MvcContext;
import javax.mvc.binding.MvcBinding;
import javax.ws.rs.CookieParam;
import javax.ws.rs.FormParam;
impo... | /*
* Copyright © 2017 Ivar Grimstad (ivar.grimstad@gmail.com)
*
* 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 b... | // Path: core/src/main/java/org/mvcspec/ozark/binding/BindingErrorImpl.java
// public class BindingErrorImpl implements BindingError {
//
// private String message;
//
// private String paramName;
//
// private String submittedValue;
//
// public BindingErrorImpl(String message, String paramName, St... | private BindingResultImpl bindingResult; |
mvc-spec/ozark | core/src/main/java/org/mvcspec/ozark/binding/convert/MvcConverterProvider.java | // Path: core/src/main/java/org/mvcspec/ozark/binding/BindingErrorImpl.java
// public class BindingErrorImpl implements BindingError {
//
// private String message;
//
// private String paramName;
//
// private String submittedValue;
//
// public BindingErrorImpl(String message, String paramName, St... | import java.util.Locale;
import java.util.stream.Stream;
import org.mvcspec.ozark.binding.BindingErrorImpl;
import org.mvcspec.ozark.binding.BindingResultImpl;
import javax.inject.Inject;
import javax.mvc.MvcContext;
import javax.mvc.binding.MvcBinding;
import javax.ws.rs.CookieParam;
import javax.ws.rs.FormParam;
impo... | /*
* Copyright © 2017 Ivar Grimstad (ivar.grimstad@gmail.com)
*
* 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 b... | // Path: core/src/main/java/org/mvcspec/ozark/binding/BindingErrorImpl.java
// public class BindingErrorImpl implements BindingError {
//
// private String message;
//
// private String paramName;
//
// private String submittedValue;
//
// public BindingErrorImpl(String message, String paramName, St... | .map(error -> new BindingErrorImpl(error, getParamName(annotations), value)) |
mvc-spec/ozark | core/src/main/java/org/mvcspec/ozark/jaxrs/JaxRsContextFilter.java | // Path: core/src/main/java/org/mvcspec/ozark/util/CdiUtils.java
// @ApplicationScoped
// @SuppressWarnings("unchecked")
// public class CdiUtils {
//
// @Inject
// private BeanManager beanManager;
//
// /**
// * Create a new CDI bean given its class. The bean is created in the context
// * defi... | import org.mvcspec.ozark.util.CdiUtils;
import javax.annotation.Priority;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.ws.rs.container.ContainerRequestContext;
import javax.ws.rs.container.ContainerRequestFilter;
import javax.ws.rs.container.PreMatching;
impo... | /*
* Copyright © 2017 Ivar Grimstad (ivar.grimstad@gmail.com)
*
* 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 b... | // Path: core/src/main/java/org/mvcspec/ozark/util/CdiUtils.java
// @ApplicationScoped
// @SuppressWarnings("unchecked")
// public class CdiUtils {
//
// @Inject
// private BeanManager beanManager;
//
// /**
// * Create a new CDI bean given its class. The bean is created in the context
// * defi... | CdiUtils.getApplicationBean(JaxRsContextProducer.class) |
mvc-spec/ozark | ext/jtwig/src/main/java/org/mvcspec/ozark/ext/jtwig/JtwigViewEngine.java | // Path: core/src/main/java/org/mvcspec/ozark/engine/ViewEngineBase.java
// public abstract class ViewEngineBase implements ViewEngine {
//
// /**
// * Resolves a view path based on {@link javax.mvc.engine.ViewEngine#VIEW_FOLDER}
// * in the active configuration. If the view is absolute, starts with '/',... | import org.mvcspec.ozark.engine.ViewEngineBase;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import javax.annotation.PostConstruct;
import javax.annotation.Priority;
import javax.enterprise.context.ApplicationScoped;
import javax.mvc.engine.ViewEngine;
import javax.mvc.engine.ViewEngineCo... | /*
* Copyright © 2017 Ivar Grimstad (ivar.grimstad@gmail.com)
*
* 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 b... | // Path: core/src/main/java/org/mvcspec/ozark/engine/ViewEngineBase.java
// public abstract class ViewEngineBase implements ViewEngine {
//
// /**
// * Resolves a view path based on {@link javax.mvc.engine.ViewEngine#VIEW_FOLDER}
// * in the active configuration. If the view is absolute, starts with '/',... | public class JtwigViewEngine extends ViewEngineBase { |
mvc-spec/ozark | ext/jetbrick/src/main/java/org/mvcspec/ozark/ext/jetbrick/JetbrickViewEngine.java | // Path: core/src/main/java/org/mvcspec/ozark/engine/ViewEngineBase.java
// public abstract class ViewEngineBase implements ViewEngine {
//
// /**
// * Resolves a view path based on {@link javax.mvc.engine.ViewEngine#VIEW_FOLDER}
// * in the active configuration. If the view is absolute, starts with '/',... | import jetbrick.template.JetEngine;
import jetbrick.template.JetTemplate;
import jetbrick.template.TemplateException;
import jetbrick.template.web.JetWebEngine;
import org.mvcspec.ozark.engine.ViewEngineBase;
import javax.annotation.PostConstruct;
import javax.annotation.Priority;
import javax.enterprise.context.Applic... | /*
* Copyright © 2017 Ivar Grimstad (ivar.grimstad@gmail.com)
*
* 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 b... | // Path: core/src/main/java/org/mvcspec/ozark/engine/ViewEngineBase.java
// public abstract class ViewEngineBase implements ViewEngine {
//
// /**
// * Resolves a view path based on {@link javax.mvc.engine.ViewEngine#VIEW_FOLDER}
// * in the active configuration. If the view is absolute, starts with '/',... | public class JetbrickViewEngine extends ViewEngineBase { |
mvc-spec/ozark | ext/freemarker/src/main/java/org/mvcspec/ozark/ext/freemarker/FreemarkerViewEngine.java | // Path: core/src/main/java/org/mvcspec/ozark/engine/ViewEngineBase.java
// public abstract class ViewEngineBase implements ViewEngine {
//
// /**
// * Resolves a view path based on {@link javax.mvc.engine.ViewEngine#VIEW_FOLDER}
// * in the active configuration. If the view is absolute, starts with '/',... | import java.io.Writer;
import java.nio.charset.Charset;
import java.util.HashMap;
import java.util.Map;
import freemarker.template.Configuration;
import freemarker.template.Template;
import freemarker.template.TemplateException;
import org.mvcspec.ozark.engine.ViewEngineBase;
import org.mvcspec.ozark.engine.ViewEngineC... | /*
* Copyright © 2017 Ivar Grimstad (ivar.grimstad@gmail.com)
*
* 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 b... | // Path: core/src/main/java/org/mvcspec/ozark/engine/ViewEngineBase.java
// public abstract class ViewEngineBase implements ViewEngine {
//
// /**
// * Resolves a view path based on {@link javax.mvc.engine.ViewEngine#VIEW_FOLDER}
// * in the active configuration. If the view is absolute, starts with '/',... | public class FreemarkerViewEngine extends ViewEngineBase { |
mvc-spec/ozark | core/src/main/java/org/mvcspec/ozark/engine/ViewEngineFinder.java | // Path: core/src/main/java/org/mvcspec/ozark/util/CdiUtils.java
// @ApplicationScoped
// @SuppressWarnings("unchecked")
// public class CdiUtils {
//
// @Inject
// private BeanManager beanManager;
//
// /**
// * Create a new CDI bean given its class. The bean is created in the context
// * defi... | import org.mvcspec.ozark.util.CdiUtils;
import javax.annotation.Priority;
import javax.enterprise.context.ApplicationScoped;
import javax.inject.Inject;
import javax.mvc.engine.ViewEngine;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.Set;
import stat... | /*
* Copyright © 2017 Ivar Grimstad (ivar.grimstad@gmail.com)
*
* 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 b... | // Path: core/src/main/java/org/mvcspec/ozark/util/CdiUtils.java
// @ApplicationScoped
// @SuppressWarnings("unchecked")
// public class CdiUtils {
//
// @Inject
// private BeanManager beanManager;
//
// /**
// * Create a new CDI bean given its class. The bean is created in the context
// * defi... | private CdiUtils cdiUtils; |
mvc-spec/ozark | testsuite/src/test/java/org/mvcspec/ozark/test/ThymeleafIT.java | // Path: testsuite/src/test/java/org/mvcspec/ozark/test/util/WebArchiveBuilder.java
// public class WebArchiveBuilder {
//
// private final WebArchive archive = ShrinkWrap.create(WebArchive.class);
// private List<MavenDependency> additionalDependencies = new ArrayList<>();
//
// public WebArchiveBuilder ... | import java.net.URL;
import java.nio.file.Paths;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.container.test.api.RunAsClient;
import org.jboss.arquillian.drone.api.annotation.Drone;
import ... | /*
* Copyright © 2017 Ivar Grimstad (ivar.grimstad@gmail.com)
*
* 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 b... | // Path: testsuite/src/test/java/org/mvcspec/ozark/test/util/WebArchiveBuilder.java
// public class WebArchiveBuilder {
//
// private final WebArchive archive = ShrinkWrap.create(WebArchive.class);
// private List<MavenDependency> additionalDependencies = new ArrayList<>();
//
// public WebArchiveBuilder ... | return new WebArchiveBuilder() |
mvc-spec/ozark | core/src/main/java/org/mvcspec/ozark/engine/ViewEngineBase.java | // Path: core/src/main/java/org/mvcspec/ozark/util/PathUtils.java
// public final class PathUtils {
//
// /**
// * Drops starting slash from path if present.
// *
// * @param path the path.
// * @return the resulting path without a starting slash.
// */
// public static String noStarti... | import org.mvcspec.ozark.util.PathUtils;
import org.mvcspec.ozark.util.PropertyUtils;
import javax.mvc.engine.ViewEngine;
import javax.mvc.engine.ViewEngineContext;
import javax.ws.rs.core.HttpHeaders;
import javax.ws.rs.core.MediaType;
import java.nio.charset.Charset; | /*
* Copyright © 2017 Ivar Grimstad (ivar.grimstad@gmail.com)
*
* 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 b... | // Path: core/src/main/java/org/mvcspec/ozark/util/PathUtils.java
// public final class PathUtils {
//
// /**
// * Drops starting slash from path if present.
// *
// * @param path the path.
// * @return the resulting path without a starting slash.
// */
// public static String noStarti... | if (!PathUtils.hasStartingSlash(view)) { // Relative? |
mvc-spec/ozark | ext/groovy/src/main/java/org/mvcspec/ozark/ext/groovy/GroovyViewEngine.java | // Path: core/src/main/java/org/mvcspec/ozark/engine/ViewEngineBase.java
// public abstract class ViewEngineBase implements ViewEngine {
//
// /**
// * Resolves a view path based on {@link javax.mvc.engine.ViewEngine#VIEW_FOLDER}
// * in the active configuration. If the view is absolute, starts with '/',... | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.Writer;
import java.nio.charset.Charset;
import java.util.HashMap;
import java.util.Map;
import java.util.stream.Collectors;
import javax.annotation.... | /*
* Copyright © 2017 Ivar Grimstad (ivar.grimstad@gmail.com)
*
* 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 b... | // Path: core/src/main/java/org/mvcspec/ozark/engine/ViewEngineBase.java
// public abstract class ViewEngineBase implements ViewEngine {
//
// /**
// * Resolves a view path based on {@link javax.mvc.engine.ViewEngine#VIEW_FOLDER}
// * in the active configuration. If the view is absolute, starts with '/',... | public class GroovyViewEngine extends ViewEngineBase { |
Uphie/ONE-Unofficial | app/src/main/java/studio/uphie/one/ui/personal/PersonalFragment.java | // Path: app/src/main/java/studio/uphie/one/utils/TextToast.java
// public class TextToast {
//
// private static Context context;
//
// public static void init(Context ctx){
// context=ctx;
// }
//
// public static void shortShow(String content){
// if (context==null){
// ... | import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
impor... | }
@OnClick({R.id.item_about, R.id.item_share_app, R.id.item_feedback, R.id.item_comment})
public void onClick(View view) {
Intent intent;
switch (view.getId()) {
case R.id.item_about:
intent = new Intent(getActivity(), AboutActivity.class);
startA... | // Path: app/src/main/java/studio/uphie/one/utils/TextToast.java
// public class TextToast {
//
// private static Context context;
//
// public static void init(Context ctx){
// context=ctx;
// }
//
// public static void shortShow(String content){
// if (context==null){
// ... | TextToast.longShow(R.string.non_market_app); |
Uphie/ONE-Unofficial | app/src/main/java/studio/uphie/one/interfaces/IHttp.java | // Path: app/src/main/java/studio/uphie/one/common/HttpData.java
// public class HttpData {
// public String result;
// public String data;
//
// public HttpData(String result, String data) {
// this.result = result == null ? "" : result;
// this.data = data == null ? "" : data;
// }
//... | import com.loopj.android.http.RequestParams;
import studio.uphie.one.common.HttpData;
import studio.uphie.one.common.HttpError; | package studio.uphie.one.interfaces;
/**
* Created by Uphie on 2015/9/5.
* Email: uphie7@gmail.com
*/
public interface IHttp {
void getHttpData(String url, RequestParams param,HttpData httpData);
void onDataOk(String url, String data);
| // Path: app/src/main/java/studio/uphie/one/common/HttpData.java
// public class HttpData {
// public String result;
// public String data;
//
// public HttpData(String result, String data) {
// this.result = result == null ? "" : result;
// this.data = data == null ? "" : data;
// }
//... | void onDataError(String url, HttpError error); |
dkpro/dkpro-statistics | dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/coding/CodingAgreementMeasure.java | // Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/AgreementMeasure.java
// public abstract class AgreementMeasure
// implements IAgreementMeasure
// {
//
// @Override
// public double calculateAgreement()
// {
// double A_O = calculateObservedAgreement();
// ... | import java.util.Map;
import org.dkpro.statistics.agreement.AgreementMeasure;
import org.dkpro.statistics.agreement.InsufficientDataException; | /*
* Copyright 2014
* Ubiquitous Knowledge Processing (UKP) Lab
* Technische Universität Darmstadt
*
* 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/... | // Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/AgreementMeasure.java
// public abstract class AgreementMeasure
// implements IAgreementMeasure
// {
//
// @Override
// public double calculateAgreement()
// {
// double A_O = calculateObservedAgreement();
// ... | throw new InsufficientDataException( |
dkpro/dkpro-statistics | dkpro-statistics-agreement/src/test/java/org/dkpro/statistics/agreement/coding/ArtsteinPoesio2008Test.java | // Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/IAnnotationStudy.java
// public interface IAnnotationStudy
// extends Serializable
// {
//
// // -- Raters --
//
// /** Returns the number of raters participating in this study. */
// int getRaterCount();
//
// i... | import static junit.framework.Assert.assertEquals;
import org.dkpro.statistics.agreement.IAnnotationStudy;
import org.dkpro.statistics.agreement.distance.IDistanceFunction;
import org.dkpro.statistics.agreement.distance.NominalDistanceFunction;
import org.junit.Test; |
BennettSAgreement s = new BennettSAgreement(study);
assertEquals(0.88, s.calculateObservedAgreement(), 0.001);
assertEquals(0.333, s.calculateExpectedAgreement(), 0.001);
assertEquals(0.82, s.calculateAgreement(), 0.001);
ScottPiAgreement pi = new ScottPiAgreement(study);
... | // Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/IAnnotationStudy.java
// public interface IAnnotationStudy
// extends Serializable
// {
//
// // -- Raters --
//
// /** Returns the number of raters participating in this study. */
// int getRaterCount();
//
// i... | IDistanceFunction weightedDistanceFunction = new IDistanceFunction() |
dkpro/dkpro-statistics | dkpro-statistics-agreement/src/test/java/org/dkpro/statistics/agreement/coding/ArtsteinPoesio2008Test.java | // Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/IAnnotationStudy.java
// public interface IAnnotationStudy
// extends Serializable
// {
//
// // -- Raters --
//
// /** Returns the number of raters participating in this study. */
// int getRaterCount();
//
// i... | import static junit.framework.Assert.assertEquals;
import org.dkpro.statistics.agreement.IAnnotationStudy;
import org.dkpro.statistics.agreement.distance.IDistanceFunction;
import org.dkpro.statistics.agreement.distance.NominalDistanceFunction;
import org.junit.Test; | assertEquals(0.333, s.calculateExpectedAgreement(), 0.001);
assertEquals(0.82, s.calculateAgreement(), 0.001);
ScottPiAgreement pi = new ScottPiAgreement(study);
assertEquals(0.88, pi.calculateObservedAgreement(), 0.001);
assertEquals(0.401, pi.calculateExpectedAgreement(), 0.00... | // Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/IAnnotationStudy.java
// public interface IAnnotationStudy
// extends Serializable
// {
//
// // -- Raters --
//
// /** Returns the number of raters participating in this study. */
// int getRaterCount();
//
// i... | public double measureDistance(final IAnnotationStudy study, final Object category1, |
dkpro/dkpro-statistics | dkpro-statistics-agreement/src/test/java/org/dkpro/statistics/agreement/coding/ArtsteinPoesio2008Test.java | // Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/IAnnotationStudy.java
// public interface IAnnotationStudy
// extends Serializable
// {
//
// // -- Raters --
//
// /** Returns the number of raters participating in this study. */
// int getRaterCount();
//
// i... | import static junit.framework.Assert.assertEquals;
import org.dkpro.statistics.agreement.IAnnotationStudy;
import org.dkpro.statistics.agreement.distance.IDistanceFunction;
import org.dkpro.statistics.agreement.distance.NominalDistanceFunction;
import org.junit.Test; | final Object category2)
{
if (category1.equals(category2)) {
return 0.0;
}
if ("Chck".equals(category1) || "Chck".equals(category2)) {
return 0.5;
}
return 1.0;
... | // Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/IAnnotationStudy.java
// public interface IAnnotationStudy
// extends Serializable
// {
//
// // -- Raters --
//
// /** Returns the number of raters participating in this study. */
// int getRaterCount();
//
// i... | new NominalDistanceFunction()); |
dkpro/dkpro-statistics | dkpro-statistics-agreement/src/test/java/org/dkpro/statistics/agreement/coding/SetAnnotationsTest.java | // Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/distance/MASISetAnnotationDistanceFunction.java
// public class MASISetAnnotationDistanceFunction
// implements IDistanceFunction
// {
//
// @Override
// public double measureDistance(final IAnnotationStudy study, Object categ... | import org.dkpro.statistics.agreement.distance.MASISetAnnotationDistanceFunction;
import org.dkpro.statistics.agreement.distance.SetAnnotation;
import org.dkpro.statistics.agreement.distance.SetAnnotationDistanceFunction;
import junit.framework.TestCase; | /*
* Copyright 2014
* Ubiquitous Knowledge Processing (UKP) Lab
* Technische Universität Darmstadt
*
* 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/... | // Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/distance/MASISetAnnotationDistanceFunction.java
// public class MASISetAnnotationDistanceFunction
// implements IDistanceFunction
// {
//
// @Override
// public double measureDistance(final IAnnotationStudy study, Object categ... | alpha.setDistanceFunction(new SetAnnotationDistanceFunction()); |
dkpro/dkpro-statistics | dkpro-statistics-agreement/src/test/java/org/dkpro/statistics/agreement/coding/SetAnnotationsTest.java | // Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/distance/MASISetAnnotationDistanceFunction.java
// public class MASISetAnnotationDistanceFunction
// implements IDistanceFunction
// {
//
// @Override
// public double measureDistance(final IAnnotationStudy study, Object categ... | import org.dkpro.statistics.agreement.distance.MASISetAnnotationDistanceFunction;
import org.dkpro.statistics.agreement.distance.SetAnnotation;
import org.dkpro.statistics.agreement.distance.SetAnnotationDistanceFunction;
import junit.framework.TestCase; | public void testPercentageAgreement()
{
ICodingAnnotationStudy study = createExample();
PercentageAgreement percentageAgreement = new PercentageAgreement(study);
assertEquals(0.333, percentageAgreement.calculateAgreement(), 0.001);
}
public void testMaxPercentageAgreement(... | // Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/distance/MASISetAnnotationDistanceFunction.java
// public class MASISetAnnotationDistanceFunction
// implements IDistanceFunction
// {
//
// @Override
// public double measureDistance(final IAnnotationStudy study, Object categ... | study.addItem(new SetAnnotation(), new SetAnnotation()); |
dkpro/dkpro-statistics | dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/coding/MaxPercentageAgreement.java | // Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/IAnnotationUnit.java
// public interface IAnnotationUnit
// extends Serializable
// {
// /**
// * Returns the index of the rater who coded this unit (in case of a coding study) or defined the
// * boundaries of this unit ... | import org.dkpro.statistics.agreement.IAnnotationUnit;
import org.dkpro.statistics.agreement.distance.SetAnnotation; | /*
* Copyright 2014
* Ubiquitous Knowledge Processing (UKP) Lab
* Technische Universität Darmstadt
*
* 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/... | // Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/IAnnotationUnit.java
// public interface IAnnotationUnit
// extends Serializable
// {
// /**
// * Returns the index of the rater who coded this unit (in case of a coding study) or defined the
// * boundaries of this unit ... | SetAnnotation setAnnotation = null; |
dkpro/dkpro-statistics | dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/coding/MaxPercentageAgreement.java | // Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/IAnnotationUnit.java
// public interface IAnnotationUnit
// extends Serializable
// {
// /**
// * Returns the index of the rater who coded this unit (in case of a coding study) or defined the
// * boundaries of this unit ... | import org.dkpro.statistics.agreement.IAnnotationUnit;
import org.dkpro.statistics.agreement.distance.SetAnnotation; | /*
* Copyright 2014
* Ubiquitous Knowledge Processing (UKP) Lab
* Technische Universität Darmstadt
*
* 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/... | // Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/IAnnotationUnit.java
// public interface IAnnotationUnit
// extends Serializable
// {
// /**
// * Returns the index of the rater who coded this unit (in case of a coding study) or defined the
// * boundaries of this unit ... | for (IAnnotationUnit annotationUnit : item.getUnits()) { |
dkpro/dkpro-statistics | dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/coding/RandolphKappaAgreement.java | // Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/IChanceCorrectedAgreement.java
// public interface IChanceCorrectedAgreement
// extends IAgreementMeasure
// {
// /**
// * Returns the observed agreement of an annotation study. The observed agreement is basically
// * th... | import org.dkpro.statistics.agreement.IChanceCorrectedAgreement; | /*
* Copyright 2014
* Ubiquitous Knowledge Processing (UKP) Lab
* Technische Universität Darmstadt
*
* 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/... | // Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/IChanceCorrectedAgreement.java
// public interface IChanceCorrectedAgreement
// extends IAgreementMeasure
// {
// /**
// * Returns the observed agreement of an annotation study. The observed agreement is basically
// * th... | implements IChanceCorrectedAgreement |
dkpro/dkpro-statistics | dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/distance/IntervalDistanceFunction.java | // Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/IAnnotationStudy.java
// public interface IAnnotationStudy
// extends Serializable
// {
//
// // -- Raters --
//
// /** Returns the number of raters participating in this study. */
// int getRaterCount();
//
// i... | import org.dkpro.statistics.agreement.IAnnotationStudy; | /*
* Copyright 2014
* Ubiquitous Knowledge Processing (UKP) Lab
* Technische Universität Darmstadt
*
* 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/license... | // Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/IAnnotationStudy.java
// public interface IAnnotationStudy
// extends Serializable
// {
//
// // -- Raters --
//
// /** Returns the number of raters participating in this study. */
// int getRaterCount();
//
// i... | public double measureDistance(final IAnnotationStudy study, final Object category1, |
dkpro/dkpro-statistics | dkpro-statistics-agreement/src/test/java/org/dkpro/statistics/agreement/coding/WeightedAgreementTest.java | // Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/IAnnotationStudy.java
// public interface IAnnotationStudy
// extends Serializable
// {
//
// // -- Raters --
//
// /** Returns the number of raters participating in this study. */
// int getRaterCount();
//
// i... | import java.util.Hashtable;
import org.dkpro.statistics.agreement.IAnnotationStudy;
import org.dkpro.statistics.agreement.distance.IDistanceFunction;
import org.dkpro.statistics.agreement.distance.IntervalDistanceFunction;
import org.dkpro.statistics.agreement.distance.NominalDistanceFunction;
import junit.framework.Te... | /*
* Copyright 2014
* Ubiquitous Knowledge Processing (UKP) Lab
* Technische Universität Darmstadt
*
* 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/license... | // Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/IAnnotationStudy.java
// public interface IAnnotationStudy
// extends Serializable
// {
//
// // -- Raters --
//
// /** Returns the number of raters participating in this study. */
// int getRaterCount();
//
// i... | IDistanceFunction weightedDistanceFunction = new IDistanceFunction() |
dkpro/dkpro-statistics | dkpro-statistics-agreement/src/test/java/org/dkpro/statistics/agreement/coding/WeightedAgreementTest.java | // Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/IAnnotationStudy.java
// public interface IAnnotationStudy
// extends Serializable
// {
//
// // -- Raters --
//
// /** Returns the number of raters participating in this study. */
// int getRaterCount();
//
// i... | import java.util.Hashtable;
import org.dkpro.statistics.agreement.IAnnotationStudy;
import org.dkpro.statistics.agreement.distance.IDistanceFunction;
import org.dkpro.statistics.agreement.distance.IntervalDistanceFunction;
import org.dkpro.statistics.agreement.distance.NominalDistanceFunction;
import junit.framework.Te... | /*
* Copyright 2014
* Ubiquitous Knowledge Processing (UKP) Lab
* Technische Universität Darmstadt
*
* 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/license... | // Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/IAnnotationStudy.java
// public interface IAnnotationStudy
// extends Serializable
// {
//
// // -- Raters --
//
// /** Returns the number of raters participating in this study. */
// int getRaterCount();
//
// i... | public double measureDistance(final IAnnotationStudy study, |
dkpro/dkpro-statistics | dkpro-statistics-agreement/src/test/java/org/dkpro/statistics/agreement/coding/WeightedAgreementTest.java | // Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/IAnnotationStudy.java
// public interface IAnnotationStudy
// extends Serializable
// {
//
// // -- Raters --
//
// /** Returns the number of raters participating in this study. */
// int getRaterCount();
//
// i... | import java.util.Hashtable;
import org.dkpro.statistics.agreement.IAnnotationStudy;
import org.dkpro.statistics.agreement.distance.IDistanceFunction;
import org.dkpro.statistics.agreement.distance.IntervalDistanceFunction;
import org.dkpro.statistics.agreement.distance.NominalDistanceFunction;
import junit.framework.Te... | {1 / 3.0, 2 / 9.0, 2 / 9.0, 1 / 9.0, 1 / 9.0, 0 / 3.0, 2 / 9.0},
{1 / 3.0, 3 / 3.0, 3 / 3.0, 3 / 3.0, 1 / 6.0, 2 / 9.0, 0 / 3.0}
};
final Hashtable<Object, Integer> idx = new Hashtable<Object, Integer>();
idx.put("", 0);
... | // Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/IAnnotationStudy.java
// public interface IAnnotationStudy
// extends Serializable
// {
//
// // -- Raters --
//
// /** Returns the number of raters participating in this study. */
// int getRaterCount();
//
// i... | new NominalDistanceFunction()); |
dkpro/dkpro-statistics | dkpro-statistics-agreement/src/test/java/org/dkpro/statistics/agreement/coding/WeightedAgreementTest.java | // Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/IAnnotationStudy.java
// public interface IAnnotationStudy
// extends Serializable
// {
//
// // -- Raters --
//
// /** Returns the number of raters participating in this study. */
// int getRaterCount();
//
// i... | import java.util.Hashtable;
import org.dkpro.statistics.agreement.IAnnotationStudy;
import org.dkpro.statistics.agreement.distance.IDistanceFunction;
import org.dkpro.statistics.agreement.distance.IntervalDistanceFunction;
import org.dkpro.statistics.agreement.distance.NominalDistanceFunction;
import junit.framework.Te... | return WEIGHTS[idx.get(category1)][idx.get(category2)];
}
};
KrippendorffAlphaAgreement alpha = new KrippendorffAlphaAgreement(study, null);
alpha.setDistanceFunction(weightedDistanceFunction);
assertEquals(0.253, alpha.calculateObservedDisagreement()... | // Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/IAnnotationStudy.java
// public interface IAnnotationStudy
// extends Serializable
// {
//
// // -- Raters --
//
// /** Returns the number of raters participating in this study. */
// int getRaterCount();
//
// i... | kappaW = new WeightedKappaAgreement(study, new IntervalDistanceFunction()); |
dkpro/dkpro-statistics | dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/IWeightedAgreement.java | // Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/distance/IDistanceFunction.java
// public interface IDistanceFunction
// {
//
// /**
// * Returns a distance value for the given pair of categories used within the given annotation
// * study. Normally, the measure should re... | import org.dkpro.statistics.agreement.distance.IDistanceFunction; | /*
* Copyright 2014
* Ubiquitous Knowledge Processing (UKP) Lab
* Technische Universität Darmstadt
*
* 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/license... | // Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/distance/IDistanceFunction.java
// public interface IDistanceFunction
// {
//
// /**
// * Returns a distance value for the given pair of categories used within the given annotation
// * study. Normally, the measure should re... | public IDistanceFunction getDistanceFunction(); |
dkpro/dkpro-statistics | dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/coding/WeightedAgreement.java | // Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/DisagreementMeasure.java
// public abstract class DisagreementMeasure
// implements IAgreementMeasure
// {
// /**
// * Calculates the inter-rater agreement for the annotation study that was passed to the class
// * constr... | import org.dkpro.statistics.agreement.DisagreementMeasure;
import org.dkpro.statistics.agreement.IWeightedAgreement;
import org.dkpro.statistics.agreement.distance.IDistanceFunction; | /*
* Copyright 2014
* Ubiquitous Knowledge Processing (UKP) Lab
* Technische Universität Darmstadt
*
* 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/... | // Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/DisagreementMeasure.java
// public abstract class DisagreementMeasure
// implements IAgreementMeasure
// {
// /**
// * Calculates the inter-rater agreement for the annotation study that was passed to the class
// * constr... | implements IWeightedAgreement |
dkpro/dkpro-statistics | dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/coding/WeightedAgreement.java | // Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/DisagreementMeasure.java
// public abstract class DisagreementMeasure
// implements IAgreementMeasure
// {
// /**
// * Calculates the inter-rater agreement for the annotation study that was passed to the class
// * constr... | import org.dkpro.statistics.agreement.DisagreementMeasure;
import org.dkpro.statistics.agreement.IWeightedAgreement;
import org.dkpro.statistics.agreement.distance.IDistanceFunction; | /*
* Copyright 2014
* Ubiquitous Knowledge Processing (UKP) Lab
* Technische Universität Darmstadt
*
* 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/... | // Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/DisagreementMeasure.java
// public abstract class DisagreementMeasure
// implements IAgreementMeasure
// {
// /**
// * Calculates the inter-rater agreement for the annotation study that was passed to the class
// * constr... | protected IDistanceFunction distanceFunction; |
dkpro/dkpro-statistics | dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/coding/DiceAgreement.java | // Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/IAnnotationUnit.java
// public interface IAnnotationUnit
// extends Serializable
// {
// /**
// * Returns the index of the rater who coded this unit (in case of a coding study) or defined the
// * boundaries of this unit ... | import org.dkpro.statistics.agreement.IAnnotationUnit;
import org.dkpro.statistics.agreement.distance.SetAnnotation; | /*
* Copyright 2014
* Ubiquitous Knowledge Processing (UKP) Lab
* Technische Universität Darmstadt
*
* 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/... | // Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/IAnnotationUnit.java
// public interface IAnnotationUnit
// extends Serializable
// {
// /**
// * Returns the index of the rater who coded this unit (in case of a coding study) or defined the
// * boundaries of this unit ... | SetAnnotation setAnnotation = null; |
dkpro/dkpro-statistics | dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/coding/DiceAgreement.java | // Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/IAnnotationUnit.java
// public interface IAnnotationUnit
// extends Serializable
// {
// /**
// * Returns the index of the rater who coded this unit (in case of a coding study) or defined the
// * boundaries of this unit ... | import org.dkpro.statistics.agreement.IAnnotationUnit;
import org.dkpro.statistics.agreement.distance.SetAnnotation; | /*
* Copyright 2014
* Ubiquitous Knowledge Processing (UKP) Lab
* Technische Universität Darmstadt
*
* 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/... | // Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/IAnnotationUnit.java
// public interface IAnnotationUnit
// extends Serializable
// {
// /**
// * Returns the index of the rater who coded this unit (in case of a coding study) or defined the
// * boundaries of this unit ... | for (IAnnotationUnit annotationUnit : item.getUnits()) { |
dkpro/dkpro-statistics | dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/distance/NominalDistanceFunction.java | // Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/IAnnotationStudy.java
// public interface IAnnotationStudy
// extends Serializable
// {
//
// // -- Raters --
//
// /** Returns the number of raters participating in this study. */
// int getRaterCount();
//
// i... | import org.dkpro.statistics.agreement.IAnnotationStudy; | /*
* Copyright 2014
* Ubiquitous Knowledge Processing (UKP) Lab
* Technische Universität Darmstadt
*
* 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/license... | // Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/IAnnotationStudy.java
// public interface IAnnotationStudy
// extends Serializable
// {
//
// // -- Raters --
//
// /** Returns the number of raters participating in this study. */
// int getRaterCount();
//
// i... | public double measureDistance(final IAnnotationStudy study, final Object category1, |
dkpro/dkpro-statistics | dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/visualization/DistanceMatrixPrinter.java | // Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/coding/ICodingAnnotationStudy.java
// public interface ICodingAnnotationStudy
// extends IAnnotationStudy
// {
//
// // -- Categories --
//
// /**
// * Returns true if, and only if, the annotation study contains at least... | import java.io.PrintStream;
import org.dkpro.statistics.agreement.coding.ICodingAnnotationStudy;
import org.dkpro.statistics.agreement.distance.IDistanceFunction; | /*
* Copyright 2014
* Ubiquitous Knowledge Processing (UKP) Lab
* Technische Universität Darmstadt
*
* 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/license... | // Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/coding/ICodingAnnotationStudy.java
// public interface ICodingAnnotationStudy
// extends IAnnotationStudy
// {
//
// // -- Categories --
//
// /**
// * Returns true if, and only if, the annotation study contains at least... | final IDistanceFunction distanceFunction) |
dkpro/dkpro-statistics | dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/visualization/DistanceMatrixPrinter.java | // Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/coding/ICodingAnnotationStudy.java
// public interface ICodingAnnotationStudy
// extends IAnnotationStudy
// {
//
// // -- Categories --
//
// /**
// * Returns true if, and only if, the annotation study contains at least... | import java.io.PrintStream;
import org.dkpro.statistics.agreement.coding.ICodingAnnotationStudy;
import org.dkpro.statistics.agreement.distance.IDistanceFunction; | /*
* Copyright 2014
* Ubiquitous Knowledge Processing (UKP) Lab
* Technische Universität Darmstadt
*
* 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/license... | // Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/coding/ICodingAnnotationStudy.java
// public interface ICodingAnnotationStudy
// extends IAnnotationStudy
// {
//
// // -- Categories --
//
// /**
// * Returns true if, and only if, the annotation study contains at least... | public void print(final PrintStream out, final ICodingAnnotationStudy study, |
dkpro/dkpro-statistics | dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/distance/RatioDistanceFunction.java | // Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/IAnnotationStudy.java
// public interface IAnnotationStudy
// extends Serializable
// {
//
// // -- Raters --
//
// /** Returns the number of raters participating in this study. */
// int getRaterCount();
//
// i... | import org.dkpro.statistics.agreement.IAnnotationStudy; | /*
* Copyright 2014
* Ubiquitous Knowledge Processing (UKP) Lab
* Technische Universität Darmstadt
*
* 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/... | // Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/IAnnotationStudy.java
// public interface IAnnotationStudy
// extends Serializable
// {
//
// // -- Raters --
//
// /** Returns the number of raters participating in this study. */
// int getRaterCount();
//
// i... | public double measureDistance(final IAnnotationStudy study, final Object category1, |
dkpro/dkpro-statistics | dkpro-statistics-agreement/src/test/java/org/dkpro/statistics/agreement/coding/Fleiss1971Test.java | // Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/ICategorySpecificAgreement.java
// public interface ICategorySpecificAgreement
// {
// /**
// * Calculates the inter-rater agreement for the given category.
// *
// * @see ICategorySpecificAgreement
// */
// /*... | import java.util.Iterator;
import org.dkpro.statistics.agreement.ICategorySpecificAgreement;
import junit.framework.TestCase; | /*
* Copyright 2014
* Ubiquitous Knowledge Processing (UKP) Lab
* Technische Universität Darmstadt
*
* 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/license... | // Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/ICategorySpecificAgreement.java
// public interface ICategorySpecificAgreement
// {
// /**
// * Calculates the inter-rater agreement for the given category.
// *
// * @see ICategorySpecificAgreement
// */
// /*... | ICategorySpecificAgreement catAgreement = new FleissKappaAgreement(study); |
dkpro/dkpro-statistics | dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/distance/MASISetAnnotationDistanceFunction.java | // Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/IAnnotationStudy.java
// public interface IAnnotationStudy
// extends Serializable
// {
//
// // -- Raters --
//
// /** Returns the number of raters participating in this study. */
// int getRaterCount();
//
// i... | import org.dkpro.statistics.agreement.IAnnotationStudy; | /*
* Copyright 2014
* Ubiquitous Knowledge Processing (UKP) Lab
* Technische Universität Darmstadt
*
* 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/... | // Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/IAnnotationStudy.java
// public interface IAnnotationStudy
// extends Serializable
// {
//
// // -- Raters --
//
// /** Returns the number of raters participating in this study. */
// int getRaterCount();
//
// i... | public double measureDistance(final IAnnotationStudy study, Object category1, Object category2) |
dkpro/dkpro-statistics | dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/visualization/UnitizingStudyPrinter.java | // Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/unitizing/IUnitizingAnnotationStudy.java
// public interface IUnitizingAnnotationStudy
// extends IAnnotationStudy
// {
//
// // -- Units --
//
// /** Allows iterating all annotation units of this study. */
// Collection<... | import java.io.PrintStream;
import java.util.Objects;
import org.dkpro.statistics.agreement.unitizing.IUnitizingAnnotationStudy;
import org.dkpro.statistics.agreement.unitizing.IUnitizingAnnotationUnit; | /*
* Copyright 2014
* Ubiquitous Knowledge Processing (UKP) Lab
* Technische Universität Darmstadt
*
* 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/license... | // Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/unitizing/IUnitizingAnnotationStudy.java
// public interface IUnitizingAnnotationStudy
// extends IAnnotationStudy
// {
//
// // -- Units --
//
// /** Allows iterating all annotation units of this study. */
// Collection<... | public void printContinuum(final PrintStream out, final IUnitizingAnnotationStudy study, |
dkpro/dkpro-statistics | dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/visualization/UnitizingStudyPrinter.java | // Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/unitizing/IUnitizingAnnotationStudy.java
// public interface IUnitizingAnnotationStudy
// extends IAnnotationStudy
// {
//
// // -- Units --
//
// /** Allows iterating all annotation units of this study. */
// Collection<... | import java.io.PrintStream;
import java.util.Objects;
import org.dkpro.statistics.agreement.unitizing.IUnitizingAnnotationStudy;
import org.dkpro.statistics.agreement.unitizing.IUnitizingAnnotationUnit; | if (lastDigit == 0 || i == 0 || i == L) {
pos = pos / 10;
}
else {
break;
}
}
while (pos > 0);
}
for (int j = digits - 1; j >= 0; j--) {
out.print(j == 0 ? p[0] : p... | // Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/unitizing/IUnitizingAnnotationStudy.java
// public interface IUnitizingAnnotationStudy
// extends IAnnotationStudy
// {
//
// // -- Units --
//
// /** Allows iterating all annotation units of this study. */
// Collection<... | for (IUnitizingAnnotationUnit unit : study.getUnits()) { |
dkpro/dkpro-statistics | dkpro-statistics-agreement/src/test/java/org/dkpro/statistics/agreement/coding/HayesKrippendorff2007Test.java | // Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/distance/OrdinalDistanceFunction.java
// public class OrdinalDistanceFunction
// implements IDistanceFunction
// {
//
// @Override
// public double measureDistance(final IAnnotationStudy study, final Object category1,
// ... | import org.dkpro.statistics.agreement.distance.OrdinalDistanceFunction;
import junit.framework.TestCase; | /*
* Copyright 2014
* Ubiquitous Knowledge Processing (UKP) Lab
* Technische Universität Darmstadt
*
* 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/... | // Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/distance/OrdinalDistanceFunction.java
// public class OrdinalDistanceFunction
// implements IDistanceFunction
// {
//
// @Override
// public double measureDistance(final IAnnotationStudy study, final Object category1,
// ... | new OrdinalDistanceFunction()); |
dkpro/dkpro-statistics | dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/coding/FleissKappaAgreement.java | // Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/IAnnotationUnit.java
// public interface IAnnotationUnit
// extends Serializable
// {
// /**
// * Returns the index of the rater who coded this unit (in case of a coding study) or defined the
// * boundaries of this unit ... | import java.math.BigDecimal;
import java.math.MathContext;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
import org.dkpro.statistics.agreement.IAnnotationUnit;
import org.dkpro.statistics.agreement.ICategorySpecificAgreement;
import org.dkpro.statistics.agreement.IChanceCorrectedAgreement; | /*
* Copyright 2014
* Ubiquitous Knowledge Processing (UKP) Lab
* Technische Universität Darmstadt
*
* 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/... | // Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/IAnnotationUnit.java
// public interface IAnnotationUnit
// extends Serializable
// {
// /**
// * Returns the index of the rater who coded this unit (in case of a coding study) or defined the
// * boundaries of this unit ... | implements IChanceCorrectedAgreement, ICategorySpecificAgreement |
dkpro/dkpro-statistics | dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/coding/FleissKappaAgreement.java | // Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/IAnnotationUnit.java
// public interface IAnnotationUnit
// extends Serializable
// {
// /**
// * Returns the index of the rater who coded this unit (in case of a coding study) or defined the
// * boundaries of this unit ... | import java.math.BigDecimal;
import java.math.MathContext;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
import org.dkpro.statistics.agreement.IAnnotationUnit;
import org.dkpro.statistics.agreement.ICategorySpecificAgreement;
import org.dkpro.statistics.agreement.IChanceCorrectedAgreement; | /*
* Copyright 2014
* Ubiquitous Knowledge Processing (UKP) Lab
* Technische Universität Darmstadt
*
* 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/... | // Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/IAnnotationUnit.java
// public interface IAnnotationUnit
// extends Serializable
// {
// /**
// * Returns the index of the rater who coded this unit (in case of a coding study) or defined the
// * boundaries of this unit ... | implements IChanceCorrectedAgreement, ICategorySpecificAgreement |
dkpro/dkpro-statistics | dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/coding/FleissKappaAgreement.java | // Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/IAnnotationUnit.java
// public interface IAnnotationUnit
// extends Serializable
// {
// /**
// * Returns the index of the rater who coded this unit (in case of a coding study) or defined the
// * boundaries of this unit ... | import java.math.BigDecimal;
import java.math.MathContext;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
import org.dkpro.statistics.agreement.IAnnotationUnit;
import org.dkpro.statistics.agreement.ICategorySpecificAgreement;
import org.dkpro.statistics.agreement.IChanceCorrectedAgreement; | * @date 04.03.2011
*/
/*
* Calculates the inter-rater agreement for the given annotation category based on the object's
* annotation study that has been passed to the class constructor.
*
* @throws NullPointerException if the study is null or the given category is null.
*
*... | // Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/IAnnotationUnit.java
// public interface IAnnotationUnit
// extends Serializable
// {
// /**
// * Returns the index of the rater who coded this unit (in case of a coding study) or defined the
// * boundaries of this unit ... | for (IAnnotationUnit annotation : item.getUnits()) { |
dkpro/dkpro-statistics | dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/coding/KrippendorffAlphaAgreement.java | // Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/IAnnotationUnit.java
// public interface IAnnotationUnit
// extends Serializable
// {
// /**
// * Returns the index of the rater who coded this unit (in case of a coding study) or defined the
// * boundaries of this unit ... | import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
import java.util.TreeMap;
import org.dkpro.statistics.agreement.IAnnotationUnit;
import org.dkpro.statistics.agreement.ICategorySpecificAgreement;
import org.dkpro.statistics.agreement.IChanceCorrectedDisagreement;
import org.dkpro.statistics.a... | /*
* Copyright 2014
* Ubiquitous Knowledge Processing (UKP) Lab
* Technische Universität Darmstadt
*
* 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/... | // Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/IAnnotationUnit.java
// public interface IAnnotationUnit
// extends Serializable
// {
// /**
// * Returns the index of the rater who coded this unit (in case of a coding study) or defined the
// * boundaries of this unit ... | implements IChanceCorrectedDisagreement, ICategorySpecificAgreement, |
dkpro/dkpro-statistics | dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/coding/KrippendorffAlphaAgreement.java | // Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/IAnnotationUnit.java
// public interface IAnnotationUnit
// extends Serializable
// {
// /**
// * Returns the index of the rater who coded this unit (in case of a coding study) or defined the
// * boundaries of this unit ... | import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
import java.util.TreeMap;
import org.dkpro.statistics.agreement.IAnnotationUnit;
import org.dkpro.statistics.agreement.ICategorySpecificAgreement;
import org.dkpro.statistics.agreement.IChanceCorrectedDisagreement;
import org.dkpro.statistics.a... | /*
* Copyright 2014
* Ubiquitous Knowledge Processing (UKP) Lab
* Technische Universität Darmstadt
*
* 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/... | // Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/IAnnotationUnit.java
// public interface IAnnotationUnit
// extends Serializable
// {
// /**
// * Returns the index of the rater who coded this unit (in case of a coding study) or defined the
// * boundaries of this unit ... | implements IChanceCorrectedDisagreement, ICategorySpecificAgreement, |
dkpro/dkpro-statistics | dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/coding/KrippendorffAlphaAgreement.java | // Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/IAnnotationUnit.java
// public interface IAnnotationUnit
// extends Serializable
// {
// /**
// * Returns the index of the rater who coded this unit (in case of a coding study) or defined the
// * boundaries of this unit ... | import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
import java.util.TreeMap;
import org.dkpro.statistics.agreement.IAnnotationUnit;
import org.dkpro.statistics.agreement.ICategorySpecificAgreement;
import org.dkpro.statistics.agreement.IChanceCorrectedDisagreement;
import org.dkpro.statistics.a... | /*
* Copyright 2014
* Ubiquitous Knowledge Processing (UKP) Lab
* Technische Universität Darmstadt
*
* 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/... | // Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/IAnnotationUnit.java
// public interface IAnnotationUnit
// extends Serializable
// {
// /**
// * Returns the index of the rater who coded this unit (in case of a coding study) or defined the
// * boundaries of this unit ... | final IDistanceFunction distanceFunction) |
dkpro/dkpro-statistics | dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/coding/KrippendorffAlphaAgreement.java | // Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/IAnnotationUnit.java
// public interface IAnnotationUnit
// extends Serializable
// {
// /**
// * Returns the index of the rater who coded this unit (in case of a coding study) or defined the
// * boundaries of this unit ... | import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
import java.util.TreeMap;
import org.dkpro.statistics.agreement.IAnnotationUnit;
import org.dkpro.statistics.agreement.ICategorySpecificAgreement;
import org.dkpro.statistics.agreement.IChanceCorrectedDisagreement;
import org.dkpro.statistics.a... | double result = 0.0;
for (Entry<Object, Map<Object, Double>> cat1 : coincidenceMatrix.entrySet()) {
for (Entry<Object, Double> cat2 : cat1.getValue().entrySet()) {
result += cat2.getValue()
* distanceFunction.measureDistance(study, cat1.getKey(), cat2.... | // Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/IAnnotationUnit.java
// public interface IAnnotationUnit
// extends Serializable
// {
// /**
// * Returns the index of the rater who coded this unit (in case of a coding study) or defined the
// * boundaries of this unit ... | throw new InsufficientDataException( |
dkpro/dkpro-statistics | dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/coding/KrippendorffAlphaAgreement.java | // Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/IAnnotationUnit.java
// public interface IAnnotationUnit
// extends Serializable
// {
// /**
// * Returns the index of the rater who coded this unit (in case of a coding study) or defined the
// * boundaries of this unit ... | import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
import java.util.TreeMap;
import org.dkpro.statistics.agreement.IAnnotationUnit;
import org.dkpro.statistics.agreement.ICategorySpecificAgreement;
import org.dkpro.statistics.agreement.IChanceCorrectedDisagreement;
import org.dkpro.statistics.a... | n += n_c;
}
/*
* double D_E = 0.0; for (Entry<Object, Double> cat1 : marginals.entrySet()) for
* (Entry<Object, Double> cat2 : marginals.entrySet()) D_E += cat1.getValue() *
* cat2.getValue() distanceFunction.measureDistance(study, cat1.getKey(), cat2.getKey());
... | // Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/IAnnotationUnit.java
// public interface IAnnotationUnit
// extends Serializable
// {
// /**
// * Returns the index of the rater who coded this unit (in case of a coding study) or defined the
// * boundaries of this unit ... | for (IAnnotationUnit annotation : item.getUnits()) { |
dkpro/dkpro-statistics | dkpro-statistics-significance/src/test/java/org/dkpro/statistics/significance/SignificanceTest.java | // Path: dkpro-statistics-significance/src/main/java/org/dkpro/statistics/significance/Significance.java
// public static boolean testCorrelations(double correlation1, double correlation2, int n1, int n2,
// double alpha)
// throws MathException
// {
//
// double p = getSignificance(correlation1, corre... | import static org.dkpro.statistics.significance.Significance.testCorrelations;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import org.apache.commons.math.MathException;
import org.junit.Test; | /*
* Copyright 2013
* Ubiquitous Knowledge Processing (UKP) Lab
* Technische Universität Darmstadt
*
* 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/license... | // Path: dkpro-statistics-significance/src/main/java/org/dkpro/statistics/significance/Significance.java
// public static boolean testCorrelations(double correlation1, double correlation2, int n1, int n2,
// double alpha)
// throws MathException
// {
//
// double p = getSignificance(correlation1, corre... | assertTrue(testCorrelations(0.5, 0.74, 68, 68, 0.2)); |
dkpro/dkpro-statistics | dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/distance/SetAnnotationDistanceFunction.java | // Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/IAnnotationStudy.java
// public interface IAnnotationStudy
// extends Serializable
// {
//
// // -- Raters --
//
// /** Returns the number of raters participating in this study. */
// int getRaterCount();
//
// i... | import org.dkpro.statistics.agreement.IAnnotationStudy; | /*
* Copyright 2014
* Ubiquitous Knowledge Processing (UKP) Lab
* Technische Universität Darmstadt
*
* 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/license... | // Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/IAnnotationStudy.java
// public interface IAnnotationStudy
// extends Serializable
// {
//
// // -- Raters --
//
// /** Returns the number of raters participating in this study. */
// int getRaterCount();
//
// i... | public double measureDistance(final IAnnotationStudy study, final Object category1, |
dkpro/dkpro-statistics | dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/coding/ScottPiAgreement.java | // Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/IChanceCorrectedAgreement.java
// public interface IChanceCorrectedAgreement
// extends IAgreementMeasure
// {
// /**
// * Returns the observed agreement of an annotation study. The observed agreement is basically
// * th... | import java.math.BigDecimal;
import java.math.MathContext;
import java.util.Map;
import org.dkpro.statistics.agreement.IChanceCorrectedAgreement; | /*
* Copyright 2014
* Ubiquitous Knowledge Processing (UKP) Lab
* Technische Universität Darmstadt
*
* 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/... | // Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/IChanceCorrectedAgreement.java
// public interface IChanceCorrectedAgreement
// extends IAgreementMeasure
// {
// /**
// * Returns the observed agreement of an annotation study. The observed agreement is basically
// * th... | implements IChanceCorrectedAgreement |
dkpro/dkpro-statistics | dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/visualization/ContingencyMatrixPrinter.java | // Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/coding/ICodingAnnotationItem.java
// public interface ICodingAnnotationItem
// extends IAnnotationItem
// {
// /**
// * Returns the annotation unit of the rater with the specified index. That is, the object
// * holding t... | import java.io.PrintStream;
import java.util.LinkedHashMap;
import java.util.Map;
import org.dkpro.statistics.agreement.coding.ICodingAnnotationItem;
import org.dkpro.statistics.agreement.coding.ICodingAnnotationStudy; | /*
* Copyright 2014
* Ubiquitous Knowledge Processing (UKP) Lab
* Technische Universität Darmstadt
*
* 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/license... | // Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/coding/ICodingAnnotationItem.java
// public interface ICodingAnnotationItem
// extends IAnnotationItem
// {
// /**
// * Returns the annotation unit of the rater with the specified index. That is, the object
// * holding t... | public void print(final PrintStream out, final ICodingAnnotationStudy study) |
dkpro/dkpro-statistics | dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/visualization/ContingencyMatrixPrinter.java | // Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/coding/ICodingAnnotationItem.java
// public interface ICodingAnnotationItem
// extends IAnnotationItem
// {
// /**
// * Returns the annotation unit of the rater with the specified index. That is, the object
// * holding t... | import java.io.PrintStream;
import java.util.LinkedHashMap;
import java.util.Map;
import org.dkpro.statistics.agreement.coding.ICodingAnnotationItem;
import org.dkpro.statistics.agreement.coding.ICodingAnnotationStudy; | /*
* Copyright 2014
* Ubiquitous Knowledge Processing (UKP) Lab
* Technische Universität Darmstadt
*
* 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/license... | // Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/coding/ICodingAnnotationItem.java
// public interface ICodingAnnotationItem
// extends IAnnotationItem
// {
// /**
// * Returns the annotation unit of the rater with the specified index. That is, the object
// * holding t... | for (ICodingAnnotationItem item : study.getItems()) { |
dkpro/dkpro-statistics | dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/coding/CodingAnnotationStudy.java | // Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/AnnotationStudy.java
// public abstract class AnnotationStudy
// implements IAnnotationStudy
// {
// private static final long serialVersionUID = -3596722258510421730L;
//
// protected List<String> raters;
// protected... | import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import org.dkpro.statistics.agreement.AnnotationStudy;
import org.dkpro.statistics.agreement.AnnotationUnit;
import org.dkpro.statistics.agreement.IAnnotationUnit; | * if the number of annotations does not match the number of raters.
*/
public ICodingAnnotationItem addItemAsArray(final Object[] annotations)
{
if (annotations.length != raters.size()) {
throw new IllegalArgumentException("Incorrect number of annotation units "
... | // Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/AnnotationStudy.java
// public abstract class AnnotationStudy
// implements IAnnotationStudy
// {
// private static final long serialVersionUID = -3596722258510421730L;
//
// protected List<String> raters;
// protected... | protected IAnnotationUnit createUnit(int index, int raterIdx, final Object category) |
dkpro/dkpro-statistics | dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/coding/CodingAnnotationStudy.java | // Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/AnnotationStudy.java
// public abstract class AnnotationStudy
// implements IAnnotationStudy
// {
// private static final long serialVersionUID = -3596722258510421730L;
//
// protected List<String> raters;
// protected... | import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import org.dkpro.statistics.agreement.AnnotationStudy;
import org.dkpro.statistics.agreement.AnnotationUnit;
import org.dkpro.statistics.agreement.IAnnotationUnit; | public ICodingAnnotationItem addItemAsArray(final Object[] annotations)
{
if (annotations.length != raters.size()) {
throw new IllegalArgumentException("Incorrect number of annotation units "
+ "(expected " + raters.size() + ", given " + annotations.length + "). "
... | // Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/AnnotationStudy.java
// public abstract class AnnotationStudy
// implements IAnnotationStudy
// {
// private static final long serialVersionUID = -3596722258510421730L;
//
// protected List<String> raters;
// protected... | IAnnotationUnit result = new AnnotationUnit(/* index, */raterIdx, category); |
dkpro/dkpro-statistics | dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/distance/CachedDistanceFunction.java | // Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/IAnnotationStudy.java
// public interface IAnnotationStudy
// extends Serializable
// {
//
// // -- Raters --
//
// /** Returns the number of raters participating in this study. */
// int getRaterCount();
//
// i... | import java.util.Hashtable;
import org.dkpro.statistics.agreement.IAnnotationStudy; | /*
* Copyright 2014
* Ubiquitous Knowledge Processing (UKP) Lab
* Technische Universität Darmstadt
*
* 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/... | // Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/IAnnotationStudy.java
// public interface IAnnotationStudy
// extends Serializable
// {
//
// // -- Raters --
//
// /** Returns the number of raters participating in this study. */
// int getRaterCount();
//
// i... | public double measureDistance(final IAnnotationStudy study, final Object category1, |
dkpro/dkpro-statistics | dkpro-statistics-agreement/src/test/java/org/dkpro/statistics/agreement/coding/TwoRaterAgreementTest.java | // Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/InsufficientDataException.java
// public class InsufficientDataException
// extends RuntimeException
// {
// private static final long serialVersionUID = -3081535421752493402L;
//
// public InsufficientDataException()
// {... | import junit.framework.TestCase;
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
import java.util.Iterator;
import org.dkpro.statistics.agreement.InsufficientDataException; | public void testCategorySpecificAgreement() {
ICodingAnnotationStudy study = createExample();
new ContingencyMatrixPrinter().print(System.out, study);
new CoincidenceMatrixPrinter().print(System.out, study);
PercentageAgreement pa = new PercentageAgreement(study);
assertEqu... | // Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/InsufficientDataException.java
// public class InsufficientDataException
// extends RuntimeException
// {
// private static final long serialVersionUID = -3081535421752493402L;
//
// public InsufficientDataException()
// {... | assertThatExceptionOfType(InsufficientDataException.class) |
dkpro/dkpro-statistics | dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/coding/BennettSAgreement.java | // Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/IChanceCorrectedAgreement.java
// public interface IChanceCorrectedAgreement
// extends IAgreementMeasure
// {
// /**
// * Returns the observed agreement of an annotation study. The observed agreement is basically
// * th... | import org.dkpro.statistics.agreement.IChanceCorrectedAgreement; | /*
* Copyright 2014
* Ubiquitous Knowledge Processing (UKP) Lab
* Technische Universität Darmstadt
*
* 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/... | // Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/IChanceCorrectedAgreement.java
// public interface IChanceCorrectedAgreement
// extends IAgreementMeasure
// {
// /**
// * Returns the observed agreement of an annotation study. The observed agreement is basically
// * th... | implements IChanceCorrectedAgreement |
dkpro/dkpro-statistics | dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/visualization/ReliabilityMatrixPrinter.java | // Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/IAnnotationUnit.java
// public interface IAnnotationUnit
// extends Serializable
// {
// /**
// * Returns the index of the rater who coded this unit (in case of a coding study) or defined the
// * boundaries of this unit ... | import java.io.PrintStream;
import java.util.LinkedHashMap;
import java.util.Map;
import org.dkpro.statistics.agreement.IAnnotationUnit;
import org.dkpro.statistics.agreement.coding.ICodingAnnotationItem;
import org.dkpro.statistics.agreement.coding.ICodingAnnotationStudy; | /*
* Copyright 2014
* Ubiquitous Knowledge Processing (UKP) Lab
* Technische Universität Darmstadt
*
* 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/license... | // Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/IAnnotationUnit.java
// public interface IAnnotationUnit
// extends Serializable
// {
// /**
// * Returns the index of the rater who coded this unit (in case of a coding study) or defined the
// * boundaries of this unit ... | public void print(final PrintStream out, final ICodingAnnotationStudy study) |
dkpro/dkpro-statistics | dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/visualization/ReliabilityMatrixPrinter.java | // Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/IAnnotationUnit.java
// public interface IAnnotationUnit
// extends Serializable
// {
// /**
// * Returns the index of the rater who coded this unit (in case of a coding study) or defined the
// * boundaries of this unit ... | import java.io.PrintStream;
import java.util.LinkedHashMap;
import java.util.Map;
import org.dkpro.statistics.agreement.IAnnotationUnit;
import org.dkpro.statistics.agreement.coding.ICodingAnnotationItem;
import org.dkpro.statistics.agreement.coding.ICodingAnnotationStudy; | /*
* Copyright 2014
* Ubiquitous Knowledge Processing (UKP) Lab
* Technische Universität Darmstadt
*
* 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/license... | // Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/IAnnotationUnit.java
// public interface IAnnotationUnit
// extends Serializable
// {
// /**
// * Returns the index of the rater who coded this unit (in case of a coding study) or defined the
// * boundaries of this unit ... | for (ICodingAnnotationItem item : study.getItems()) { |
dkpro/dkpro-statistics | dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/visualization/ReliabilityMatrixPrinter.java | // Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/IAnnotationUnit.java
// public interface IAnnotationUnit
// extends Serializable
// {
// /**
// * Returns the index of the rater who coded this unit (in case of a coding study) or defined the
// * boundaries of this unit ... | import java.io.PrintStream;
import java.util.LinkedHashMap;
import java.util.Map;
import org.dkpro.statistics.agreement.IAnnotationUnit;
import org.dkpro.statistics.agreement.coding.ICodingAnnotationItem;
import org.dkpro.statistics.agreement.coding.ICodingAnnotationStudy; | /*
* Copyright 2014
* Ubiquitous Knowledge Processing (UKP) Lab
* Technische Universität Darmstadt
*
* 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/license... | // Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/IAnnotationUnit.java
// public interface IAnnotationUnit
// extends Serializable
// {
// /**
// * Returns the index of the rater who coded this unit (in case of a coding study) or defined the
// * boundaries of this unit ... | for (IAnnotationUnit unit : item.getUnits()) { |
dkpro/dkpro-statistics | dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/coding/PercentageAgreement.java | // Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/IAnnotationUnit.java
// public interface IAnnotationUnit
// extends Serializable
// {
// /**
// * Returns the index of the rater who coded this unit (in case of a coding study) or defined the
// * boundaries of this unit ... | import org.dkpro.statistics.agreement.IAnnotationUnit;
import org.dkpro.statistics.agreement.ICategorySpecificAgreement; | /*
* Copyright 2014
* Ubiquitous Knowledge Processing (UKP) Lab
* Technische Universität Darmstadt
*
* 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/... | // Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/IAnnotationUnit.java
// public interface IAnnotationUnit
// extends Serializable
// {
// /**
// * Returns the index of the rater who coded this unit (in case of a coding study) or defined the
// * boundaries of this unit ... | implements ICodingItemSpecificAgreement, ICategorySpecificAgreement |
dkpro/dkpro-statistics | dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/coding/PercentageAgreement.java | // Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/IAnnotationUnit.java
// public interface IAnnotationUnit
// extends Serializable
// {
// /**
// * Returns the index of the rater who coded this unit (in case of a coding study) or defined the
// * boundaries of this unit ... | import org.dkpro.statistics.agreement.IAnnotationUnit;
import org.dkpro.statistics.agreement.ICategorySpecificAgreement; | /*
* Copyright 2014
* Ubiquitous Knowledge Processing (UKP) Lab
* Technische Universität Darmstadt
*
* 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/... | // Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/IAnnotationUnit.java
// public interface IAnnotationUnit
// extends Serializable
// {
// /**
// * Returns the index of the rater who coded this unit (in case of a coding study) or defined the
// * boundaries of this unit ... | for (IAnnotationUnit annotation : item.getUnits()) { |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.